| GARCH Toolbox™ | ![]() |
[TickSeries,TickTimes] = ...
ret2price(RetSeries,StartPrice,RetIntervals,StartTime,Method)
[TickSeries,TickTimes] = ...
ret2price(RetSeries,StartPrice,RetIntervals,StartTime,Method) generates price series for the specified assets, given the asset
starting prices and the return observations for each asset.
| RetSeries | Time-series array of returns. RetSeries can be a column vector or a matrix:
|
| StartPrice | 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. |
| RetIntervals | 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. |
| StartTime | (optional) Scalar starting time for the first observation, applied to the price series of all assets. The default is 0. |
| Method | Character string indicating the compounding method used to compute asset returns. If Method is 'Continuous', [], or is unspecified, then ret2price computes continuously compounded returns. If Method is 'Periodic' then ret2price computes simple periodic returns. Method is case insensitive. |
Array of asset prices:
| |
A NUMOBS+1 element vector of price observation times. The initial time is zero unless specified in StartTime. |
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
% computed price series
ans =
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
271.8282 271.8282
300.4166 300.4166
332.0117 332.0117
366.9297 366.9297
405.5200 405.5200
448.1689 448.1689
495.3032 495.3032
547.3947 547.3947
604.9647 604.9647
668.5894 668.5894
This example compares the relative price performance of the NASDAQ and the NYSE indexes (see Example Financial Time-Series Data Sets).
Convert the prices to returns:
load garchdata nasdaq = price2ret(NASDAQ);
Convert the returns back to prices, specifying the same starting price, 100, for each series:
nyse = price2ret(NYSE);
Plot both series:
plot(ret2price(price2ret([NASDAQ NYSE]), 100))
ylabel('Prices')
legend('Nasdaq', 'NYSE', 2)

The blue (upper) plot shows the NASDAQ price series. The green (lower) plot shows the NYSE price series.
![]() | price2ret | Method Reference | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |