Skip to contents

Creates an interactive probability plot for an `alt` object, overlaying one Weibull or lognormal fit line per stress level on a shared probability paper. The `alt` object must have been processed through [WeibullR.ALT::alt.parallel()] before passing to this function.

Usage

plotly_alt(
  alt_obj,
  showConf = TRUE,
  showGrid = TRUE,
  main = "ALT Probability Plot",
  xlab = "Time to Failure",
  ylab = "Probability",
  gridCol = "lightgray",
  signif = 3,
  cols = NULL
)

Arguments

alt_obj

An object of class `'alt'` created by the `WeibullR.ALT` package and fitted with `alt.parallel()`.

showConf

Show Fisher-matrix confidence bounds (TRUE) or not (FALSE). Default is TRUE.

showGrid

Show grid (TRUE) or hide grid (FALSE). Default is TRUE.

main

Main title. Default is "ALT Probability Plot".

xlab

X-axis label. Default is "Time to Failure".

ylab

Y-axis label. Default is "Probability".

gridCol

Color of the grid. Default is "lightgray".

signif

Significant digits for hover text. Default is 3.

cols

Optional character vector of colors, one per stress level. Recycled to match the number of stress levels. When NULL a 10-color default palette is used.

Value

A `plotly` object representing the interactive ALT probability plot.

Details

Building an alt object requires three steps:

  1. alt.make() — bundle the per-stress data sets and choose a distribution ("weibull" or "lognormal") and life-stress model ("arrhenius" or "power").

  2. alt.parallel() — fit independent Weibull/lognormal models at each stress level (required before calling plotly_alt()).

  3. alt.fit() — fit the global life-stress relationship (required for plotly_rel()).

The probability paper transformation (log y-axis for Weibull, normal quantile for lognormal) is the same as in [plotly_wblr()].

See also

[plotly_rel()] for the life-stress relationship plot using the same alt object.

Examples

library(WeibullR.ALT)
#> Loading required package: WeibullR
d1 <- alt.data(c(248, 456, 528, 731, 813, 537), stress = 300)
d2 <- alt.data(c(164, 176, 289), stress = 350)
d3 <- alt.data(c(88, 112, 152), stress = 400)
obj <- alt.fit(
  alt.parallel(
    alt.make(list(d1, d2, d3), dist = "weibull", alt.model = "arrhenius", view_dist_fits = FALSE),
    view_parallel_fits = FALSE
  )
)
plotly_alt(obj)