MCEM: Monte Carlo EM algorithm

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/MCEM.R

Description

Use: Computes the MLEs of the Gaussian copula model using the Monte Carlo EM algorithm

Usage

1
2
3
MCEM(obs.data, Monte_Carlo_samples, p, q, initial,  num_iterations,
                prec=0.01,  marginal_dist="negbin",
                optim_method="nmkb", compute_stderrors=TRUE)

Arguments

obs.data

Observed Data

Monte_Carlo_samples

The number of Monte Carlo samples, m, to approximate the conditional expectation, if m is a vector it repeats num_iterations with each numbr in the vector

p

order of the ar parameters in ARMA(p,q)

q

order of the ma parameters in ARMA(p,q)

initial

initial parameter values for the EM algorithm

prec

precision for stopping criteria

num_iterations

Number of iterations

marginal_dist

Marginal distributions

optim_method

Default is "nmkb" from the R package dfoptim, however "CG", "BFGS" or "nlm" can be used. optimx() from the optimx R package suggests all 4 can be used but in practice only "L-BFGS-B" have provided a good optimisation routine

compute_stderrors

TRUE or FALSE

Details

Default is "L-BFGS-B", however "CG", "BFGS" or "nlm" can be used. optimx() from the optimx R package suggests all 4 can be used but in practice only "L-BFGS-B" have provided a good optimisation routine.

There are two types of optimisation: function minimisation and mathematical programming. Most optimisers in R are function minimisers. method="L-BFGS-B" is the method of Bryd et al. (1995) which is a modification of BFGS quasi-newton method. "Dela_lx" for change in log-likelihood of observed data, as following Chen and Ledolter (1995)

Value

Iterations for the MCEM algorithm which converge to the MLE estimates of the ARMA(1,1) parameters

Note

Produces pdf plots

Author(s)

Hannah Lennon <drhannahlennon@gmail.com>

References

Lennon H., & Yuan J., Estimation of a digitised Gaussian ARMA model by Monte Carlo Expectation Maximisation, Computational Statistics & Data Analysis 2018;8:e020683

Lennon, H., 2016. Gaussian copula modelling for integer-valued time series (Doctoral Thesis, University of Manchester).

See Also

First and Second Year Transfer Reports

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(numDeriv)
library(MASS)
library(VGAM)
library(dfoptim)
library(polynom)
library(dfoptim)
ls()

set.seed(1)
obs.data <- generate_data(10, 0.2, 0.1, "nbinom", c(3, 0.4))$x

hlennon/copulaIVTS documentation built on Dec. 20, 2021, 4:45 p.m.