Learn R Programming

sn (version 0.4-3)

sn.2logL.profile: Profile twice loglikelihood for skew-normal models

Description

Computation and plot of 1-dimensional and 2-dimensional profile 2*loglikelihood for skew-normal regression models.

Usage

sn.2logL.profile(X=matrix(rep(1, n)), y,
    param.range=c(sqrt(var(y)) * c(2/3, 3/2), -0.95, 0.95),
    use.cp=TRUE, npts=31 %/% d, plot.it=TRUE, ...)

Arguments

y
a numeric vector. Missing values (NAs) are not allowed.
X
a matrix of explanatory variables; must have col(X) equal to length(y). Missing values (`NAs) are not allowed. If X is missing, a one-comun matrix of 1's is created.
param.range
a numeric vector of length either 2 or 4. If the length is 2, the dimensional paramter d is set to 1, and a 1-dimensional profile is computed and plotted, for the shape or skewness parameter (depending on the parametrization adopted; see belo
use.cp
logical value which selects the parametrization adopted. If use.cp=TRUE (default value), the centred parametrization is used, otherwise the direct parametrization is adopted.
npts
number of points (in the scalar case) or grid size (in the 2-dimensional case).
plot.it
logical value which determines if plotting takes place; default is T.
...
any additional parameter is passed to sn.em.

Value

  • A list containing the following components
  • param1vectors of the parameters values where the function has been evaluated. If d=2, the second vector contains NAs.
  • param.namesa character vector of two elements with the names of the param1 and param2.
  • 2logLa vector or a matrix which represents twice the profile loglikelihood; this is in the "relative" version, i.e. setting the maximum value to be 0.
  • maximuma numeric value with the maximum which has been subtracted to obtain the "relative" version of 2logL.

Side Effects

If plot.it=TRUE, a plot of the profile twice relative loglikeliood is produced on a graphical device.

Details

Likelihood maximization is performed by sn.em.

See the reference below for explanation of the two possible parametrizations.

References

Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, 579--602.

See Also

sn.em, sn.mle

Examples

Run this code
data(ais, package="sn")
attach(ais)
a <- sn.2logL.profile(y=bmi)
a <- sn.2logL.profile(y=bmi, use.cp=FALSE, param.range=c(3,6,1,5))
a <- sn.2logL.profile(X=cbind(1,lbm), y=bmi, param.range=c(0,0.9),
        npts=50)
#
data(frontier, package="sn")
a <- sn.2logL.profile(y=frontier, param.range=c(0.8,1.6,10,30),
        use.cp=FALSE, npts=11)

Run the code above in your browser using DataLab