Bootstrap data in MATLAB

别等时光非礼了梦想. 提交于 2020-01-14 06:26:08

问题


I have data similar to this:

x = 0:0.1:10; y = exppdf(x,2); plot(x,y, 'o')

and then I want to have some resampled data close to them, but when I use the command below , the resampled data are really far from the original one!

[resampling, bootsam]=bootstrp(100, 'corr', x,y); plot(x,y(bootsam(:,100)), 'r*')

Could you please help me? I guess I need to change option 'corr' in the bootstrp command.


回答1:


I think this is what you are trying to do:

plot(x, sort(y(bootsam(:,100)), 'descend'), 'r*')

or maybe this:

plot(x(bootsam(:,100)),y(bootsam(:,100)), 'r*')

I guess it depends on what x is for you.



来源:https://stackoverflow.com/questions/19593590/bootstrap-data-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!