Main Content

nlarxPlot

Plot nonlinearity of nonlinear ARX model

Since R2023a

Description

nlarxPlot(model) plots the nonlinearity of a nonlinear ARX model on a nonlinear ARX plot. The plot shows the nonlinearity for all outputs of the model as a function of its input regressors.

example

nlarxPlot(model,color) specifies the color to use.

nlarxPlot(model1,...,modelN) generates the plot for multiple models.

nlarxPlot(model1,color1...,modelN,colorN) specifies the color for each model. You do not need to specify the color for all models.

example

nlarxPlot(___,'NumberofSamples',N) specifies the number of samples to use to grid the regressor space on each axis. This syntax can include any of the input argument combinations in the previous syntaxes.

example

Examples

collapse all

Estimate a nonlinear ARX model and plot its nonlinearity.

load iddata1
model1 = nlarx(z1,[4 2 1],'idWaveletNetwork','nlr',[1:3]);
nlarxPlot(model1)

Figure Nonlinear ARX Model Plot contains an axes object and other objects of type uipanel, uicontrol. The axes object with title Output: y1, xlabel Regressor 1, ylabel Regressor 2 contains an object of type surface. This object represents untitled1:idWaveletNetwork.

In the plot window, you can choose:

  • The regressors to use on the plot axes, and specify the center points for the other regressors in the configuration panel. For multi-output models, each output is plotted separately.

  • The output to view from the drop-down list located at the top of the plot.

load iddata1
model1 = nlarx(z1,[4 2 1],'idwave','nlr',[1:3]);
model2 = nlarx(z1,[4 2 1],'idSigmoidNetwork','nlr',[1:3]);
nlarxPlot(model1,'b', model2, 'g')

Figure Nonlinear ARX Model Plot contains an axes object and other objects of type uipanel, uicontrol. The axes object with title Output: y1, xlabel Regressor 1, ylabel Regressor 2 contains 2 objects of type surface. These objects represent untitled1:idWaveletNetwork, untitled2:idSigmoidNetwork.

load iddata1
model1 = nlarx(z1,[4 2 1],idWaveletNetwork);
model2 = nlarx(z1,[4 2 1],idSigmoidNetwork);
nlarxPlot(model1,'b', model2, 'g','NumberofSamples',50)

Figure Nonlinear ARX Model Plot contains an axes object and other objects of type uipanel, uicontrol. The axes object with title Output: y1, xlabel Regressor 1, ylabel Regressor 2 contains 2 objects of type surface. These objects represent untitled1:idWaveletNetwork, untitled2:idSigmoidNetwork.

Input Arguments

collapse all

Estimated nonlinear ARX model, specified as an idnlarx model object. Use nlarx to estimate the model.

Color to use to plot the regressors, specified as one of the following:

  • Character vector of color name, specified as one of the following:

    • 'b'

    • 'y'

    • 'm'

    • 'c'

    • 'r'

    • 'g'

    • 'w'

  • 3-element double vector of RGB values

By default, the colors are automatically chosen.

Data Types: double | char

Number of points used on the regressor axis to display the regressor samples, specified as a positive integer.

Data Types: double

More About

collapse all

What is a Nonlinear ARX Plot?

A nonlinear ARX plot displays the evaluated model nonlinearity for a chosen model output as a function of one or two model regressors. For a model M, the model nonlinearity (M.Nonlinearity) is a nonlinearity estimator function, such as idWaveletNetwork, idSigmoidNetwork, or idTreePartition, that uses model regressors as its inputs.

To understand what is plotted, suppose that {r1,r2,…,rN} are the N regressors used by a nonlinear ARX model M with nonlinearity nl corresponding to a model output. You can use getreg(M) to view these regressors. The expression Nonlin = evaluate(nl,[v1,v2,...,vN]) returns the model output for given values of these regressors, that is, r1 = v1, r2 = v2, ..., rN = vN. For plotting the nonlinearities, you select one or two of the N regressors, for example, rsub = {r1,r4}. The software varies the values of these regressors in a specified range, while fixing the value of the remaining regressors, and generates the plot of Nonlin vs. rsub. By default, the software sets the values of the remaining fixed regressors to their estimated means, but you can change these values. The regressor means are stored in the Nonlinearity.Parameters.RegressorMean property of the model.

Examining a nonlinear ARX plot can help you gain insight into which regressors have the strongest effect on the model output. Understanding the relative importance of the regressors on the output can help you decide which regressors to include in the nonlinear function for that output. If the shape of the plot looks like a plane for all the chosen regressor values, then the model is probably linear in those regressors. In this case, you can remove the corresponding regressors from nonlinear block, and repeat the estimation.

Furthermore, you can create several nonlinear models for the same data using different nonlinearity estimators, such a idWaveletNetwork network and idTreePartition, and then compare the nonlinear surfaces of these models. Agreement between plots for various models increases the confidence that these nonlinear models capture the true dynamics of the system.

To learn more about configuring the plot, see Configuring a Nonlinear ARX Plot.

Version History

Introduced in R2023a

expand all