This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

pairwiseSimilarityModel

Pairwise comparison-based similarity model for estimating remaining useful life

Description

Use pairwiseSimilarityModel to estimate the remaining useful life (RUL) of a component using a pairwise comparison-based similarity model. This model compares the degradation profile of a test component directly to the degradation path histories for an ensemble of similar components, such as multiple machines manufactured to the same specifications. The similarity of the test component to the ensemble members is a function of the distance between the degradation profile and the ensemble member profile, which is computed using correlation or dynamic time warping.

To configure a pairwiseSimilarityModel object, use fit. Once you configure the parameters of your similarity model, you can then predict the remaining useful life of similar components using predictRUL. For similarity models, the RUL of the test component is estimated as the median statistic of the lifetime span of the most similar components minus the current lifetime value of the test component. For a basic example illustrating RUL prediction, see Update RUL Prediction as Data Arrives.

For general information on predicting remaining useful life, see Models for Predicting Remaining Useful Life.

Creation

Syntax

mdl = pairwiseSimilarityModel
mdl = pairwiseSimilarityModel(initModel)
mdl = pairwiseSimilarityModel(___,Name,Value)

Description

example

mdl = pairwiseSimilarityModel creates a pairwise comparison-based similarity model for estimating RUL and initializes the model with default settings.

mdl = pairwiseSimilarityModel(initModel) creates a pairwise comparison-based similarity model and initializes the model parameters using an existing pairwiseSimilarityModel object initModel.

example

mdl = pairwiseSimilarityModel(___,Name,Value) specifies user-settable model properties using name-value pairs. For example, hashSimilarityModel('LifeTimeUnit',"days") creates a pairwise comparison-based similarity model that uses days as a lifetime unit. You can specify multiple name-value pairs. Enclose each property name in quotes.

Input Arguments

expand all

Pairwise comparison-based similarity model, specified as a pairwiseSimilarityModel object.

Properties

expand all

Time series distance computation method, specified as one of the following:

  • "correlation" — Measure distance using correlation

  • "dtw" — Compute distance using dynamic time warping. For more information, see dtw.

You can specify Method:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Distance formula for "dtw" distance computation method, specified as one of the following:

  • "euclidian" — Use the 2-norm of the difference between residuals.

  • "absolute" — Use the 1-norm of the difference between residuals.

You can specify Distance:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Lifetime span of historical data for computing similarity, specified as a positive scalar or duration object. When computing similarity, the model uses historical data from lifetime (t-HistorySpan) to lifetime t, where t is the current lifetime.

You can specify HistorySpan:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Factor determining ensemble member exclusion rule for similarity computation, specified as a scalar from 0 through 1. WithinRangeRatio is used when the length of the test data and the length of the ensemble member data do not match, which happens near end-of-lifetime values of historical data. When WithinRangeRatio is 1, then there is no exclusion of ensemble members.

Suppose that the length of the shorter data is P and the length of the longer data is Q. Then, a similarity test is performed only if Q(1-WithinRangeRatio) <= P <= Q. Otherwise, the ensemble member is ignored.

You can specify WithinRangeRatio:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

This property is read-only.

Ensemble member life spans, specified as a double vector or duration object vector and computed from the ensemble member degradation profiles by the fit function.

Number of nearest neighbors for RUL estimation, specified as Inf or a finite positive integer. If NumNearestNeighbors is Inf, then predictRUL uses all the ensemble members during estimation.

You can specify NumNearestNeighbors:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Flag to include ties, specified as true or false. When IncludeTies is true, the model includes all neighbors whose distance to the test component data is less than the Kth smallest distance, where K is equal to NumNearestNeigbors.

You can specify IncludeTies:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Flag for standardizing feature data before computing distance, specified as true, false, or 'time-varying'.

When Standardize is true, the feature data is standardized such that feature X becomes (X-mean(X))/std(X).

When Standardize is 'time-varying', the feature data is standardized such that feature X(t) becomes (X(t) -M(t)) / S(t). Here, M(t) and S(t) are running estimates of the mean and standard deviation of the data.

You can specify Standardize:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Lifetime variable, specified as a string that contains a valid MATLAB® variable name or "".

When you train the model using the fit function, if your training data is a:

  • table, then LifeTimeVariable must match one of the variable names in the table

  • timetable, then LifeTimeVariable one of the variable names in the table or the dimension name of the time variable, data.Properties.DimensionNames{1}

You can specify LifeTimeVariable:

  • Using a name-value pair when you create the model

  • As an argument when you call the fit function

  • Using dot notation after model creation

Lifetime variable units, specified as a string.

The units of the lifetime variable do not need to be time-based. The life of the test component can be measured in terms of a usage variable, such as distance traveled (miles) or fuel consumed (gallons).

Degradation variable names, specified as a string or string array. The strings in DataVariables must be valid MATLAB variable names.

You can specify DataVariables:

  • Using a name-value pair when you create the model

  • As an argument when you call the fit function

  • Using dot notation after model creation

Flag for using parallel computing for nearest-neighbor searching, specified as either true or false.

You can specify UseParallel:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Additional model information for bookkeeping purposes, specified as any data type or format. The model does not use this information.

You can specify UserData:

  • Using a name-value pair when you create the model

  • Using dot notation after model creation

Object Functions

predictRULEstimate remaining useful life for a test component
fitEstimate parameters of remaining useful life model using historical data
compareCompare test data to historical data ensemble for similarity models

Examples

collapse all

Load training data.

load('pairwiseTrainVectors.mat')

The training data is a cell array of column vectors. Each column vector is a degradation feature profile for a component.

Create a pairwise similarity model with default settings.

mdl = pairwiseSimilarityModel;

Train the similarity model using the training data.

fit(mdl,pairwiseTrainVectors)

Load training data.

load('pairwiseTrainTables.mat')

The training data is a cell array of tables. Each table is a degradation feature profile for a component. Each profile consists of life time measurements in the "Time" variable and corresponding degradation feature measurements in the "Condition" variable.

Create a pairwise similarity model that computes distance using dynamic time warping with an absolute distance metric.

mdl = pairwiseSimilarityModel('Method',"dtw",'Distance',"absolute");

Train the similarity model using the training data. Specify the names of the life time and data variables.

fit(mdl,pairwiseTrainTables,"Time","Condition")

Load training data.

load('pairwiseTrainTables.mat')

The training data is a cell array of tables. Each table is a degradation feature profile for a component. Each profile consists of life time measurements in the "Time" variable and corresponding degradation feature measurements in the "Condition" variable.

Create a pairwise similarity model that computes distance using dynamic time warping with an absolute distance metric and uses hours as a life time unit.

mdl = pairwiseSimilarityModel('Method',"dtw",'Distance',"absolute",'LifeTimeUnit',"hours");

Train the similarity model using the training data. Specify the names of the life time and data variables.

fit(mdl,pairwiseTrainTables,"Time","Condition")

Load testing data. The test data contains the degradation feature measurements for a test component up to the current life time.

load('pairwiseTestData.mat')

Predict the RUL of the test component using the trained similarity model.

estRUL = predictRUL(mdl,pairwiseTestData)
estRUL = duration
   93.671 hr

The estimated RUL for the component is around 94 hours.

Extended Capabilities

Introduced in R2018a