필터 지우기
필터 지우기

bootstrp with replacement

조회 수: 2 (최근 30일)
jenka
jenka 2011년 12월 5일
Hi everybody, I have a vector that consists of values 0 or 1. I would like to use bootstrp with replacement to generate 100 resamples sets from this vector of the same size. Could anybody help me with this line. I am using this function but it does not give me right results: it gives me either all 0s or all 1s. Thanks
  댓글 수: 1
Jan
Jan 2011년 12월 5일
Please post the code.

댓글을 달려면 로그인하십시오.

답변 (1개)

bym
bym 2011년 12월 6일
I do not see the behavior you are describing:
x= (rand(10,1)<.5);
[a,b]=bootstrp(10,@mean,x);
x(b(:,1));
x(b(:,2));
the first answer is
ans =
0
0
0
0
0
0
0
0
0
0
suspiciously like you described. However the second answer is
ans =
1
0
0
0
1
0
0
0
1
0

태그

Community Treasure Hunt

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

Start Hunting!

Translated by