Skip to contents

Creates an interactive life-stress relationship (Arrhenius or Power Law) plot for an `alt` object. Displays the characteristic-life estimates per stress level, the fitted relationship line, optional percentile bands with shading, and an optional goal-condition marker. The `alt` object must have been processed through [WeibullR.ALT::alt.fit()] before passing to this function.

Usage

plotly_rel(
  alt_obj,
  showPerc = TRUE,
  showGoal = TRUE,
  showGrid = TRUE,
  main = "Life-Stress Relationship",
  xlab = "Stress",
  ylab = "Time to Failure",
  fitCol = "red",
  ptCol = "black",
  percCol = "blue",
  goalCol = "orange",
  gridCol = "lightgray",
  signif = 3,
  percentiles = c(10, 90)
)

Arguments

alt_obj

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

showPerc

Show percentile lines with shading (TRUE) or not (FALSE). Default is TRUE.

showGoal

Show the goal-condition marker when one is present in `alt_obj` (TRUE) or not (FALSE). Default is TRUE.

showGrid

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

main

Main title. Default is "Life-Stress Relationship".

xlab

X-axis label. Default is "Stress".

ylab

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

fitCol

Color of the fitted relationship line. Default is "red".

ptCol

Color of the characteristic-life scatter points. Default is "black".

percCol

Color of the percentile lines and fill. Default is "blue".

goalCol

Color of the goal-condition marker. Default is "orange".

gridCol

Color of the grid. Default is "lightgray".

signif

Significant digits for hover text. Default is 3.

percentiles

Numeric vector of percentiles to draw as reference lines with shading. Sorted internally; shading is filled between adjacent lines. Default is `c(10, 90)`.

Value

A `plotly` object representing the interactive life-stress plot.

Details

Two life-stress models are supported:

  • Arrhenius: \(\eta = A \exp(E_a / (k T))\), where stress is temperature in Kelvin and the x-axis uses a reciprocal scale.

  • Power Law: \(\eta = A / S^n\), where the x-axis is log-transformed.

The percentiles argument controls which quantile lines are drawn with shading between adjacent lines. The goal-condition marker (showGoal) is drawn when the alt object contains a $goal specification from alt.make().

See also

[plotly_alt()] for the ALT probability plot using the same alt object.

Examples

library(WeibullR.ALT)
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_rel(obj)