Learn R Programming

gppm (version 0.3.0)

fit.GPPM: Fit a Gaussian process panel model

Description

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

Usage

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

Value

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

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).

See Also

Functions to extract from a fitted GPPM:

Examples

Run this code
# \donttest{
# 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)))
# }

Run the code above in your browser using DataLab