iterate_more: Maximum likelihood estimation of GMAR, StMAR, or G-StMAR...

Description Usage Arguments Details Value References See Also Examples

View source: R/MAINest.R

Description

iterate_more uses a variable metric algorithm to finalize maximum likelihood estimation of a GMAR, StMAR or G-StMAR model (object of class 'gsmar') which already has preliminary estimates.

Usage

1
iterate_more(gsmar, maxit = 100, custom_h = NULL, calc_std_errors = TRUE)

Arguments

gsmar

a class 'gsmar' object, typically generated by fitGSMAR or GSMAR.

maxit

the maximum number of iterations for the variable metric algorithm.

custom_h

A numeric vector with same the length as the parameter vector: i:th element of custom_h is the difference used in central difference approximation for partial differentials of the log-likelihood function for the i:th parameter. If NULL (default), then the difference used for differentiating overly large degrees of freedom parameters is adjusted to avoid numerical problems, and the difference is 6e-6 for the other parameters.

calc_std_errors

should approximate standard errors be calculated?

Details

The main purpose of iterate_more is to provide a simple and convenient tool to finalize the estimation when the maximum number of iterations is reached when estimating a model with the main estimation function fitGSMAR. iterate_more is essentially a wrapper for the functions optim from the package stats and GSMAR from the package uGMAR.

Value

Returns an object of class 'gsmar' defining the estimated model.

References

See Also

fitGSMAR, GSMAR, stmar_to_gstmar, profile_logliks, optim

Examples

1
2
3
4
5
6
7
# Estimate GMAR model with on only 1 iteration in variable metric algorithm
fit12 <- fitGSMAR(simudata, p=1, M=2, maxit=1, ncalls=1, seeds=1)
fit12

# Iterate more since iteration limit was reached
fit12 <- iterate_more(fit12)
fit12

uGMAR documentation built on Jan. 24, 2022, 5:10 p.m.