bootstrp関数でサンプルの抽出数を変更する方法はあるか
3 views (last 30 days)
Show older comments
MATLABのbootstrp関数およびbootci関数についての質問となります.
ブートストラップ法では, n個のデータがあったとして, そのうち m個(m≦n) のデータを抽出します.
その抽出数mを指定する方法はありますでしょうか?
以下のコードではn=200個のデータに対して必ずm=200個のデータが抽出されてしまいます. 様々なmでのブートストラップサンプルが欲しいです.
以下のコードが例となります.
n=200; % 全データ数
data=randn(n,1);
bootstat=bootstrp(5,@testfunc,data);
function a=testfunc(x)
disp("m="+length(x)); % bootstrp内部で抽出されるデータ数
a=mean(x,"all");
end
出力は以下の通りです.
m=200
m=200
m=200
m=200
m=200
m=200
0 Comments
Answers (0)
See Also
Categories
Find more on リサンプリングの手法 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!