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.

compare

Compare test data to historical data ensemble for similarity models

Syntax

compare(mdl,data)
compare(___,Name,Value)

Description

example

compare(mdl,data) plots the test component degradation data in data superimposed on the most similar data sets from the historical ensemble stored in the fitted similarity model mdl. The K most similar data sets from the ensemble are plotted, where K is the NumNearestNeighbors property of mdl.

example

compare(___,Name,Value) specifies plotting options using one or more name-value pair arguments.

Examples

collapse all

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.

Create and train a pairwise similarity model.

mdl = pairwiseSimilarityModel;
fit(mdl,pairwiseTrainTables,"Time","Condition")

Load testing data.

load('pairwiseTestData.mat')

Compare the degradation profile of the test data to the profiles of the historical data ensemble.

compare(mdl,pairwiseTestData)

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.

Create and train a pairwise similarity model.

mdl = pairwiseSimilarityModel;
fit(mdl,pairwiseTrainTables,"Time","Condition")

Load testing data.

load('pairwiseTestData.mat')

Compare the degradation profile of the test data to the profiles of the 10 most similar members of the historical data ensemble.

compare(mdl,pairwiseTestData,'NumNearestNeighbors',10)

Input Arguments

collapse all

Similarity RUL model, specified as a hashSimilarityModel object, a pairwiseSimilarityModel object, or a residualSimilarityModel object. The model must be fitted using fit before calling compare.

Degradation feature profiles for estimating the RUL of similarity models, measured over the life span of a component up to the current life time, specified as one of the following:

  • (N+1)-by-M numeric array, where N is the number of features and M is the number of feature measurements. In each row, the first column contains the usage time and the remaining columns contain the corresponding degradation feature measurements. The order of the features must match the order specified in the DataVariables property of mdl.

  • table or timetable object — The table must contain variables with names that match the strings in the DataVariables and LifeTimeVariable properties of mdl.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'NumNearestNeighbors','10' plots ten similar data sets

Number of nearest neighbors, specified as the comma-separated pair 'NumNearestNeighbors' and either Inf or a finite positive integer. Use this option to select the number of most similar data sets to plot by overriding the NumNearestNeighbors property. If NumNearestNeighbors is Inf, then compare plots the degradation data for all the ensemble data sets.

Degradation data bounds, specified as the comma-separated pair 'Threshold' and a two-column array with N rows, where N is the number of data variables used by mdl. The first column of Threshold contains the lower bounds for the variables, and the second column contains the upper bounds. The bounds are rendered as yellow-colored patches.

To disable the bounds for a given variable, specify the lower and upper bounds as -Inf and Inf, respectively.

Tips

  • To select which signals to plot, right-click on the plot area, and select Data Variable Selector. In the Data Variable Selector dialog box, the Select Variables box shows the variables that are available for plotting.

Introduced in R2018a