Main Content

convertto

Convert to specified frequency

convertto is not recommended. Use timetable instead. For more information, see Convert Financial Time Series Objects fints to Timetables.

Description

example

newfts = convertto(oldfts,newfreq) converts the object oldfts to the new time series object newfts with the frequency newfreq.

Examples

collapse all

  1. Create a fints object.

    dates_and_times = (now:now+5)'
    dates_and_times =
    
       1.0e+05 *
    
        7.3840
        7.3840
        7.3840
        7.3841
        7.3841
        7.3841
    
     f = fints(dates_and_times, randn(6,1))
    Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see Convert Financial Time Series Objects (fints) to Timetables. 
    > In fints (line 169) 
    f = 
     
        desc:  (none)
        freq:  Unknown (0)
    
        {'dates:  (6)'}    {'times:  (6)'}    {'series1:  (6)'}
        {'03-Sep-2021'}    {'12:06'      }    {[      -0.7697]}
        {'04-Sep-2021'}    {'12:06'      }    {[       0.3714]}
        {'05-Sep-2021'}    {'12:06'      }    {[      -0.2256]}
        {'06-Sep-2021'}    {'12:06'      }    {[       1.1174]}
        {'07-Sep-2021'}    {'12:06'      }    {[      -1.0891]}
        {'08-Sep-2021'}    {'12:06'      }    {[       0.0326]} 
    
  2. Convert the frequency using convertto.

    newfts = convertto(f,3)
    Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see Convert Financial Time Series Objects (fints) to Timetables. 
    > In fints/convertto (line 30) 
     
    newfts = 
     
        desc:  TOMONTHLY: old_FTS
        freq:  Monthly (3)
    
        {'dates:  (1)'}    {'times:  (1)'}    {'series1:  (1)'}
        {'30-Sep-2021'}    {'00:00'      }    {[       0.0326]}
    

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

New frequency indicator, specified using one of the allowed values:

  • 1, 'DAILY', 'Daily', 'daily', 'D', 'd'

  • 2, 'WEEKLY', 'Weekly', 'weekly', 'W', 'w'

  • 3, 'MONTHLY', 'Monthly', 'monthly', 'M', 'm'

  • 4, 'QUARTERLY', 'Quarterly', 'quarterly', 'Q', 'q'

  • 5, 'SEMIANNUAL', 'Semiannual', 'semiannual', 'S', 's'

  • 6, 'ANNUAL', 'Annual', 'annual', 'A', 'a'

Data Types: char | double

Output Arguments

collapse all

Financial time series object, returned as a fints object.

Version History

Introduced before R2006a