contrast.mle.vam: Compute the contrast corresponding to the maximum likelihood...

View source: R/vam.R

contrast.mle.vamR Documentation

Compute the contrast corresponding to the maximum likelihood estimation method for a virtual age model

Description

contrast.mle.vam computes the contrast corresponding to the maximum likelihood estimation method for a virtual age model with Corrective Maintenance (CM) and planned Preventive Maintenance (PM). The difference between the log-likelihood logLik.mle.vam and the contrast is due to the parameter \alpha which represents the scale parameter of the time to failure distribution of the new unmaintained system, h(t) (see sim.vam for more details). In fact, the value of \alpha that maximizes the log-likelihood has a closed-form solution, function of the others parameters values. The contrast corresponds to the value of the log-likelihood evaluated at this particular value of \alpha. Consequently, the contrast does not depend on \alpha, that is to say of par0[1].

Usage

contrast.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 contrast 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 contrast is computed on the parameter values specified in the obj formula. Otherwise, the contrast 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 contrast has to be computed.

with_gradient

a logical which indicates if the gradient of the contrast has to be computed.

with_hessian

a logical which indicates if the hessian of the contrast has to be computed.

Value

  • If only with_value is TRUE, the method produces the contrast value.

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

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

Otherwise, the method produces a list of the contrast 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. logLik.mle.vam to compute the log-likelihood. 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)
Est<-coef(mleARAInf)
contrast(mleARAInf)
contrast(mleARAInf,Est,c(TRUE,TRUE,TRUE))
logLik(mleARAInf,Est,c(TRUE,TRUE,TRUE))

require(rgl)
rhos<-seq(0,1,0.1)
betas<-seq(0.1,6,0.1)
lnL<-c()
for (rho in rhos){
  for (beta in betas)
  {
    lnL<-c(lnL,contrast(mleARAInf,c(1,beta,rho)))
  }
}
if(require(rgl)) {
  lnL<-matrix(data=lnL,nrow=length(rhos),ncol=length(betas),byrow=TRUE)
  persp3d(rhos, betas, lnL, col = 'skyblue',zlim=c(-100,max(lnL)))

  grid3d(c("rho", "b", "lnL"))
  spheres3d(Est[3],Est[2],contrast(mleARAInf,c(Est[1],Est[2],Est[3])),r=0.4,alpha=0.5,color="red",add=TRUE)
  indMax<-which(lnL==max(lnL), arr.ind = TRUE)
  spheres3d(rhos[indMax[1]],betas[indMax[2]],contrast(mleARAInf,c(1,betas[indMax[2]],rhos[indMax[1]])),r=0.3,color="black",add=TRUE)
}

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