bootstrp関数でサンプルの抽出数を変更する方法はあるか
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur リサンプリングの手法 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!