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)
# Construct the health index on new data using stored weights/offsets
hi_new <- compute_healthindex(model = model, data = test)
head(hi_new)
Run the code above in your browser using DataLab