View source: R/stochastic_growth_model.R
| Markovmoments | R Documentation | 
The function Markovmoments computes the expectation, variance, autocovariance and autocorrelation of a Markov process.
Markovmoments(states, ptm, ...)
| states | A numerical vector with the states of the Markov process. | 
| ptm | The probability transition matrix, a square matrix of dimension length(states) whose columns sum to one. | 
| ... | Additional arguments. | 
It returns a list containing:
| Expectation | The mean of the process. | 
| Variance | The variance of the process. | 
| Autocovariance | The autocovariance of the process. | 
| Autocorrelation | The autocorrelation of the process. | 
| Stationary distribution | The stationary distribution of the process, used for the computation of the moments. | 
a <- c(-1, 1)
A <- matrix(c(0.5, 0.6,
              0.5, 0.4), 2, 2)
Markovmoments(a, A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.