Borrar filtros
Borrar filtros

Access time series in Financial Toolbox

1 visualización (últimos 30 días)
Andrey Vasilyev
Andrey Vasilyev el 6 de Ag. de 2015
Respondida: Brendan Hamm el 10 de Ag. de 2015
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 comentario
Andrey Vasilyev
Andrey Vasilyev el 7 de Ag. de 2015
fints doesnt work properly if there are time series for more than 10 assets.

Iniciar sesión para comentar.

Respuesta aceptada

Brendan Hamm
Brendan Hamm el 10 de Ag. de 2015
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.

Más respuestas (1)

Abhishek Pandey
Abhishek Pandey el 10 de Ag. de 2015
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 comentario
Andrey Vasilyev
Andrey Vasilyev el 10 de Ag. de 2015
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

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by