RMC.mod( states, chain.id=NULL, X=NULL, phi.id=NULL, pi.id=NULL, vcov=FALSE, inits=NULL, contr=list( maxit=1000, epsg=1e-8, epsf=1e-8, epsx=1e-8), quiet=FALSE, penalty=0)
Since the model has simple form then the stationary distribution is known (up to normalisation constant) and hence, the (log-)likelihood is calculated exactly.
Optimisation is performed using a quasi-Newton method implemented in the LBFGS code from the ALGLIB website (see references). First derivatives for the optimisation are obtained using automatic differentiation (Griewank 2001) using the CppAD tool for C++ (Bell 2007). This saves an awful lot of mucking around with derivative free methods and increases speed. If you do not already use automatic differentiation then you may want to look into it.
ALGLIB http://www.alglib.net/ (accessed June 2008)
Bell BM. 2007. CppAD: a package for C++ algorithmic differentiation, COIN-OR. http://www.coin-or.org/CppAD/, version 2007/02/07.
Griewank A. (2001) Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. SIAM. Philadelphia.
Foster, S.D., Bravington, M.V., Williams, A., Althaus, F, Laslett, G.M., and Kloser, R.J. (2008) Analysis and prediction of faunal distributions from video and multi-beam sonar data using Markov models. Environmetrics, 20: 541-560.
RMC.pred
for predicting the stationary distribution at arbitrary combinations of covariates. diagnos
and diagnos.envel
for graphical diagnostic methods for models of class RMC.#estimate a model for the stationary example data, dataEG1
fm.est1 <- RMC.mod( states=dataEG1[,2], chain.id=dataEG1[,1], X=dataEG1[,3])
#estimate a model for the non-stationary example data, dataEG2
fm.est2 <- RMC.mod( states=dataEG2[,2], chain.id=dataEG2[,1], X=dataEG2[,-(1:2)])
Run the code above in your browser using DataLab