compare
Compare test data to historical data ensemble for similarity models
Description
compare(___,
specifies plotting options using one or more name-value pair arguments.Name,Value
)
Examples
Compare Test Data to Historical Data
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)
Compare Test Data to Most Similar Historical Data
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
mdl
— Similarity RUL model
hashSimilarityModel
object | pairwiseSimilarityModel
object | residualSimilarityModel
object
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
.
data
— Degradation feature measurements
array | table
| timetable
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-by-(Mi+1) arrays, where N is the number of feature measurements (at different usage times) and Mi is the number of features. The first column contains the usage times and the remaining columns contain the corresponding measurements for degradation features. The order of the features must match the order specified in the
DataVariables
property ofmdl
.table
ortimetable
object — The table must contain variables with names that match the strings in theDataVariables
andLifeTimeVariable
properties ofmdl
.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'NumNearestNeighbors','10'
plots ten similar data
sets
NumNearestNeighbors
— Number of nearest neighbors
Inf
| finite positive integer
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.
Threshold
— Degradation data bounds
two-column array
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.
Parent
— Figure or axes on which to draw plot
figure handle | axes handle
Figure or axes on which to draw plot, specified as a figure handle or a plot handle. Use this argument especially when you are plotting multiple variables and want to control where the function plots them.
You cannot specify Parent
as an axes handle when
there are multiple variables that need multiple axes.
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 (한국어)