I want to do bootstrap analysis by using 20*1 matrix.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Chris
le 26 Oct 2022
Réponse apportée : the cyclist
le 27 Oct 2022
I want to draw 500 samples from the 20*1 matrix (20 pairs of observations).
In this case, what codes do I have to use?
0 commentaires
Réponse acceptée
the cyclist
le 27 Oct 2022
One way is
% Pretend input data
M = rand(20,1);
idx = randi(20,500,1);
samples = M(idx);
0 commentaires
Plus de réponses (1)
the cyclist
le 27 Oct 2022
If you have the Statistics and Machine Learning Toolbox, you can do
% Pretend input data
M = rand(20,1);
samples = randsample(M,500,true);
0 commentaires
Voir également
Catégories
En savoir plus sur Descriptive Statistics and Visualization dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!