Description Usage Arguments Details Value References See Also Examples
This function estimates the transition matrix for a discrete time Markov chain with state space 0,1,..,n given a realisation. The chain has n+1 states.
1 | MCEstimation(statehist,n)
|
statehist |
the realisation of the chain. |
n |
the highest numbered state. |
We assume that the state space is 0,1,2...,n. n is assumed known as it cannot be reliably infered from the realisation.
Returns the empirical transition matrix obtained by calculating the observed frequencies of actual transitions in the realisation.\
Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.
1 2 3 4 | P <- matrix(c(0.5,0.5,0,0,0.7,0.1,0.2,0,0,0.1,0.1,0.8,0,0,0.7,0.3),
nrow = 4, ncol = 4, byrow = TRUE)
statehist<-MCSimulation(P, 0, 3000)
MCEstimation(statehist, 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.