Access time series in Financial Toolbox

1 回表示 (過去 30 日間)
Andrey Vasilyev
Andrey Vasilyev 2015 年 8 月 6 日
回答済み: Brendan Hamm 2015 年 8 月 10 日
Hi,
After creating financial time series object using 'fints' function, I have difficulty accessing specific time series:
>>fints_tickData = fints(dates,hist_data,[],'d');
>>fints_tickData.series1
Error using fints/subsref (line 141)
The specified property 'series1' does not exist in the object.
Here is fints_tickData object
>>fints_tickData =
desc: (none)
freq: Daily (1)
Columns 1 through 5
'dates: (261)' 'series 1: (261)' 'series 2: (261)' 'series 3: (261)' 'series 4: (261)'
I'm using:
Financial Toolbox Version 5.5 (R2015a)
  1 件のコメント
Andrey Vasilyev
Andrey Vasilyev 2015 年 8 月 7 日
fints doesnt work properly if there are time series for more than 10 assets.

サインインしてコメントする。

採用された回答

Brendan Hamm
Brendan Hamm 2015 年 8 月 10 日
Hi Andrey. It is not that the series is not created, but rather that all of the datanames have the same length. This means that your data are now referred to as 'series 1','series 2',...,'series10','series11', etc. and not 'series1','series2',...
Since there is a space we have to access this a little different:
num_assets = 12;
num_observ = 22;
data = random('Normal',0,1,num_observ,num_assets);
dates = [today:today+num_observ-1]';
fints_tickData = fints(dates, data, [], 'd');
fints_tickData.(series 1)
Consider using the datanames input to avoid this issue.

その他の回答 (1 件)

Abhishek Pandey
Abhishek Pandey 2015 年 8 月 10 日
Hi Andrey,
I understand you are having trouble accessing specific time series after creating a financial time series using “fints” function.
I tried to reproduce this issue using dummy data, but it seems to be working for me. I believe there might be an issue with the data. I get the error message that you have provided when I try to display a time series which doesn’t have any entries in it. However, there might be some other reason as well. If possible, share the data that you are using to create the financial time series object.
Here is what I tried using the dummy data:
data = [1:60; 21:80]';
dates = [today:today+59]';
fints_tickData = fints(dates, data, [], 'd');
Accessing “series1” or “series2” displays the respective data.
fints_tickData.series1
fints_tickData.series2
However accessing “series3” displays the same error message to me.
fints_tickData.series3
- Abhishek
  1 件のコメント
Andrey Vasilyev
Andrey Vasilyev 2015 年 8 月 10 日
Thanks for looking into this.
The problem arises when there are more than 10 time series. In your example there are 2.
Please see if that works:
num_assets = 12;
num_observ = 22;
data = random('Normal',0,1,num_observ,num_assets);
dates = [today:today+num_observ-1]';
fints_tickData = fints(dates, data, [], 'd');
fints_tickData.series1

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by