Main Content

std

Standard deviation

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

Description

example

tsstd = std(tsobj) computes the standard deviation of each data series in the financial time series object tsobj and returns the results in tsstd. The tsstd output is a structure with field name(s) identical to the data series name(s).

example

tsstd = std(tsobj,flag) normalizes the data as indicated by flag.

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
    
     tsobj = 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) 
    tsobj = 
     
        desc:  (none)
        freq:  Unknown (0)
    
        {'dates:  (6)'}    {'times:  (6)'}    {'series1:  (6)'}
        {'07-Sep-2021'}    {'12:30'      }    {[       0.5377]}
        {'08-Sep-2021'}    {'12:30'      }    {[       1.8339]}
        {'09-Sep-2021'}    {'12:30'      }    {[      -2.2588]}
        {'10-Sep-2021'}    {'12:30'      }    {[       0.8622]}
        {'11-Sep-2021'}    {'12:30'      }    {[       0.3188]}
        {'12-Sep-2021'}    {'12:30'      }    {[      -1.3077]}
  2. Calculate the standard deviation using std.

    tsstd = std(tsobj)
    Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see Convert Financial Time Series Objects (fints) to Timetables. 
    > In fints/std (line 29) 
    
    tsstd = 
    
      struct with fields:
    
        series1: 0.8807

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

Normalization factor, specified as a logical:

  • 1 — Normalizes by n (number of observations)

  • 0 — Normalizes by n-1

Data Types: logical

Output Arguments

collapse all

Standard deviation of each data series in the financial time series object, returned as a structure.

Version History

Introduced before R2006a