Effacer les filtres
Effacer les filtres

random resampling with rebalancement

2 vues (au cours des 30 derniers jours)
Dam
Dam le 6 Août 2012
I have an array Y (3000*1) from which i want to drow an n=100 random samples with rebalancement(with repeating possible), such that each sample contains 252 consecutive values from Y (i.e only the starting point is randomly chosen) the reslut dimensions are meant to be 252*100
Thank you for helping with this
regards
  2 commentaires
Oleg Komarov
Oleg Komarov le 6 Août 2012
what if I pick the 2999 value? Should I continue in a circular way, i.e.
2999, 3000, 1, 2 ...
Dam
Dam le 6 Août 2012
Modifié(e) : Dam le 6 Août 2012
No, they have to be 252 consecutive values; so the last 251 values of Y must be exonerated from the choice of the random starting point.
thank you

Connectez-vous pour commenter.

Réponse acceptée

bym
bym le 6 Août 2012
Modifié(e) : bym le 6 Août 2012
r = randi(2748,100,1);
x = zeros(252,100);
for k = 1:100
x(:,k) = Y(r(k):r(k) + 251);
end
  1 commentaire
Dam
Dam le 13 Août 2012
Thank you for your answer It works well

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by