Convert price series to return series
[RetSeries, RetIntervals] = tick2ret(TickSeries, TickTimes, Method)
Number of observations (NUMOBS) by number of assets (NASSETS) matrix of prices of equity assets. Each column is a price series of an individual asset. First row is oldest observation. Last row is most recent. Observations across a given row occur at the same time for all columns.
(Optional) NUMOBS-by-1 increasing vector of observation times associated with the prices in TickSeries. Times are serial date numbers (day units) or decimal numbers in arbitrary units (for example, yearly). If TickTimes is empty or missing, sequential observation times from 1, 2, ... NUMOBS are assumed.
(Optional) Character string indicating the method to convert prices to asset returns. Must be 'Simple' (default) or 'Continuous'. If Method is 'Simple', tick2ret computes simple periodic returns. If Method is 'Continuous', returns are continuously compounded. Case is ignored for Method.
[RetSeries, RetIntervals] = tick2ret(TickSeries, TickTimes, Method) computes the asset returns realized between NUMOBS observations of prices of NASSETS assets.
RetSeries is a (NUMOBS-1)-by-NASSETS time series array of asset returns associated with the prices in TickSeries. The ith return is quoted for the period TickTimes(i) to TickTimes(i+1) and is not normalized by the time increment between successive price observations. If Method is unspecified or 'Simple', the returns are:
RetSeries(i) = TickSeries(i+1)/TickSeries(i) - 1
If Method is 'Continuous', the returns are:
RetSeries(i) = log[TickSeries(i+1)/TickSeries(i)]
RetIntervals is a (NUMOBS-1)-by-1 column vector of interval times between observations. If TickTimes is empty or unspecified, all intervals are assumed to have length 1.
This example shows how to convert price series to return series, given periodic returns of two stocks observed in the first, second, third, and fourth quarters.
TickSeries = [100 80 110 90 115 88 110 91]; TickTimes = [0 6 9 12]; [RetSeries, RetIntervals] = tick2ret(TickSeries, TickTimes)
RetSeries = 0.1000 0.1250 0.0455 -0.0222 -0.0435 0.0341 RetIntervals = 6 3 3