Message Boards Message Boards

0
|
5984 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Issue with Transposing Time Series?

Posted 5 years ago

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

POSTED BY: Michael Madsen
2 Replies
Posted 5 years ago

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

POSTED BY: Michael Madsen
Posted 5 years 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 BY: Updating Name
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