MarkovChain - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

Finance

  

MarkovChain

  

create new finite-state Markov chain

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

MarkovChain(P, S, i, n)

Parameters

P

-

Matrix; transition matrix

S

-

Vector; state space

i

-

posint; initial state

n

-

posint; number of states per year

Description

• 

The MarkovChain command creates a new finite state Markov chain.

• 

The parameter P is the transition matrix; it must be a square matrix (see Matrix) of size d, where d is the number of states in the Markov chain. The value Pi,j defines the probability of moving from state j to state i.

• 

The parameter S is a vector containing values for all possible states of the process.

• 

The parameter n is the number of states per year. This process can only be simulated with m=nk time steps per year, where k is a positive integer. Assume for example that X is a finite state Markov chain with 3 states per year. If we simulate the process X on the interval 0..2 with 12 time steps, then the state change can occur only at steps 2, 4, 6, 8, and 10.

Examples

withFinance:

P0.5,0.5|0.2,0.8

P0.50.20.50.8

(1)

XMarkovChainP,1.0,2.0,1,5

X_X0

(2)

SamplePathXt,t=0..2,timesteps=10,replications=10

The following command will issue an error because the number of time steps used in simulation must be a multiple of the number of states per year.

SamplePathXt,t=0..2,timesteps=12,replications=10

Error, (in Finance:-SamplePath) update time .200000000000000011 does not belong to the time grid

Compatibility

• 

The Finance[MarkovChain] 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[RegimeSwitchingProcess]

Finance[SamplePath]

Finance[SampleValues]

Finance[StochasticProcesses]

Finance[WienerProcess]

 


Download Help Document