fit.GPPM: Fit a Gaussian process panel model

Description Usage Arguments Value Examples

Description

This function is used to fit a Gaussian process panel model, which has been specified fit using gppm.

Usage

1
2
3
## S3 method for class 'GPPM'
fit(gpModel, init = "random", useOptimizer = TRUE,
  verbose = FALSE, hessian = TRUE, ...)

Arguments

gpModel

object of class GPPM. The Gaussian process panel model to be fitted.

init

string or named numeric vector. Used to specify the starting values for the parameters. Can either be the string 'random' (default) or a numeric vector startVal of starting values. Which value belongs to which parameter is determined by the names attribute of startVal. See also the example.

useOptimizer

boolean. Should the optimizer be used or not? For false the (possibly random) starting values are returned as the maximum likelihood estimates.

verbose

boolean. Print diagnostic output?

hessian

boolean. Compute the hessian at the maximum likelihood estimate?

...

additional arguments (currently not used).

Value

A fitted Gaussian process panel model, which is an object of class 'GPPM'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#regular usage
data("demoLGCM")
lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
        demoLGCM,'ID','y')
lgcmFit <- fit(lgcm)

#starting values as ML results
startVals <- c(10,1,10,3,10,1)
names(startVals) <- pars(lgcm)
lgcmFakeFit <- fit(lgcm,init=startVals,useOptimizer=FALSE)
stopifnot(identical(startVals,coef(lgcmFakeFit)))

karchjd/gppmr documentation built on May 14, 2019, 8:05 a.m.