最新のリリースでは、このページがまだ翻訳されていません。 このページの最新版は英語でご覧になれます。
MuPAD® Notebook は将来のリリースでは削除される予定です。代わりに MATLAB® ライブ スクリプトを使用してください。
MuPAD Notebook ファイルを MATLAB ライブ スクリプト ファイルに変換するには、convertMuPADNotebook
を参照してください。MATLAB ライブ スクリプトは、多少の違いはありますが、MuPAD 機能の大半をサポートします。詳細は、MuPAD Notebook を MATLAB ライブ スクリプトに変換を参照してください。
stats::hodrickPrescottFilter | The Hodrick-Prescott filter |
stats::linReg | Linear regression (least squares fit) |
stats::reg | Regression (general linear and nonlinear least squares fit) |
Regression is the process of fitting models to data. Linear
regression assumes that the relationship between the dependent variable yi and
the independent variable xi is
linear: yi = a + b xi.
Here a
is the offset and b
is
the slope of the linear relationship.
Univariate Nonlinear Regression
Nonlinear regression can assume any type of relationship between
the dependent variable y and
independent variables xj.
For nonlinear regression, MuPAD provides the stats::reg
function. This function uses
the least-squares approach for computing the regression. stats::reg
chooses the
parameters p1, ..., pn by
trying to minimize the quadratic error:
The stats::reg
function
also performs linear and nonlinear regressions with two or more independent
variables. The following example demonstrates how to perform regression
and fit the data to a function of two variables. Suppose, you have
three data lists that contain coordinates x
, y
,
and z
of discrete points: