Weibulltoolkit 0.2.2 Refmanual
Weibulltoolkit 0.2.2 Refmanual
Weibulltoolkit 0.2.2 Refmanual
R topics documented:
options.wb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
plot.wb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
wbparams.to.ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Index
2
4
6
8
options.wb
options.wb
Description
The options.wb() function handles the numerous options for creating Weibull plots.
Usage
options.wb(...)
Arguments
The main title of the Weibull plot.
The subtitle of the Weibull plot.
Boolean switch (TRUE or FALSE) controlling whether the plot is created in a
new window.
xlim
A vector determining the plotting range of the horizontal axis of the Weibull plot.
plot.wb() calculates horizontal limits automatically from the data argument.
ylim
A vector determining the plotting range of the vertical axis of the Weibull plot.
Allowed values come from the interval ]0,1[
xlab, ylab
Strings containing labels for the X and Y axis.
legend.position
A string keyword describing the location of the legend in the plot window. Possible legend locations are "bottomright", "bottom", "bottomleft",
"left", "topleft", "top", "topright", "right" and "center".
legend.text.size
A number determining the relative legend text size.
legend.title A string with the title of the legend box.
coordinate.text.size
A number determining the relative coordinate text label size.
signif
An integer describing the significant digits of various numbers to be displayed.
pch
An integer describing the plotting symbol, used for plotting the datapoints. For
more info, see points in the package graphics
lwd
An integer describing the line width of both the Weibull fitted line and the confidence bounds.
col
The color of a Weibull plot. Can either be an integer or a string. See colors
from package grDevices for available colors.
lwd.points
An integer describing the size of the datapoints.
col.grid
The color of the grid. Can either be an integer or a string. See colors from
package grDevices for available colors.
R
An integer describing the number of Monte Carlo simulations on which the
Monte Carlo pivotal confidence bounds are based. The default value is 1000,
for which (at the time of writing) it takes a few seconds to complete the simulation. Higher R values result in better Monte Carlo confidence bounds but
longer calculation times. Reccomended values are 2000 <= R <= 5000.
High values are needed for good confidence bounds at the lower scale of the
Weibull model.
main
sub
add
options.wb
A number from the interval [0,[1 determining the width of the calculated
confidence intervals.
cb.points
An integer controlling the amount of data-coordinates through which the Monte
Carlo pivotal confidence bounds are drawn.
method.reg
The method for calculating beta and eta. Can either be "MRR" (Median Rank
Regression) or "Surv" (Maximum Likelihood Estimation, MLE). In the latter
case, there is no ranking applied to the data so no plotting positions are calculated or displayed.
is.XonY.regression
Boolean switch controlling whether the MRR regression is either X-on-Y (default) or Y-on-X. Currently, Y-on-X is buggy and should be avoided.
is.plot.grid Boolean switch controlling the plotting of the grid.
is.plot.fittedline
Boolean switch controlling the plotting of the fitted line.
is.plot.datapoints
Boolean switch controlling the plotting of the datapoints.
is.plot.datacoordinates
Boolean switch controlling the plotting of the text labels (the coordinates on the
plot) next to the datapoints.
is.plot.legend
Boolean switch controlling the plotting of the legend.
is.plot.bbb Boolean switch controlling the plotting of beta binomial confidence bounds.
is.plot.cb
Boolean switch controlling the plotting of Monte Carlo confidence bounds.
CL
Details
The options.wb() function tries to mimic the behavior of the par function from the graphics
package, and borrows some code from it. It can be used in different ways:
options.wb()
Returns the currently used options and there values.
options.wb()$ylim
options.wb("ylim")
Returns the current value of an option.
options.wb(col="pink")
options.wb(list(col="pink",R=300))
Sets the specified options. Currently, there is no way to reset the options to the default values using
this function. One might, before changing any options, store the option list in a temporary variable
like default <- options.wb() for restoring it later by running options.wb(defaults).
Value
options.wb() returns a list containing the current options of the Weibull toolkit. Also, it creates
a list named options.weibulltoolkit, holding the options. One should always use the
options.wb() function to access the option list, do not access the list directly.
To Do
Prevent the options.weibulltoolkit list from being accessible outside of the options.wb()
function.
Add the possibibilty to reset to the default values.
plot.wb
Author(s)
Jurgen Symynck <[email protected]>
See Also
plot.wb
Examples
defaults <- options.wb()
options.wb(R=300,is.plot.legend=FALSE)
plot.wb(wbparams.to.ft(5,,3,1000),main="options.wb() demonstration\n")
options.wb(add=TRUE)
plot.wb(wbparams.to.ft(5,,2,2000),col="red")
plot.wb(wbparams.to.ft(8,,2,1000),col="blue")
plot.wb(wbparams.to.ft(15,,3,3000),col="green")
options.wb(defaults)
plot.wb
Weibull Plotting
Description
The plot.wb() function creates a Weibull plot from lifetime and reliability data. Currently,
plot.wb() behaves as follows:
Displays the two-parameter Weibull cumulative distribution function as a straight line on
Weibull probability paper.
(right-) Censored data (suspensions) are supported, where some observations are not failures.
Observations are by default ranked using the Median Rank Regression (MRR) method, reccomended for small to medium sample sizes (2-100).
The Weibull parameters can also be calculated by using Maximum Likelihood Estimation,
available via the survreg() function of the survival package.
The Weibull line is fitted using X-on-Y regression by default, where the times-to-failure are
the dependent variable.
Monte Carlo pivotal confidence bounds are calculated and displayed, Beta-binomial confidence bounds can be displayed.
The mark() function draws a point on the plot with dotted lines extending towards the axes,
for marking special points.
Usage
plot.wb(d = NULL, ...)
Arguments
d
...
plot.wb
Details
An example of a survival object with three dead and two live observations:
d <- Surv(time=c(27,100,100,53,78),event=c(1,0,0,1,1))
This toolkit is being developed as a means for studying both R itself and the Weibull analysis
in general. The current goal of the toolkit is to generate Weibull plots, displaying the key information about B-lives and goodness of fit, and to calculate the Monte Carlo pivotal confidence
bounds as used in the SuperSMITH(TM) Weibull software for reliability testing. Currently, the
Monte Carlo pivotal confidence bounds are only correct for complete, uncensored data. For censored data, the bounds are still too optimistic for heavily censored datasets with few failures. Type
vignette("MCpivotalbounds_status",package="weibulltoolkit") at the R prompt
to check the current status of the Monte Carlo pivotal confidence bounds.
Value
plot.wb() returns a list containing the median ranked dataset (if appropriate), beta, eta and the
pivotal confidence bounds on a selection of B-lives.
Warning
This package and its functions are a perpetual work in progress. Some issues of the software that
need to be addressed are:
The Monte Carlo pivotal confidence bounds are currently only correct forcomplete, censored
data. With censored data, they are too optimistic.
To Do
The critical correlation coefficient (ccc^2) is only displayed for failures up to ten. ccc^2 for
more failures are to be generated using time-consuming Monte Carlo simulation. The code for
this can be found in the source, but there appears to be a slight difference between the values
generated by them and those from commercial software packages.
Find out if the MLE parameter estimation survreg() can be altered to MLE-RBA (Reduced
Bias)
Find out if survreg() can be used for median rank regression of failure data, for both
complete and censored data.
Fix bug that displays numeric(0) in the legend when supplying the Blives = F0(0) option
to plot.wb()
Fix bug while displaying axis labels containing characters, like 5e-4 instead of 0.0005. When
these are displayed, the axis ticks and labels are drawn outside the plotting window, messing
up the perpendicular axis.
Author(s)
Jurgen Symynck <[email protected]>
References
Robert B. Abernethy, The New Weibull Handbook, Fifth Edition (Robert B. Abernethy, 2004)
Jerald F. Lawless, Statistical Models and Methods for Lifetime Data, 2nd edition (Wiley-Interscience,
Hoboken N.J., 2003)
wbparams.to.ft
William Q. Meeker and Luis A. Escobar, Statistical Methods for Reliability Data (Wiley-Interscience,
New York, 1998)
Chi-Chao Lui, A Comparison Between The Weibull And Lognormal Models Used To Analyse Reliability Data (dissertation from University of Nottingham, 1997)
Efron, B. and Tibshirani, R., An Introduction to the Bootstrap (Chapman & Hall, 1993)
Jurgen Symynck, Filip De Bal, Weibull analysis using R, in a nutshell (New Technologies and Products in Machine Manufacturing Technology, Stefan cel Mare University of Suceava, 2010), available on http://mechanics.kahosl.be/fatimat/index.php/downloads-and-information/
40/171
Jurgen Symynck, Filip De Bal, Monte Carlo pivotal confidence bounds for Weibull analysis, with
implementations in R (New Technologies and Products in Machine Manufacturing Technology, Stefan cel Mare University of Suceava, 2011), available on http://www.fim.usv.ro/conf_1/
tehnomusjournal/pagini/journal2011/files/7.pdf and http://mechanics.
kahosl.be/fatimat/index.php/downloads-and-information/40/198
SuperSMITH(TM) Weibull homepage (http://www.Weibullnews.com/contents.htm)
http://mechanics.kahosl.be/fatimat
http://sourceforge.net/projects/Weibulltoolkit
See Also
options.wb, Surv, survreg
Examples
## plot Weibull distributed, uncensored failures:
d1 <- Surv(rweibull(6,3,1000))
r1 <- plot.wb(d1,legend.title="Weibull distributed",
main="Weibull & Uniformly Distributed Failures\n",
col="blue")
## plot uniformy distributed , uncensored failures:
d2 <- Surv(runif(10,10,500))
r2 <- plot.wb(d2,legend.title="Uniformly distributed",
col="red",legend.position="topright",add=TRUE)
## mark a point
mark(get.blife(c(0.1,0.01), r1$beta,r1$eta),c(0.1,0.01))
mark(get.blife(c(0.1,0.01), r2$beta,r2$eta),c(0.1,0.01))
wbparams.to.ft
Description
Create a set of observations, perfectly matching a two-parameter Weibull distribution with the supplied shape and scale parameters.
Usage
wbparams.to.ft(n, fail=NULL, beta, eta, method.rank = "qbeta")
wbparams.to.ft
Arguments
n
fail
if specified, the number of actual failures in the dataset (0 < fail <= n). In
that case the dataset is treated as Type 2 censored.
beta, eta
slope and shape parameters of the Weibull distribution for this dataset.
method="MRR" method used for the rank regression. Either "MRR" or "Surv". See get.wbparams()
for more details. Currently, only "MRR" is supported.
Value
An object of class "Surv" with n observations of which there are fail failures. The dataset will
have beta and eta as its Weibull parameters.
Author(s)
Jurgen Symynck <[email protected]>
Examples
### plot two synthetic datasets with
### shape = 3 and scale 1000, resp.
###
###
d1 <- wbparams.to.ft(8,,3,1000)
invisible(plot.wb(d1,R=300))
# invisible() prevents plot.wb to return data.
d2 <- wbparams.to.ft(10,3,3,1000)
invisible(plot.wb(d2,R=300,pch=4,add=TRUE,
col="red",legend.position="topleft"))
Index
colors, 2
options.wb, 2, 6
par, 3
plot.wb, 4, 4
points, 2
Surv, 6
survreg, 6
wbparams.to.ft, 6