Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.7K Views
|
6 Replies
|
1 Total Like
View groups...
Share
Share this post:

Remove one element within a nested list or create lists of equal length

Posted 4 years ago
POSTED BY: Raymond Low
6 Replies
Posted 4 years ago

Take a look at the documentation for Rest and Most. FinancialData returns a TimeSeries. There are many functions available for time-series processing. For time-series correlation, take a look at this post on MSE and this one on this site.

POSTED BY: Rohit Namjoshi
Posted 4 years ago
POSTED BY: Bill Nelson
Posted 4 years ago

Hi Bill The correlations between no deletion and 1 day deletion enter image description here

I plotted the graphs, but Return is the % change in price from the day before, so the charts just looks like noise.
enter image description here

I did average the Return, which did reduce the error caused by the one day deletion. enter image description here

Below is the Notebook

POSTED BY: Raymond Low
Posted 4 years ago

"Surprising" and "such a difference from such a small change" always makes me think "I've made a mistake in this somehow."

Perhaps the time stamps might be too important to discard. Is there any way you could do a ListPlot with the time stamps and another without the time stamps and see if the reason for the large change becomes obvious? If that explains things then would interpolating the {value,time} points to construct value=function[time] still make your computations easy

POSTED BY: Bill Nelson
Posted 4 years ago

Excellent job Bill

I had manually removed the first element from the first list because it was the easiest. I did a correlation test between the first list and the next two lists. My method resulted in a correlation near zero for list 1 related to lists 2 & 3. The data is time stamped, I just removed the time stamp for easier computations. I then used your method that basically removes the last element in the list. I was quite surprised to find a correlation of 30% between list 1 with both lists 2 & 3. There are 168 elements in each of the three lists, it was quite surprising to find such a difference between either removing the first versus removing the last element.

Thanks so much for your help.

POSTED BY: Raymond Low
Posted 4 years ago

Perhaps

lists={{1,2,3},{4,5,6,7},{8,9}};
minlen=Min@@Map[Length,lists];
res=Map[Take[#,minlen]&,lists]

which returns

{{1,2},{4,5},{8,9}}
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard