Description Usage Arguments Details Value To Do Author(s) References See Also Examples
This function fits probability distributions to Abrem
objects.
1 |
x |
Object of class |
... |
Options for fitting the (life-)time observations, and for plotting the results. |
This function calculates fits for the (life-)time observations in the
abrem
object and adds them to the object alongside any
pre-existing fits.
Fitting options are passed with the dist
and method.fit
arguments:
dist
A character string with the target distribution for fitting.
Possible values are "weibull"
or "weibull2p"
,
"weibull3p"
(three parameter Weibull), "lognormal"
or "lognormal2p"
.
Defaults to "weibull"
.
in.legend
Logical value controlling the inclusion of various elements in the legend.
If in.legend=FALSE
is passed,
the resulting fit calculations will be omitted from the legend,
leaving only observation summary data.
Defaults to TRUE
.
method.fit
A vector of class "character"
with fitting options.
Defaults to c("rr","xony")
.
"rr"
: Rank Regression (RR). Depending on the method for
calculating probability plot positions chosen during the creation of the
Abrem
object (see option pp
and
function Abrem
), this can
either be "exact median rank regression" or
"Benard's approximate median rank regression".
If this method is used then it is mandatory to additionally specify
either X-on-Y or Y-on-X regression.
"xony"
,"yonx"
: Differentiate between X-on-Y and Y-on-X
regression, respectively. For rank regression in lifetime analysis,
it is best practice to use the X values ((life-)time observations)
as the response variables whose horizontal distance to the fit line
must be minimized, and the Y values (unreliabilities) as the
explanatory variable.
"mle"
: Maximum Likelihood Estimation (MLE), using
many functions of the debias package.
"mle-rba"
: Maximum Likelihood Estimation with Reduced Bias
based on the median bias of the distributions MLE.
This options uses functions RBAbeta
and
RBAsigma
of the
debias package.
Additionally, one can pass any options available from options.abrem
,
such as col
or is.plot.legend
. The graphical options
will be used when plotting the (life-)time observations using plot.abrem
.
Subsequent calls to abrem.conf
will inherit these options.
The "prr" goodness-of-fit indicator is also calculated here. See the "Examples" section on how to retrieve it, see the "References" section for additional information on the prr and pve value.
Passing the threshold
parameter here will result in plotting the
fit (and its associated plot positions) with a threshold value subtracted.
If three parameter models like weibull3p
are used and
threshold = TRUE
, the calculated third parameter (t0
) of
the last three-parameter fit in the abrem object will be used for
plotting the graphical entities. If a numeric value is passed, then
only the value from the last call to abrem.fit
is used.
Currently, there is no graceful error recovery after attempting to fit
lifetime data including negative time observations, for example
abrem.fit(Abrem(-5:10)).
The function returns its argument x
, extended with the
calculated fit and the optional graphical and calculation arguments as
provided to the function.
Research the effect of NA
values in the (life-)time
observations of the abrem
argument when not using rank regression.
Jurgen Symynck jusy@openreliability.org
Improved Goodness of Fit: P-value of the Correlation Coefficient, Wes Fulton
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | da1 <- Abrem(runif(5,100,2000))
da1 <- abrem.fit(da1,dist="weibull",method.fit=c("rr","xony"),pch=3)
prr <- da1$fit[[1]]$gof$prr
message("prr goodness-of-fit of first fit:")
message(paste0(prr,ifelse(prr >= 10," -> Good fit."," -> BAD fit!")))
da1 <- abrem.fit(da1,dist="weibull",method.fit="mle",col="red1")
da1 <- abrem.fit(da1,dist="weibull",method.fit="mle-rba",col="orange3",lty=2)
da1 <- abrem.fit(da1,dist="lognormal",method.fit=c("rr","xony"),col="steelblue3",pch=8)
#da1 <- abrem.conf(da1)
me <- "Comparison between RR, MLE, MLE-RBA and lognormal2p"
plot(da1,main=me);message(me)
message(paste0(
" RR : beta=",signif(da1$fit[[1]]$beta),
", eta=",signif(da1$fit[[1]]$eta)))
message(paste0(
" MLE: beta=",signif(da1$fit[[2]]$beta),
", eta=",signif(da1$fit[[2]]$eta)))
message(paste0(
" MLE: beta=",signif(da1$fit[[3]]$beta),
", eta=",signif(da1$fit[[3]]$eta)))
### threshold parameter usage demo ###
data(abrem_mix1)
earlyda <-abrem_mix1[1:10]
midda <-abrem_mix1[11:131]
endda <-abrem_mix1[132:200]
da <-Abrem(abrem_mix1,col="gray",pch=1,
label="Complete, unaltered dataset")
da21 <-Abrem(fail=endda,susp=c(earlyda,midda),col="black",pch=19)
da22 <-Abrem(fail=endda,susp=c(earlyda,midda),col="blue",pch=3)
da23 <-Abrem(fail=endda,susp=c(earlyda,midda),col="green3",pch=4)
da21 <- abrem.fit(da21,
label="threshold=FALSE",dist="weibull3p",threshold=FALSE)
da22 <- abrem.fit(da22,
label="threshold=TRUE",dist="weibull3p",threshold=TRUE)
da23 <- abrem.fit(da23,
label="threshold=5000",dist="weibull3p",threshold=1800)
plot.abrem(list(da,da21,da22,da23),xlim=c(10,1e5),
main="Threshold parameter usage")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.