Learn R Programming

degradr (version 1.0.1)

qrul: Quantiles of the Remaining Useful Life (RUL) Distribution

Description

Returns quantiles of the Remaining Life Distribution for one or more units based on their observed degradation signals and a fitted model.

Usage

qrul(prob = 0.05, data, model, D = NULL, upper = NULL)

Value

A data frame with one row per unit containing:

unit

Unit identifier.

RUL

The requested quantile of the RUL distribution.

Arguments

prob

Probability at which to evaluate the quantile of the RUL distribution.

data

A data frame with columns t (time), x (degradation measurement), and unit (unit identifier) or a data frame containing sensor readings over time: must include the columns t (time), unit (unit identifier), and multiple degradation signals. Multiple units can be passed simultaneously.

model

An object of class "degradation_model" returned by fit_model or a "healthindex" object from fit_healthindex.

D

Optional critical degradation threshold. If NULL, a random-threshold model is used; otherwise the provided threshold is used. For exponential models the threshold is internally log-transformed.

upper

Optional upper bound for the numerical search when computing quantiles. If NULL, the maximum time observed during training is used.

Details

For each unit in data the function computes the posterior distribution of the model parameters and evaluates the specified quantile of the Remaining Life Distribution. Units that result in computational errors return NA.

See Also

prul, predict_rul

Examples

Run this code

library(degradr)
library(dplyr)
# Load example data
data(train_FD001)
data(test_FD001)
data <- train_FD001 %>%
  select(unit,t,T24,T50,P30,
         Nf,Ps30,phi, NRf,
         BPR,htBleed,
         W31, W32) %>%
  mutate(across(c(P30,phi,W31,W32), ~ . * -1))

test <- test_FD001 %>%
  select(unit,t,T24,T50,P30,
         Nf,Ps30,phi, NRf,
         BPR,htBleed,
         W31, W32) %>%
  mutate(across(c(P30,phi,W31,W32), ~ . * -1))

# Fit a health index model (exponential trajectory of degree 2)
model <- fit_healthindex(data = data, type = "exponential",
                         degree = 2, r = 0.8)
head(qrul(prob = 0.05, data = test, model = model))

Run the code above in your browser using DataLab