Finance - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Stochastic Processes : Finance/DynamicPortfolio

Finance

  

DynamicPortfolio

  

create new dynamic portfolio

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

DynamicPortfolio(update, weights, components, updates)

Parameters

update

-

procedure; procedure for determining how the weights should be updated

weights

-

list or Vector; initial weights

components

-

stochastic process, list or Vector of stochastic processes; components of the portfolio

updates

-

(optional) continuous or positive integer; indicates how often the portfolio should be updated

Description

• 

The DynamicPortfolio command creates new dynamically updated portfolio.

• 

The parameter update is a procedure used for calculating the updated weights of the portfolio. This procedure will be called every time the portfolio is rebalanced. The following five arguments will be passed to the procedure: W, W0, X, X0 and t, where W is the vector of new weights, X is the vector of new values, W0 is the vector of old weights, X0 is the vector old values and t is the current time.

• 

The parameter weights is the vector of initial weights.

• 

The parameter components is either a multi-dimensional stochastic process or a vector of one-dimensional stochastic processes.

• 

Finally, the (optional) parameter updates controls how often the portfolio should be updated. Possible values are continuous or any positive integer. This integer value will specify the number of updates per year. If the value of this parameter is continuous, then the portfolio will be updated at every point in the discretization time grid.

Examples

withFinance:

Consider two processes. The first process is a geometric Brownian motion. The second process is a deterministic process with constant value 1.0.

X1GeometricBrownianMotion1,0.05,0.3:

X2DeterministicProcess1.0:

Valuet→t1t3+t2t4

Value:=t→t1t3+t2t4

(1)

U := proc(w, w0, x, x0, t) if x[1] < 1.05 then w[1] := 0; w[2] := 1; else w[1] := 1; w[2] := 0; end if; end proc;

U:=procw&comma;w0&comma;x&comma;x0&comma;tifx&lsqb;1&rsqb;<1.05thenw&lsqb;1&rsqb;:=0&semi;w&lsqb;2&rsqb;:=1elsew&lsqb;1&rsqb;:=1&semi;w&lsqb;2&rsqb;:=0end ifend proc

(2)

W1.0&comma;0.0

W:=1.00.

(3)

XX1&comma;X2

X:=_X_P

(4)

PDynamicPortfolioU&comma;W&comma;X&colon;

APSamplePathPt&comma;t&equals;0..1&comma;timesteps&equals;50&comma;replications&equals;10

AP:= 1..10 x 1..4 x 1..51 ArrayData Type: float8Storage: rectangularOrder: C_order

(5)

PathPlotAP&comma;1&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotAP&comma;2&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotValuePt&comma;t&equals;0..1&comma;thickness&equals;3&comma;markers&equals;false&comma;timesteps&equals;50&comma;replications&equals;10&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

Q := DynamicPortfolio(proc() end, W, X):

AQSamplePathQt&comma;t&equals;0..1&comma;timesteps&equals;50&comma;replications&equals;10

AQ:= 1..10 x 1..4 x 1..51 ArrayData Type: float8Storage: rectangularOrder: C_order

(6)

PathPlotAQ&comma;1&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotAQ&comma;2&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotValueQt&comma;t&equals;0..1&comma;thickness&equals;3&comma;markers&equals;false&comma;timesteps&equals;50&comma;replications&equals;10&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

R := DynamicPortfolio(proc() end, <0.0, 1.0>, X):

ARSamplePathRt&comma;t&equals;0..1&comma;timesteps&equals;50&comma;replications&equals;10

AR:= 1..10 x 1..4 x 1..51 ArrayData Type: float8Storage: rectangularOrder: C_order

(7)

PathPlotAR&comma;1&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotAR&comma;2&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

PathPlotValueRt&comma;t&equals;0..1&comma;thickness&equals;3&comma;markers&equals;false&comma;timesteps&equals;50&comma;replications&equals;10&comma;color&equals;red..blue&comma;axes&equals;BOXED&comma;gridlines&equals;true

Valuet&comma;u&rarr;t1t3&plus;t2t4maxu&comma;0

Value:=t&comma;u&rarr;t1t3&plus;t2t4maxu&comma;0

(8)

ExpectedValueValueP1&comma;X111.05&comma;timesteps&equals;50&comma;replications&equals;104&comma;output&equals;value&comma;standarddeviation

value&equals;1.021297741&comma;standarddeviation&equals;0.3242635701

(9)

ExpectedValueValueQ1&comma;X111.05&comma;timesteps&equals;50&comma;replications&equals;104&comma;output&equals;value&comma;standarddeviation

value&equals;0.9307660907&comma;standarddeviation&equals;0.3878610911

(10)

ExpectedValueValueR1&comma;X111.05&comma;timesteps&equals;50&comma;replications&equals;104&comma;output&equals;value&comma;standarddeviation

value&equals;0.8736073177&comma;standarddeviation&equals;0.2214176439

(11)

ExpectedValuemaxX111.05&comma;0&comma;timesteps&equals;50&comma;replications&equals;104&comma;output&equals;value&comma;standarddeviation

value&equals;0.1246581605&comma;standarddeviation&equals;0.2178360124

(12)

Compatibility

• 

The Finance[DynamicPortfolio] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Finance[BlackScholesProcess]

Finance[CEVProcess]

Finance[Diffusion]

Finance[Drift]

Finance[ExpectedValue]

Finance[GeometricBrownianMotion]

Finance[ItoProcess]

Finance[PathPlot]

Finance[SamplePath]

Finance[SampleValues]

Finance[StochasticProcesses]

Finance[WienerProcess]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam