library(degradr)
# Load example data sets
data(filter_train)
data(filter_test)
# Show the original column names
colnames(filter_train)
# Rename the columns to match the expected format: t, x, unit
colnames(filter_train) <- c("t", "x", "unit")
colnames(filter_test) <- c("t", "x", "unit", "RUL")
# Plot the training set
plot_degradr(data = filter_train, D = 600)
# Fit an exponential mixed-effects model of degree 1
model <- fit_model(data = filter_train, type = "exponential", degree = 1)
# Predict the remaining useful life (RUL) for the test units,
# assuming a fixed failure threshold D = 600
predict_rul(data = filter_test, model = model, D = 600)
Run the code above in your browser using DataLab