Learn R Programming

sn (version 0.4-3)

st.2logL.profile: Profile twice loglikelihood for skew-t models

Description

Computation and plot of 1-dimensional and 2-dimensional profile (negative) twice log-likelihood function for skew-t regression models.

Usage

st.2logL.profile(X=matrix(rep(1, n)), y, freq, trace=FALSE,
          fixed.comp = c(ncol(X)+2, ncol(X)+3), 
          fixed.values = cbind(c(-4,4), log(c(1,25))),
          npts=30/length(fixed.comp), plot.it=TRUE, ...)

Arguments

X
a matrix of explanatory variables; must have col(X) equal to length(y). Missing values (NA) are not allowed. If X is missing, a one-column matrix of 1's is created.
y
a numeric vector. Missing values (NAs) are not allowed.
freq
a vector of weights. If missing, a vector of 1's is created; otherwise it must have the same number of rows of y.
trace
logical value which controls printing of the algorithm convergence. If trace=TRUE, details are printed. Default value is FALSE.
fixed.comp
a vector containing the subset of the parameters for which the profile log-likelihood function is required; it can be of length 1 or 2. The set of components of the parameters are beta, log(omega), alpha, log(df), where beta rep
fixed.values
a numeric vector of values or a matrix with two columns, giving the range spanned by the selected parameters.
npts
number of points on each parameter interval for which the function must be evaluated.
plot.it
logical value; if plot.it=TRUE (default value) a graphical display is produced.
...
graphical parameter passed to plot or contour, depending on whether lenght(fixed.comp) is 1 or 2.

Value

  • A list containing the following components:
  • callthe matched call.
  • param1vector of values of the first parameters values where the function has been evaluated.
  • param2vectors of the parameters values where the function has been evaluated. If length(fixed.comp)=1, the second vector contains NAs.
  • deviancea vector or a matrix which represents twice the negative relative profile loglikelihood; this is in the "relative" version, i.e. setting the maximum value to be 0.
  • max.logLa numeric value with the maximum which has been added to obtain the "relative" version of deviance.
  • besta list with the output of optim at the best evaluated point, that is the one with higher log-likelihood.

Side Effects

If plot.it=TRUE, a plot of the profile twice relative loglikeliood is produced on a graphical device. If length(fixed.comp)=1, a plot of the `deviance' is produced as a function of the chosen parameter component. If length(fixed.comp)=2, a contour plot is produced whose contour lines correspond to confidence regions of approximate probability levels c(0.25, 0.5, 0.75, 0.90,0.95, 0.99).

Background

The family of skew-t distributions is an extension of the Student's t family, via the introduction of a shape parameter which regulates skewness; when shape=0, the skew-t distribution reduces to the usual t distribution. A multivariate version of the distribution exists. See the reference below for additional information.

References

Azzalini, A. and Capitanio, A. (2003). Distributions generated by perturbation of symmetry with emphasis on a multivariate skew t distribution. J.Roy. Statist. Soc. B 65, 367--389.

See Also

st.mle, sn.2logL.profile

Examples

Run this code
data(ais, package="sn")
attach(ais)
a <- st.2logL.profile(y=bmi, xlab="alpha", ylab="log(df)")
a <- st.2logL.profile(y=bmi, fixed.comp=4, fixed.values=log(c(1,25)))
a <- st.2logL.profile(X=cbind(1,lbm), y=bmi, fixed.comp=5,  
         fixed.values=log(c(5,25)), xlab="log(df)", npts=50)
a <- st.2logL.profile(X=cbind(1,Ht), y=Wt, fixed.comp=c(4,5),
         fixed.values=cbind(c(-1,5), log(c(2,25))),
         xlab="alpha", ylab="log(df)")

Run the code above in your browser using DataLab