Financial Time Series Toolbox | ![]() ![]() |
Syntax
Arguments
|
Financial time series object |
|
Integer specifying the number of data points over which each periodic average should be averaged |
|
Time period over which the data is averaged |
Description
peravg
calculates periodic averages of a financial time series object. Periodic averages are calculated from the values per period defined. If the period supplied is a string, it is assumed as a range of date string. If the period is entered as numeric, the number represents the number of data points (financial time series periods) to be included in a period for the calculation. For example, if you enter '01/01/98::01/01/99'
as the period input argument, peravg
returns the average of the time series between those dates, inclusive. However, if you enter the number 5
as the period input, peravg
returns a series of averages from the time series data taken 5 date points (financial time series periods) at a time.
avgfts = peravg(tsobj, numperiod)
returns a structure avgfts
that contains the periodic (per numperiod
periods) average of the financial time series object. avgfts
has field names identical to data series names of tsobj
.
avgfts = peravg(tsobj, daterange)
returns a structure avgfts
that contains the periodic (as specified by daterange
) average of the financial time series object. avgfts
has field names identical to data series names of tsobj
.
See Also
mean
in the MATLAB documentation
![]() | onbalvol | plot | ![]() |