Calculating concentration ratio - financial time series
4 views (last 30 days)
Show older comments
Hello everyone,
I am fairly new to MATLAB so please bare with me.
I have the time series of the S&P500 for 18 years and I would like to compute the concentration ratio of the index for each day (just a column vector). I know that I can use the function concentrationIndices from the MATLAB Risk Management tool which supports 7 measures one of which is the concentration ratio.
I am now wondering how to create the loop so I would get the concentration index for each trading day. I thought that I can use the for function but it doesnt really work:
n = 347 % number of assets
t = 4779 % number of trading days
for m = 1:t
ci(m) = concentrationIndices(Data200018(m,:)); % the m-th trading day
end
The error I get is:
Subscripting a table using linear indexing (one subscript) or multidimensional indexing
(three or more subscripts) is not supported. Use a row subscript and a variable subscript.
Can you please tell me what I am doing wrong?
Many thanks in advance!
Nadya
1 Comment
Clement Schuurman
on 2 Jun 2020
Hello Nadezhda,
I currently have the same problem using the function "concentrationIndices". I need to calculate these indices for every row of my matrix (rows represent trading days like in your case).
Have you been able to resolve the problem?
Thank you in advance!
Clément
Answers (0)
See Also
Categories
Find more on Transaction Cost Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!