How to use vratiotest to calculate 10 day variance/1 day variance to get variance ratio

7 vues (au cours des 30 derniers jours)
I have a vector of 1713 stock price observations. I need to loop through these to get the variance ratio for every day (or as many as possible). Here is the code I have so far:
for i = 22:length(IYRPanelData);
if IYRPanelData(i,j) ~= NaN;
[IYRh(i-21,j),IYRpValue(i-21,j),IYRstat(i-21,j),IYRcValue(i-21,j),IYRratio(i-21,j)] = vratiotest(IYRPanelData(i-21:i,j),'period',10);
else [IYRh(i-21,j),IYRpValue(i-21,j),IYRstat(i-21,j),IYRcValue(i-21,j),IYRratio(i-21,j)] = NaN;
end
end
What else do I need to do? I need to obtain the maximum number of variance ratios possible.
  1 commentaire
Jack Bratton
Jack Bratton le 22 Avr 2018
I forgot to mention, I am doing this for multiple columns as well. That is what the j is for. I know how to do that part though.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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!

Translated by