plot.model.vam: Plot characteristics of virtual age model

View source: R/plot.R

plot.model.vamR Documentation

Plot characteristics of virtual age model

Description

plot plots characteristics of a virtual age model for Corrective Maintenance (CM) and planned Preventive Maintenance (PM).

Usage

## S3 method for class 'model.vam'
plot(obj, type, from, to, length.out=101, by, system.index=1 ,cm.type=NA, pm.type=NA, add=FALSE, ....)
## S3 method for class 'sim.vam'
plot(obj, type, from, to, length.out=101, by, system.index=1 ,cm.type=NA, pm.type=NA, add=FALSE, ....)
## S3 method for class 'mle.vam'
plot(obj, type, from, to, length.out=101, by, system.index=1 ,cm.type=NA, pm.type=NA, add=FALSE, ....)

Arguments

obj

an object of class model.vam or sim.vam or mle.vam specifying the virtual age model considered. This object must contain a data set. Then, in the case of a sim.vam object, the simulate method must have been previously applied, at least one time, on the object.

type

specifies which characteristic to plot:

  • "i" or "intensity" for failure intensity,

  • "I" or "cumulative" for cumulative failure intensity also called compensator of the CM-PM process,

  • "v" or "virtual.age" for virtual age,

  • "F" or "conditional.cdf" for conditional distribution function of the next failure time,

  • "S" or "conditional.survival" for conditional survival function of the next failure time,

  • "f" or "conditional.pdf" for conditional probability density function of the next failure time.

  • "d" or "data" for data representation as the CM counting process.

By default, PM times are also represented, but "-pm" can be added at the end of the string type in order to avoid this representation. By default, CM times are also represented (or the cumulative number of CM in the "I" case), but "-cm" can be added at the end of the string "type" in order to avoid this representation. For example, the types "I-pm" and "I-pm-cm" both correspond to the cumulative failure intensity plot, but in the first case the cumulative number of failure will also be plotted.

from, to

optional arguments specifying the range time over which the characteristic will be plotted.

by

time increment between two successive maintenance time at which the characteristic will be plotted.

length.out

When provided, by is defined as (to - from)/(length.out - 1).

system.index

the index of the system for which to plot the characteristic.

cm.type

how to additionally represent the CM times or the cumulative number of CM in the "I" case. Possible types are "p" for points and "l" for lines.

pm.type

how to additionally represent the PM times. Possible types are "p" for points and "l" for lines.

add

if add==FALSE the characteristic is plotted on a new graphical, otherwise it is added to the current one.

...

Further classical graphical parameters specifying how the plot of the characteristic. Others non usual arguments can also be added in order to specify the additional representation of the CM and PM times: cm.col, cm.pch, cm.lty, cm.lwd, pm.col, pm.pch, pm.lty, pm.lwd. For PM, those arguments can be vectors in order to specify a specific value of the argument for each PM type.

Author(s)

L. Doyen and R. Drouilhet

Examples

simARAInf<-sim.vam(  ~ (ARAInf(.4) | Weibull(.05,2.5)))
simData<-simulate(simARAInf,10,nb.system=50,as.list=TRUE)
plot(simARAInf,'i',system.index=2)
mleARAInf <- mle.vam(Time & Type ~ (ARAInf(0.5) | Weibull(1,3)),data=simData)
run.mle.vam(mleARAInf)
plot(mleARAInf,'i-cm',col='blue',add=TRUE,system.index=2)

simCMPM<-sim.vam(  ~ (ARAInf(.3) | Weibull(.001,2.5)) & (ARAInf(.6)+ARAInf(-.2) | Periodic(12,prob=c(0.6,0.4))))
(simData<-simulate(simCMPM,50))
plot(simCMPM,'I',from=simData$Time[10],to=simData$Time[40],col='darkblue',xlab='t',ylim=c(0,sum(simData$Type[1:40]==-1)),cm.col='red',pm.type='p',pm.pch=c(1,2),pm.col=c("green","black"),main="Fantastic!")

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