fints
to TimetablesIn R2018a, financial time series (fints
), and its associated methods have been replaced with a MATLAB®
timetable
function. If you use
fints
or the associated methods, you receive a warning. To help
you convert from the older fints
to the newer
timetable
functionality, use the following information.
I/O Related Operations
Task | Old Functionality | New Functionality |
---|---|---|
Construct by passing in data and dates | fints(dates,data,datanames) |
|
Construct by conversion of files | ascii2fts(filename,descrow,colheadrow,skiprows) |
|
Construct by using App with user interface | Using the Financial Time Series app with user interface | Using ImportData from HOME tab |
Write files | fts2ascii(filename,tsobj,exttext) | writetable(TT,filename) |
Convert to matrix | fts2mat(tsobj) |
|
Indexing an Object
Task | Old Functionality | New Functionality |
---|---|---|
Indexing with a date | myfts('05/11/99') |
|
Indexing with a date range | myfts ('05/11/99::05/15/99') |
|
Indexing with integers for rows |
|
|
Contents of a specific time field | myfts.times | timeofday(TT.Properties.RowTimes) |
Contents for a specific field in a matrix | fts2mat(myfts.series2) |
|
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 | Old Functionality | New Functionality |
---|---|---|
Boxcox transformation | newfts = boxcox(oldfts) |
|
Differencing | diff(myfts) |
|
Indexing with integers for rows |
|
(Assumes no missing dates) |
Linear filtering | filter(B,A, myfts) |
|
Lag or lead time series object |
|
(Assumes a regularly spaced timetable) |
Periodic average | peravg(myfts) |
|
Downsample data | resamplets(oldfts,samplestep) |
|
Smooth data | smoothts(input) |
|
Moving average | tsmovavg(tsobj,method,lag) |
|
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 | Old Functionality | New Functionality |
---|---|---|
Convert to specified frequency | convertto(oldfts,newfreq) |
|
Convert to annual | toannual(oldfts,CalcMethod) |
|
Convert to daily | todaily(oldfts,CalcMethod) | retime(TT,'daily',method) |
Convert to monthly | tomonthly(oldfts,CalcMethod) | retime(TT,'monthly',method) |
Convert to quarterly | toquarterly(oldfts,CalcMethod) |
|
Convert to semiannual | tosemi(oldfts,CalcMethod) |
|
Convert to weekly | toweekly(oldfts,CalcMethod) |
|
Merge Operations
Task | Old Functionality | New Functionality |
---|---|---|
Merge multiple time series objects | merge(fts1,fts2) |
|
Concatenate financial time series objects horizontally | horzcat(fts1,fts2) or
[fts1,fts2] |
|
Concatenate financial time series objects vertically | vertcat(fts1,fts2) or
[fts1;fts2] | vertcat[TT1;TT2] |
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 | Old Functionality | New Functionality |
---|---|---|
Extract out numerical data | srs2 = myfts.series2 |
|
Apply some options (statistics) | For example: min , max ,
mean , median ,
cov , std , and
var |
|
Apply some options (operations) | For example: sum and
cumsum |
|
Refer to timetable
documentation for data
extraction methods and examples.
diff
| fillmissing
| isregular
| issorted
| retime
| rmmissing
| sortrows
| synchronize
| timerange
| timetable
| unique
| vartype
| withtol