logLik.mle.vam: Compute the log-likelihood for a virtual age model

View source: R/vam.R

logLik.mle.vamR Documentation

Compute the log-likelihood for a virtual age model

Description

logLik.mle.vam computes the log-likelihood of the parameters of a virtual age model for Corrective Maintenance (CM) and planned Preventive Maintenance (PM).

Usage

logLik.mle.vam(obj,par0,with_value=TRUE,with_gradient=FALSE,with_hessian=FALSE)

Arguments

obj

an object of class mle.vam specifying the virtual age model considered and the data set of observations.

par0

an optional argument specifying the parameter values at which the log-likelihood is computed. par0 is a vector whose length is equal to the total number of parameters in the formula used for defining the object obj. The successive values of par0 respectively refer to the parameters of time to failure distribution of the new unmaintained system, of the CM effect model and finally of the PM effect models (if defined and in the same order as they appear in the obj formula).

If par0 is not specified and the optimization algorithm has never been executed on obj(via coef.mle.vam or run.mle.vam), the log-likelihood is computed on the parameter values specified in the obj formula. Otherwise, the log-likelihood is computed on the last parameters values obtained by the optimization algorithm for obj.

with_value

a logical which indicates if the value of the log-likelihood has to be computed.

with_gradient

a logical which indicates if the gradient of the log-likelihood has to be computed.

with_hessian

a logical which indicates if the hessian of the log-likelihood has to be computed.

Value

  • If only with_value is TRUE, the method produces the log-likelihood value.

  • If only with_gradient is TRUE, the method produces a vector corresponding to the gradient of the log-likelihood,

  • If only with_hessian is TRUE, the method produces a matrix corresponding to the hessian of the log-likelihood.

Otherwise, the method produces a list of the log-likelihood characteristics for which the corresponding argument is TRUE.

Author(s)

L. Doyen and R. Drouilhet

See Also

run.mle.vam to compute the MLE. coef.mle.vam to extract the parameters value of the MLE. contrast.mle.vam to compute the contrast associated to the MLE. formula.mle.vam to extract the original and estimated model. plot.mle.vam for plotting characteristics of the model. update.mle.vam to change the associated data set.

Examples

simARAInf<-sim.vam(  ~ (ARAInf(.4) | Weibull(.001,2.5)))
simData<-simulate(simARAInf,30)
mleARAInf <- mle.vam(Time & Type ~ (ARAInf(0.5) | Weibull(1,3)),data=simData)
logLik(mleARAInf,c(0.02,2.4,0.4))
Est<-coef(mleARAInf)
contrast(mleARAInf)
logLik(mleARAInf)
logLik(mleARAInf,Est,c(TRUE,TRUE,TRUE))

rcqls/VAM documentation built on Jan. 14, 2024, 9:07 p.m.