fit.GPPM | R Documentation |
This function is used to fit a Gaussian process panel model,
which has been specified fit using gppm
.
## S3 method for class 'GPPM'
fit(
gpModel,
init = "random",
useOptimizer = TRUE,
verbose = FALSE,
hessian = TRUE,
...
)
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). |
A fitted Gaussian process panel model, which is an object of class 'GPPM'.
Functions to extract from a fitted GPPM:
# 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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.