how to fit exceeding probability curve? (Hazard curve)
4 views (last 30 days)
Show older comments
I want to fit a hazard curve (or exceedance= 1-CDF) to a set of raw data. Here is the code that I wrote.
As you may see in the attached file, I used linear polinomial fitting, but it does not seem accurate enogh.
yy=[216.623520000000 216.623520000000 234.746272000000 235.029440000000 263.063072000000 291.663040000000 325.643200000000 328.474880000000 334.138240000000 339.801600000000 342.633280000000 345.464960000000 365.286720000000 373.781760000000 385.108480000000 402.098560000000 410.593600000000 413.425280000000 424.752000000000 436.078720000000 438.910400000000 444.573760000000 447.405440000000 455.900480000000 461.563840000000 464.395520000000 470.058880000000 475.722240000000 489.880640000000 611.642880000000 620.137920000000 702.256640000000 832.513920000000 874.989120000000 880.652480000000 923.127680000000 999.583040000000 1064.71168000000 1098.69184000000 1127.00864000000 1152.49376000000 1166.65216000000 1192.13728000000 1282.75104000000 1446.98848000000 1452.65184000000 1458.31520000000 1489.46368000000 1509.28544000000 1523.44384000000 1529.10720000000 1557.42400000000 1560.25568000000 1571.58240000000 1585.74080000000 1588.57248000000 1591.40416000000 1599.89920000000 1749.97824000000 1846.25536000000 2069.95808000000 2137.91840000000 2177.56192000000 2231.36384000000 2234.19552000000 2242.69056000000 2304.98752000000]
POE_emp=[1 0.973684210526316 0.960526315789474 0.947368421052632 0.934210526315790 0.921052631578948 0.907894736842106 0.894736842105264 0.868421052631579 0.855263157894737 0.842105263157895 0.828947368421053 0.815789473684211 0.802631578947369 0.789473684210527 0.776315789473685 0.763157894736843 0.750000000000000 0.736842105263158 0.710526315789474 0.697368421052632 0.644736842105263 0.618421052631579 0.605263157894737 0.592105263157895 0.578947368421053 0.565789473684211 0.552631578947368 0.539473684210526 0.526315789473684 0.513157894736842 0.500000000000000 0.486842105263158 0.473684210526316 0.460526315789474 0.447368421052631 0.434210526315789 0.407894736842105 0.394736842105263 0.381578947368421 0.368421052631579 0.355263157894737 0.328947368421053 0.315789473684211 0.302631578947369 0.289473684210526 0.276315789473684 0.263157894736842 0.250000000000000 0.223684210526316 0.210526315789474 0.197368421052632 0.184210526315790 0.171052631578947 0.157894736842105 0.144736842105263 0.131578947368421 0.118421052631579 0.105263157894737 0.0921052631578947 0.0789473684210527 0.0657894736842105 0.0526315789473685 0.0394736842105263 0.0263157894736842 0.0131578947368421 0]
figure(1);
semilogx((POE_emp).*100,yy,'bs','MarkerFaceColor','blue','MarkerSize',8);hold on;
c1=polyfit((POE_emp).*100,yy,1);
y_est=polyval(c1,(POE_emp).*100);
semilogx((POE_emp).*100,y_est,'-r');
set ( gca, 'xdir', 'reverse' );
% ylim([99 10000]); xlim([0.01 1]);
xlabel('Annual Probability of Exceedance','FontSize',14,'fontweight','bold','FontName','TMag_LHSe New Roman');
ylim([0 3000]);
% xlim([0.01 0.98]);
xticks([1 10 100]);
aa = get(gca,'XTickLabel');
set(gca,'XTickLabel',aa,'fontsize',14,'FontWeight','bold');
grid minor;
0 Comments
Answers (0)
See Also
Categories
Find more on Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!