% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotly_wblr.R
\name{plotly_wblr}
\alias{plotly_wblr}
\title{Interactive Probability Plot.}
\usage{
plotly_wblr(
  wblr_obj,
  susp = NULL,
  showConf = TRUE,
  showSusp = TRUE,
  showGrid = TRUE,
  main = "Probability Plot",
  xlab = "Time to Failure",
  ylab = "Probability",
  probCol = "black",
  fitCol = "black",
  confCol = "black",
  intCol = "black",
  gridCol = "lightgray",
  signif = 3,
  cols = NULL
)
}
\arguments{
\item{wblr_obj}{A single object of class 'wblr', or a list of such objects. This is
a required argument. Each object must use the same distribution (e.g. all Weibull or
all lognormal). Suspension subplots are only shown when a single object is provided.}

\item{susp}{An optional numeric vector of suspension data. Default is NULL. Ignored
when multiple wblr objects are provided.}

\item{showConf}{Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE if
confidence bounds are available in the wblr object.}

\item{showSusp}{Show the suspensions plot (TRUE) or not (FALSE). Default is TRUE
if susp is provided.}

\item{showGrid}{Show grid (TRUE) or hide grid (FALSE). Default is TRUE.}

\item{main}{Main title. Default is 'Probability Plot'.}

\item{xlab}{X-axis label. Default is 'Time to Failure'.}

\item{ylab}{Y-axis label. Default is 'Probability'.}

\item{probCol}{Color of the probability values. Default is 'black'. Used only for a
single wblr object; ignored when `cols` is provided or multiple objects are supplied.}

\item{fitCol}{Color of the model fit. Default is 'black'. Used only for a single
wblr object; ignored when `cols` is provided or multiple objects are supplied.}

\item{confCol}{Color of the confidence bounds. Default is 'black'. Used only for a
single wblr object; ignored when `cols` is provided or multiple objects are supplied.}

\item{intCol}{Color of the intervals for interval censored models. Default is 'black'.}

\item{gridCol}{Color of the grid. Default is 'lightgray'.}

\item{signif}{Significant digits of results. Default is 3. Must be a positive integer.}

\item{cols}{Optional character vector of colors, one per wblr object. When provided,
each object's data points, fit line, and confidence bounds are all drawn in the
corresponding color. Recycled if shorter than the number of objects.}
}
\value{
A `plotly` object representing the interactive probability plot.
}
\description{
This function creates an interactive probability plot for one or more wblr objects.
When a list of objects is provided the models are overlaid on the same plot, each
rendered in a distinct color. All objects must use the same distribution family.
It can include confidence bounds, suspension data (single object only), and a results table.
}
\details{
For Weibull distributions the y-axis uses a double-log transformation
(\code{log(-log(1 - F))}) so that a straight line represents a perfect
Weibull fit. For lognormal distributions the y-axis uses the normal
quantile transformation (\code{qnorm(F)}), i.e., standard normal probability
paper. Three-parameter Weibull (\code{dist = 'weibull3p'}) shifts the x-axis
by the estimated location (gamma) parameter before applying the same
transformation.

Goodness-of-fit is reported as R² for rank-regression fits or
log-likelihood for MLE fits.
}
\examples{
library(WeibullR)
library(ReliaPlotR)
failures <- c(30, 49, 82, 90, 96)
obj <- wblr.conf(wblr.fit(wblr(failures)))
plotly_wblr(obj)

suspensions <- c(100, 45, 10)
obj <- wblr.conf(wblr.fit(wblr(failures, suspensions)))
plotly_wblr(obj, suspensions,
  fitCol = "blue",
  confCol = "blue"
)
inspection_data <- data.frame(
  left = c(0, 6.12, 19.92, 29.64, 35.4, 39.72, 45.32, 52.32),
  right = c(6.12, 19.92, 29.64, 35.4, 39.72, 45.32, 52.32, 63.48),
  qty = c(5, 16, 12, 18, 18, 2, 6, 17)
)
suspensions <- data.frame(time = 63.48, event = 0, qty = 73)
obj <- wblr(suspensions, interval = inspection_data)
obj <- wblr.fit(obj, method.fit = "mle")
obj <- wblr.conf(obj, method.conf = "fm", lty = 2)
suspensions <- as.vector(suspensions$time)
plotly_wblr(obj,
  susp = suspensions, fitCol = "red", confCol = "red", intCol = "blue",
  main = "Parts Cracking Inspection Interval Analysis",
  ylab = "Cumulative \% Cracked", xlab = "Inspection Time"
)
failures <- c(25, 30, 42, 49, 55, 67, 73, 82, 90, 96, 101, 110, 120, 132, 145)
fit <- wblr.conf(wblr.fit(wblr(failures), dist = "weibull3p"))
plotly_wblr(fit, fitCol = "darkgreen", confCol = "darkgreen")

# Overlay two Weibull models
obj2 <- wblr.conf(wblr.fit(wblr(c(20, 40, 60, 80, 100)), method.fit = "mle"),
                  method.conf = "lrb")
obj3 <- wblr.conf(wblr.fit(wblr(c(10, 30, 50, 70, 90)), method.fit = "mle"),
                  method.conf = "lrb")
plotly_wblr(list(obj2, obj3))

}
\seealso{
[plotly_contour()] for MLE parameter confidence contours.
}
