Convert Financial Time Series Objects (fints
) to
Timetables
In R2023a, financial time series (fints
), and its associated
methods have been removed and are replaced with a MATLAB®
timetable
function. If you use
fints
or the associated methods, you receive an error. To help
you convert from the older fints
to the newer
timetable
functionality, use the following information.
Create Time Series
I/O Related Operations
Task | Removed Functionality | Use This Functionality |
---|---|---|
Construct by passing in data and dates | fints(dates,data,datanames) | Use
|
Construct by conversion of files | ascii2fts(filename,descrow,colheadrow,skiprows) | Use readtable and
table2timetable :
|
Write files | fts2ascii(filename,tsobj,exttext) | Use writetable :
|
Convert to matrix | fts2mat(tsobj) |
|
Index an Object
Indexing an Object
Task | Removed Functionality | Use This Functionality |
---|---|---|
Indexing with a date | myfts('05/11/99') |
|
Indexing with a date range | myfts ('05/11/99::05/15/99') | Use
|
Indexing with integers for rows |
|
|
Contents of a specific time field | myfts.times | Use timeofday :
|
Contents for a specific field in a matrix | fts2mat(myfts.series2) |
|
Transform Time Series
Assume that all variables are numeric within a timetable, or the operations can be
applied on TT2
:
S = vartype('numeric');
TT2 = TT(:,S)
Filter Time Series
Task | Removed Functionality | Use This Functionality |
---|---|---|
Boxcox transformation | newfts = boxcox(oldfts) | Use
|
Differencing | diff(myfts) |
|
Indexing with integers for rows |
| Use
(Assumes no missing dates) |
Linear filtering | filter(B,A, myfts) | Use
|
Lag or lead time series object |
| Use
(Assumes a regularly spaced timetable) |
Periodic average | peravg(myfts) | Use
|
Downsample data | resamplets(oldfts,samplestep) | Use
|
Smooth data | smoothts(input) | Use
|
Moving average | tsmovavg(tsobj,method,lag) | Use
|
Convert Time Series
Assume that all variables are numeric within a timetable, or the operations can be
applied on TT2
:
S = vartype('numeric');
TT2 = TT(:,S)
Conversion Operations
Task | Removed Functionality | Use This Functionality |
---|---|---|
Convert to specified frequency | convertto(oldfts,newfreq) | Use
|
Convert to annual | toannual(oldfts,...) | Use
|
Convert to daily | todaily(oldfts,...) | Use convert2daily :
|
Convert to monthly | tomonthly(oldfts,...) | Use convert2monthly :
|
Convert to quarterly | toquarterly(oldfts,...) | Use
|
Convert to semiannual | tosemi(oldfts,...) | Use
|
Convert to weekly | toweekly(oldfts,...) | Use
|
Merge Time Series
Merge Operations
Task | Removed Functionality | Use This Functionality |
---|---|---|
Merge multiple time series objects | merge(fts1,fts2) |
|
Concatenate financial time series objects horizontally | horzcat(fts1,fts2) or
[fts1,fts2] | Use
|
Concatenate financial time series objects vertically | vertcat(fts1,fts2) or
[fts1;fts2] | Use vertcat :
|
Analyze Time Series
Due to flexibility of a timetable that can hold heterogeneous variables, a timetable does not support math operations or descriptive statistical calculations. If you would like to apply any numeric calculations on a timetable, use the following guidelines.
Assume that all variables are numeric within a timetable, or the operations can be
applied on TT2
:
S = vartype('numeric');
TT2 = TT(:,S)
Descriptive Statistics and Arithmetic and Math Operations
Task | Removed Functionality | Use This Functionality |
---|---|---|
Extract out numerical data | srs2 = myfts.series2 |
|
Apply some options (statistics) | For example: min , max ,
mean , median ,
cov , std , and
var | Use
|
Apply some options (operations) | For example: sum and
cumsum |
|
Data Extraction
Refer to timetable
documentation for data
extraction methods and examples.
See Also
timetable
| retime
| synchronize
| timerange
| withtol
| vartype
| issorted
| sortrows
| unique
| diff
| isregular
| rmmissing
| fillmissing
| convert2daily
| convert2weekly
| convert2monthly
| convert2quarterly
| convert2semiannual
| convert2annual