bootstrp関数でサンプルの抽出数を変更する方法はあるか
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre リサンプリングの手法 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!