|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
DesignMatrix
DesignMatrix[{{x11, x12, ..., y1}, {x21, x22, ..., y2}, ...}, {f1, f2, ...}, {x1, x2, ...}]
constructs the design matrix for the linear model
.
Details and OptionsDetails and Options
- DesignMatrix[{y1, y2, ...}, {f1, f2, ...}, x] assumes data of the form
. » - With data in the form
, the number of coordinates
,
, ... should equal the number of variables
. - The design matrix m is formed from the values of basis functions
at data points in the form -
- DesignMatrix takes the following options:
-
IncludeConstantBasis True whether to include a constant basis function NominalVariables None variables considered as nominal or categorical WorkingPrecision Automatic precision used in internal computations - With the setting IncludeConstantBasis->False, the design matrix for a model of form
is constructed. »
ExamplesExamplesopen allclose all
Basic Examples (3)Basic Examples (3)
Design matrix for a linear model:
| In[1]:= |
| Out[1]= |
| In[2]:= |
Out[2]//MatrixForm= | |
![]() | |
| In[3]:= |
Out[3]//MatrixForm= | |
![]() | |
| In[4]:= |
Out[4]//MatrixForm= | |
![]() | |
Design matrix with two predictor variables:
| In[1]:= |
| Out[1]= | ![]() |
| In[2]:= |
Out[2]//MatrixForm= | |
![]() | |
| In[3]:= |
Out[3]//MatrixForm= | |
![]() | |
Assume predictor values
,
, ...:
| In[1]:= |
Out[1]//MatrixForm= | |
![]() | |
New in 7
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »







