plot
Plot survival function for covariate survival remaining useful life model
Description
plot(
plots the baseline survival
function of the fitted covariate survival model mdl
)mdl
against the
life time value for which it was computed. The plot data is stored in the
BaselineCumulativeHazard
property of
mdl
.
plot(
plots the survival function computed for the covariate data in
mdl
,covariates
)covariates
. To obtain the survival function, the hazard
rate is computed using the covariates and combined with the baseline survival
function.
Examples
Train Covariate Survival Model
Load training data.
load('covariateData.mat')
This data contains battery discharge times and related covariate information. The covariate variables are:
Temperature
Load
Manufacturer
The manufacturer information is a categorical variable that must be encoded.
Create a covariate survival model.
mdl = covariateSurvivalModel;
Train the survival model using the training data, specifying the life time variable, data variables, and encoded variable. There is no censor variable for this training data.
fit(mdl,covariateData,"DischargeTime",["Temperature","Load","Manufacturer"],[],"Manufacturer")
Successful convergence: Norm of gradient less than OPTIONS.TolFun
Plot the baseline survival function for the model.
plot(mdl)
Predict RUL Using Covariate Survival Model
Load training data.
load('covariateData.mat')
This data contains battery discharge times and related covariate information. The covariate variables are:
Temperature
Load
Manufacturer
The manufacturer information is a categorical variable that must be encoded.
Create a covariate survival model, and train it using the training data.
mdl = covariateSurvivalModel('LifeTimeVariable',"DischargeTime",'LifeTimeUnit',"hours",... 'DataVariables',["Temperature","Load","Manufacturer"],'EncodedVariables',"Manufacturer"); fit(mdl,covariateData)
Successful convergence: Norm of gradient less than OPTIONS.TolFun
Suppose you have a battery pack manufactured by maker B
that has run for 30
hours. Create a test data table that contains the usage time, DischargeTime
, and the measured ambient temperature, TestAmbientTemperature
, and current drawn, TestBatteryLoad
.
TestBatteryLoad = 25; TestAmbientTemperature = 60; DischargeTime = hours(30); TestData = timetable(TestAmbientTemperature,TestBatteryLoad,"B",'RowTimes',hours(30)); TestData.Properties.VariableNames = {'Temperature','Load','Manufacturer'}; TestData.Properties.DimensionNames{1} = 'DischargeTime';
Predict the RUL for the battery.
estRUL = predictRUL(mdl,TestData)
estRUL = duration
38.332 hr
Plot the survival function for the covariate data of the battery.
plot(mdl,TestData)
Input Arguments
mdl
— Covariate survival RUL model
covariateSurvivalModel
object
Covariate survival RUL model, specified as a
covariateSurvivalModel
object.
plot
plots the data in the
BaselineCumulativeHazard
property of
mdl
, which is a two-column array. The second column
contains the baseline survival functions values, and the first column
contains the corresponding life time values. The life time values are
plotted in the units specified by the LifeTimeUnits
property of mdl
.
covariates
— Current covariate values
row vector | table
with one row | timetable
with one row
Current covariate values for the component, specified as a:
Row vector whose elements specify the component covariate values only and not the life time values. The number of covariate values must match the number and order of the covariate data columns used when estimating
mdl
usingfit
.table
ortimetable
with one row. The table must contain the variables specified in theDataVariables
property ofmdl
.
If the covariate data contains encoded variables, then you must specify
covariates
using a table
or
timetable
.
To obtain the survival function, the hazard rate is computed using the covariates and combined with the baseline survival function. For more information, see Cox Proportional Hazards Model.
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)