What function to use to calculate a vector of variance ratios
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a vector of stock returns (or prices, whichever is needed), and need to calculate the variance ratio over time. Each of the variance ratio functions that I found only returned one number, the variance ratio test number. I need a vector of variance ratios for the entire time period. Is there a function that would allow me to do this?
0 comentarios
Respuestas (1)
Divyajyoti Nayak
el 26 de Feb. de 2025
You can use the 'vratiotest' function that you've mentioned to get the variance ratios across a vector. Normally the 'vratiotest' returns only the variance test rejection decision, but it has multiple arguments including a vector of variance ratios. Here's the documentation for it and some sample code:
load Data_GlobalIdx1
dates = datetime(dates,ConvertFrom="datenum");
TT = table2timetable(DataTable,RowTimes=dates);
LTT = varfun(@log,TT(:,2:end));
q = [2 4 8 2 4 8];
iid = logical([1 1 1 0 0 0]);
[StatTbl,ratio] = vratiotest(LTT,Period=q,IID=iid,DataVariable="log_SP")
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox 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!