Main Content


Convert returns to prices


[TickSeries,TickTimes] = ...


[TickSeries,TickTimes] = ...
generates price series for the specified assets, given the asset starting prices and the return observations for each asset.

Input Arguments


Time series array of returns. RetSeries can be a column vector or a matrix:

  • As a vector, RetSeries represents a univariate series of returns of a single asset. The length of the vector is the number of observations (NUMOBS). The first element contains the oldest observation, and the last element the most recent.

  • As a matrix, RetSeries represents a NUMOBS-by-number of assets (NUMASSETS) matrix of asset returns. Rows correspond to time indices. The first row contains the oldest observations and the last row the most recent. ret2price assumes that the observations across a given row occur at the same time for all columns, and each column is a return series of an individual asset.


A NUMASSETS element vector of initial prices for each asset, or a single scalar initial price applied to all assets. If StartPrice = [] or is unspecified, all asset prices start at 1.


A NUMOBS element vector of time intervals between return observations, or a single scalar interval applied to all observations. If RetIntervals is [] or is unspecified, ret2price assumes that all intervals have length 1.


(optional) Scalar starting time for the first observation, applied to the price series of all assets. The default is 0.


Character vector indicating the compounding method used to compute asset returns. If Method is 'Continuous', [], or unspecified, then ret2price computes continuously compounded returns. If Method is 'Periodic' then ret2price computes simple periodic returns. Method is case insensitive.

Output Arguments


Array of asset prices:

  • When RetSeries is a NUMOBS element column vector, TickSeries is a NUMOBS+1 column vector. The first element contains the starting price of the asset, and the last element the most recent price.

  • When RetSeries is a NUMOBS-by-NUMASSETS matrix, then TickSeries is a (NUMOBS+1)-by-NUMASSETS matrix. The first row contains the starting price of the assets, and the last row contains the most recent prices.


A NUMOBS+1 element vector of price observation times. The initial time is zero unless specified in StartTime.


collapse all

Create a stock price process continuously compounded at 10 percent

S = 100*exp(0.10*[0:19]'); 
    % Create the stock price series

Compute 10 percent returns for reference

R = price2ret(S); % Convert the price series to a 
                  % 10 percent return series

Convert the resulting return series to the original price series, and compare results:

P = ret2price(R, 100); % Convert to the original price
                       % series
[S P]                  % Compare the original and 
ans = 20×2

  100.0000  100.0000
  110.5171  110.5171
  122.1403  122.1403
  134.9859  134.9859
  149.1825  149.1825
  164.8721  164.8721
  182.2119  182.2119
  201.3753  201.3753
  222.5541  222.5541
  245.9603  245.9603

                       % computed price series

This example compares the relative price performance of the NASDAQ and the NYSE indexes.

Load the equity index data.

load Data_EquityIdx

Convert the returns back to prices, specifying the same starting price, 100, for each series, and plot the results.

plot(ret2price(price2ret([DataTable.NASDAQ DataTable.NYSE]), 100))
legend('Nasdaq', 'NYSE','Location','Best')
axis tight

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent Nasdaq, NYSE.

The blue (upper) plot shows the NASDAQ price series. The green (lower) plot shows the NYSE price series.

Introduced before R2006a