How to use bootci with lsqcurvefit or fmincon?

1 view (last 30 days)
tdata=1:405;
ydata=[469.853000000000 452.032000000000 436.021000000000 425.059000000000 420.692000000000 346.982000000000 332.589000000000 373.203000000000 359.584000000000 348.564000000000 351.962000000000 337.149000000000 370.682000000000 387.334000000000 413.210000000000 409.887000000000 408.833000000000 321.685000000000 350.772000000000 346.802000000000 190.865000000000 84.6400000000000 379.822000000000 393.138000000000 379.879000000000 354.414000000000 352.648000000000 360.871000000000 336.340000000000 388.188000000000 376.836000000000 388.637000000000 374.865000000000 367.260000000000 363.904000000000 330.850000000000 292.914000000000 265.668000000000 290.227000000000 270.011000000000 275.235000000000 253.118000000000 244.138000000000 209.953000000000 227.742000000000 298.204000000000 287.107000000000 242.069000000000 244.113000000000 253.732000000000 204.405000000000 203.404000000000 141.385000000000 209.798000000000 241.245000000000 203.553000000000 204.866000000000 204.953000000000 201.797000000000 209.607000000000 215.551000000000 199.489000000000 211.290000000000 197.566000000000 197.425000000000 203.445000000000 216.331000000000 210.660000000000 202.242000000000 188.372000000000 176.866000000000 185.641000000000 210.906000000000 203.288000000000 189.962000000000 177.756000000000 163.131000000000 162.394000000000 160.071000000000 166.692000000000 146.687000000000 129.537000000000 119.301000000000 166.491000000000 171.513000000000 167.200000000000 151.692000000000 148.194000000000 174.248000000000 179.352000000000 210.792000000000 187.148000000000 176.969000000000 198.815000000000 210.606000000000 194.673000000000 223.898000000000 234.170000000000 214.169000000000 238.008000000000 208.691000000000 148.187000000000 186.608000000000 229.787000000000 196.853000000000 226.010000000000 285.072000000000 226.971000000000 221.813000000000 213.540000000000 195.896000000000 201.771000000000 174.561000000000 204.283000000000 213.400000000000 216.280000000000 120.463000000000 120.710000000000 122.266000000000 115.140000000000 132.897000000000 130.949000000000 128.778000000000 116.947000000000 121.747000000000 129.329000000000 118.692000000000 153.579000000000 133.497000000000 144.904000000000 150.173000000000 145.240000000000 144.474000000000 162.840000000000 145.949000000000 137.603000000000 144.484000000000 145.829000000000 132.495000000000 144.575000000000 80.9440000000000 45.5720000000000 133.957000000000 148.880000000000 139.791000000000 206.176000000000 166.452000000000 157.405000000000 152.055000000000 156.034000000000 157.678000000000 144.897000000000 151.577000000000 93.4420000000000 167.215000000000 164.914000000000 162.841000000000 177.452000000000 146.043000000000 144.260000000000 148.575000000000 151.361000000000 145.549000000000 145.107000000000 147.089000000000 147.860000000000 149.819000000000 78.2350000000000 164.739000000000 184.439000000000 155.760000000000 149.766000000000 145.183000000000 143.797000000000 132.835000000000 129.554000000000 122.445000000000 94.6380000000000 151.393000000000 132.706000000000 142.728000000000 122.135000000000 102.441000000000 135.361000000000 133.608000000000 130.787000000000 112.441000000000 125.219000000000 129.188000000000 120.483000000000 118.321000000000 112.207000000000 105.847000000000 110.827000000000 126.767000000000 148.196000000000 146.502000000000 110.712000000000 96.9090000000000 97.0760000000000 107.844000000000 97.4200000000000 109.140000000000 126.358000000000 113.810000000000 116.745000000000 98.3220000000000 49.7910000000000 36.5920000000000 49.8010000000000 118.234000000000 140.772000000000 131.907000000000 116.896000000000 121.783000000000 136.824000000000 138.786000000000 125.581000000000 126.744000000000 146.144000000000 111.340000000000 105.585000000000 105.778000000000 95.8750000000000 100.879000000000 116.359000000000 116.143000000000 97.7820000000000 112.941000000000 101.453000000000 116.240000000000 124.855000000000 130.226000000000 87.8880000000000 119.566000000000 130.332000000000 98.8580000000000 95.2710000000000 116.631000000000 109.825000000000 115.895000000000 110.386000000000 105.202000000000 93.9880000000000 85.8770000000000 55.1440000000000 65.7130000000000 124.820000000000 128.496000000000 120.148000000000 155.695000000000 117.624000000000 116.558000000000 117.513000000000 100.583000000000 103.537000000000 113.478000000000 94.2730000000000 93.9570000000000 95.7340000000000 104.695000000000 94.5330000000000 95.5860000000000 87.0360000000000 96.0980000000000 97.6870000000000 85.1690000000000 93.6310000000000 90.0830000000000 93.1610000000000 87.3140000000000 84.0990000000000 96.0750000000000 88.9330000000000 91.9760000000000 87.7170000000000 102.577000000000 106.497000000000 95.8810000000000 95.4780000000000 93.6980000000000 90.3030000000000 88.3080000000000 93.7680000000000 97.8220000000000 95.3190000000000 96.5810000000000 96.0180000000000 106.736000000000 93.6880000000000 114.628000000000 86.6410000000000 102.035000000000 85.3240000000000 91.0550000000000 87.5110000000000 91.1560000000000 87.0550000000000 80.5320000000000 84.2800000000000 82.7560000000000 83.1630000000000 83.9040000000000 82.7010000000000 85.9880000000000 86.3640000000000 119.820000000000 115.566000000000 118.125000000000 116.965000000000 142.255000000000 123.486000000000 89.2960000000000 96.5070000000000 91.1520000000000 83.0180000000000 98.9740000000000 104.009000000000 57.4180000000000 89.4010000000000 91.8620000000000 94.0020000000000 90.9720000000000 93.4650000000000 94.2000000000000 95.2940000000000 94.5320000000000 86.2540000000000 71.9390000000000 76.7350000000000 78.9760000000000 82.0800000000000 84.5910000000000 78.8110000000000 80.4050000000000 81.7950000000000 88.6140000000000 68.6380000000000 78.4530000000000 79.3010000000000 76.9140000000000 85.7650000000000 85.4870000000000 85.4510000000000 86.9970000000000 84.1670000000000 82.3490000000000 80.7980000000000 86.5750000000000 65.0020000000000 59.4780000000000 62.9730000000000 87.6530000000000 85.6000000000000 89.7610000000000 87.0260000000000 83.9020000000000 89.1650000000000 85.3120000000000 92.1630000000000 71.5130000000000 75.4520000000000 75.1130000000000 74.3340000000000 76.3070000000000 58.4600000000000 77.9980000000000 73.3630000000000 76.3970000000000 72.0380000000000 77.3990000000000 73.0420000000000 77.0810000000000 74.9040000000000 68.8710000000000 68.2910000000000 69.8440000000000 67.0950000000000 65.2610000000000 72.9640000000000 110.775000000000 103.712000000000 99.6910000000000 94.7190000000000 110.530000000000 102.742000000000 106.768000000000 114.675000000000 70.7090000000000 68.2850000000000 73.4690000000000 77.9910000000000 70.8340000000000 69.7300000000000 71.7430000000000 60.6370000000000 65.8100000000000 52.3610000000000 35.8110000000000 31.4190000000000 36.7530000000000 39.2120000000000 37.0130000000000 39.5180000000000 41.4490000000000];
qi=ydata(1,1);
beta=1;
modelfun = @(a,x)1/gamma(beta).*qi./(1-(1-(1+a(1)./a(2).*x).^(a(2))));
a0=[0.5,1];
lb = [0,0];
ub = [];
theta = @(predictor,response)nlinfit(predictor,response,modelfun,a0);
[ci, bootstat] = bootci(1000,{theta,tdata,ydata},'Alpha',0.1);
%my question is what if i change nlinfit to lsqcurvefit with lowerbound and upperbound? what will be the %functionhandle theta? Thank you for your help!
%I tried :
theta = @(predictor,response)lsqcurvefit(modelfun,a0,tdata,ydata,lb,ub)
%it only returns single value with multiple times.

Answers (0)

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!