主要内容

情节

Class:NonLinearModel

Plot residuals of nonlinear regression model

Syntax

情节(mdl)
绘图(MDL,PlotType)
绘图(MDL,plottype,name,value)
h = plotResiduals(___)

描述

情节(mdl)创建非线性回归模型的直方图图(mdl) residuals.

情节(mdl,plottype)specifies the residual plot typeplottype.

情节(mdl,plottype,姓名,Value)使用一个或多个名称值参数指定其他选项。例如,您可以指定残差数据点的残差类型和图形属性。

h=绘图(___)returns graphics objects for the lines or patch in the plot using any of the input argument combinations in the previous syntaxes. Useh在创建绘图后修改特定行或补丁的属性。有关属性列表,请参见线属性and补丁属性.

Input Arguments

mdl

非线性回归模型,由fitnlm.

plottype

字符向量或字符串标量指定图的类型:

“ caseorder” Residuals vs. case (row) order
“合身” 残差与拟合值
'histogram' 直方图
“滞后” 残差与滞后残余(r(t)vs.r(t–1))
'probability' 正常概率图
'symmetry' 对称图

Default:'histogram'

姓名-Value Arguments

Specify optional pairs of arguments asname1 = value1,...,namen = valuen, 在哪里姓名is the argument name andValue是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Note

The graphical properties listed here are only a subset. For a complete list, see线属性for lines and补丁属性for histogram. The specified properties apply to the appearance of residual data points or the appearance of the histogram.

Color

线或标记的颜色,指定为RGB三重态,十六进制的颜色代码,颜色名称或下表中列出的颜色选项之一的简称。

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1]; for example,[0.4 0.6 0.7].

  • 十六进制的颜色代码是字符向量或字符串标量,以哈希符号开头(#),然后是三个或六个十六进制的数字,范围从0F. The values are not case sensitive. Thus, the color codes'#FF8800','#ff8800','#F80', and'#f80'are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color Name 简称 RGB Triplet Hexadecimal Color Code Appearance
“红色” 'r' [1 0 0] '#FF0000'

颜色红色样品

'green' 'G' [0 1 0] '#00FF00'

颜色绿色样品

'蓝色的' 'b' [0 0 1] '#0000FF'

Sample of the color blue

'cyan' 'C' [0 1 1] '#00ffff'

颜色青色样品

'品红' 'M' [1 0 1] '#ff00ff'

Sample of the color magenta

'黄色的' 'y' [1 1 0] '#FFFF00'

黄色样品

'黑色的' 'K' [0 0 0] '#000000'

Sample of the color black

'white' 'w' [1 1 1] '#FFFFFF'

Sample of the color white

这是RGB三胞胎和默认颜色的十六进制颜色代码matlab®在许多类型的图中使用。

RGB Triplet Hexadecimal Color Code Appearance
[0 0.4470 0.7410] '#0072BD'

RGB三重态样品[0 0.4470 0.7410],显示为深蓝色

[0.8500 0.3250 0.0980] '#D95319'

RGB三重态样品[0.8500 0.3250 0.0980],如深橙色

[0.9290 0.6940 0.1250] '#EDB120'

RGB三重态样品[0.9290 0.6940 0.1250],显示为深黄色

[0.4940 0.1840 0.5560] '#7E2F8E'

Sample of RGB triplet [0.4940 0.1840 0.5560], which appears as dark purple

[0.4660 0.6740 0.1880] '#77AC30'

Sample of RGB triplet [0.4660 0.6740 0.1880], which appears as medium green

[0.3010 0.7450 0.9330] '#4dbeee'

RGB三胞胎样品[0.3010 0.7450 0.9330],如浅蓝色

[0.6350 0.0780 0.1840] '#A2142F'

RGB三重态样品[0.6350 0.0780 0.1840],看起来为深红色

LineWidth

填充区域的线的宽度或边缘,点为正标量。一个点是1/72英寸。

Default:0.5

Marker

标记符号,指定为该表中的值之一。

Marker 描述 结果标记
'o' Circle

Sample of circle marker

'+' 加号

加号标记样品

'*' Asterisk

星号标记样品

'.' Point

Sample of point marker

'x'

跨标记样本

'_' 水平线

水平线标记样品

'|' 垂线

Sample of vertical line marker

's' Square

平方标记样品

'D' Diamond

Sample of diamond line marker

'^' Upward-pointing triangle

向上的三角标记样本

'v' 向下三角形

向下点三角形标记的样本

'>' Right-pointing triangle

国际扶轮样本ght-pointing triangle marker

'<' 左点三角形

Sample of left-pointing triangle marker

'p' 五角星

五角星标记样品

'H' Hexagram

Sample of hexagram marker

'none' No markers Not applicable

MarkeredGecolor

标记概述颜色,指定为RGB三重态,十六进制颜色代码,颜色名称或短名称,用于列出的颜色选项之一Color名称值参数。

MarkerfaceColor

填充填充标记的颜色,指定为RGB三胞胎,十六进制的颜色代码,颜色名称或短名称,用于列出的颜色选项之一Color名称值参数。

MarkerSize

Size of the marker in points, a strictly positive scalar. One point is 1/72 inch.

ResidualType

Type of residual used in the plot:

'生的' Observed minus fitted values
“皮尔森” Raw residuals divided by RMSE
'Standardized' 原始残差除以其估计的标准偏差
'Studentized' 原始残差除以其标准偏差的独立(删除1)估计值

Default:'生的'

输出参数

h

图形对象对应于绘图中的线或补丁,返回为图形数组。使用点符号查询图形对象的属性并设置属性。有关详细信息,请参阅线属性and补丁属性.

You can use name-value arguments to specify the appearance of residual data points or the appearance of the histogram, corresponding to the first graphics objecth(1).

例子

展开全部

Plot the residuals of a fitted nonlinear model.

加载反应data and fit a model of the reaction rate as a function of reactants.

load反应mdl = fitnlm(reactants,rate,@hougen,[1 .05 .02 .1 2]);

绘制拟合模型的残差。

情节(mdl)

图包含一个轴对象。带有标题的残差直方图的轴对象包含类型补丁的对象。

Create a normal probability plot of the residuals of a fitted nonlinear model.

加载反应data and fit a model of the reaction rate as a function of reactants.

load反应mdl = fitnlm(reactants,rate,@hougen,[1 .05 .02 .1 2]);

Create a normal probability plot of the residuals of the fitted model.

情节(mdl,'probability')

图包含一个轴对象。The axes object with title Normal probability plot of residuals contains 2 objects of type line.

尖端

  • The data cursor displays the values of the selected plot point in a data tip (small text box located next to the data point). The data tip includes thex-axis andy-axis values for the selected point, along with the observation name or number.