bootstrp関数でサンプルの抽出数を変更する方法はあるか
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu リサンプリングの手法 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!