Financial Toolbox | ![]() ![]() |
Random simulation of correlated asset returns
Syntax
Arguments
Description
portsim
simulates returns of NASSETS
assets over consecutive observation intervals. Returns are simulated as the increments of constant drift and volatility Brownian processes.
RetSeries
is a NUMOBS
-by-NASSETS
-by-NUMSIM
array of incremental return observations. The return over an interval of length DT
is given by ExpReturn*DT + ExpSigma*sqrt(DT)*randn
, where randn
provides a random scalar whose value changes each time randn
is referenced.
The returns realized from portfolios listed in PortWts
are given by: PortReturn = PortWts * RetSeries(:,:,1)'
, where PortWts
is a matrix in which each row contains the asset allocations of a portfolio. Each row of PortReturn
corresponds to one of the portfolios identified in PortWts
, and each column corresponds to one of the observations in RetSeries
. See portopt
and portstats
for portfolio specification and optimization.
Examples
Create sample returns for three stocks over 10 periods.
ExpReturn = [0.1 0.2 0.15]; ExpCovariance = [0.005 -0.010 0.004 -0.010 0.040 -0.002 0.004 -0.002 0.023]; NumObs = 10; RetSeries = portsim(ExpReturn, ExpCovariance, NumObs) RetSeries = 0.1429 0.2626 0.2365 0.0821 0.1599 -0.1796 0.0054 0.6126 0.1072 0.1719 -0.0669 0.1913 0.1518 -0.0843 0.0442 0.0112 0.2709 0.1501 0.0409 0.1683 0.1932 0.1485 0.2522 0.2774 0.0463 0.3222 0.0954 0.1990 0.1024 0.3843
Note
RetSeries is different each time this example is executed. The portsim function uses random number generation.
|
See Also
ewstats
, portopt
, portstats
, randn
, ret2tick
![]() | portrand | portstats | ![]() |