Message Boards Message Boards

GROUPS:

Issue with Transposing Time Series?

Posted 1 month ago
316 Views
|
2 Replies
|
0 Total Likes
|

I've had a working model of a financial graph model based on the blog post: https://blog.wolfram.com/2012/06/01/graph-theory-and-finance-in-mathematica/

However, since upgrading to 12.0 I'm running into an issue when trying to transpose the time series. I'm not sure why this is happening. Can anyone else validate or advise on what has changed?

port = {"AADEX","FGCKX","WFDSX"};
portRe=FinancialData[#,"Return",{{2019,1,1},{2019,5,03}},"Value"]&/@port;
portRe=PadLeft[portRe]
portco=Correlation[Transpose[portRe]];

Thanks

2 Replies
Posted 1 month ago

FinancialData used to return list of {date, value}. In version 12 (and in 11.3) it returns a TimeSeries, so you have to extract the data before you can transpose it.

portReData = Map[#["Values"] &, portRe];
portco = Correlation[Transpose[portReData]]
Posted 1 month ago

Thanks. That worked. Most of the time everything works fine, but little changes can produce unexpected results.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract