surface.msm: Explore the likelihood surface

Description Usage Arguments Details Author(s) See Also

View source: R/outputs.R

Description

Plot the log-likelihood surface with respect to two parameters.

Usage

1
2
3
4
5
6
7
8
surface.msm(x, params=c(1,2), np=10, type=c("contour","filled.contour","persp","image"),
                        point=NULL, xrange=NULL, yrange=NULL,...)
## S3 method for class 'msm'
contour(x, ...)
## S3 method for class 'msm'
persp(x, ...)
## S3 method for class 'msm'
image(x, ...)

Arguments

x

Output from msm, representing a fitted msm model.

params

Integer vector with two elements, giving the indices of the parameters to vary. All other parameters will be fixed. Defaults to c(1,2), representing the first two log transition intensities. See the fixedpars argument to msm for a definition of these indices.

np

Number of grid points to use in each direction, by default 10. An np x np grid will be used to evaluate the likelihood surface. If 100 likelihood function evaluations is slow, then reduce this.

type

Character string specifying the type of plot to produce.

"contour" Contour plot, using the R function contour.
"filled.contour" Solid-color contour plot, using the R function filled.contour.
"persp" Perspective plot, using the R function persp.
"image" Grid color plot, using the R function image.
point

Vector of length n, where n is the number of parameters in the model, including the parameters that will be varied here. This specifies the point at which to fix the likelihood. By default, this is the maximum likelihood estimates stored in the fitted model x, x$estimates.

xrange

Range to plot for the first varied parameter. Defaults to plus and minus two standard errors, obtained from the Hessian at the maximum likelihood estimate.

yrange

Range to plot for the second varied parameter. Defaults to plus and minus two standard errors, obtained from the Hessian at the maximum likelihood estimate.

...

Further arguments to be passed to the plotting function.

Details

Draws a contour or perspective plot. Useful for diagnosing irregularities in the likelihood surface. If you want to use these plots before running the maximum likelihood estimation, then just run msm with all estimates fixed at their initial values.

contour.msm just calls surface.msm with type = "contour".

persp.msm just calls surface.msm with type = "persp".

image.msm just calls surface.msm with type = "image".

As these three functions are methods of the generic functions contour, persp and image, they can be invoked as contour(x), persp(x) or image(x), where x is a fitted msm object.

Author(s)

C. H. Jackson [email protected]

See Also

msm, contour, filled.contour, persp, image.


msm documentation built on Feb. 3, 2018, 1:04 a.m.