Generate a linear model from data and a specification
X=stepwiselm_generate(data,modelspec) [X,multiindices]=stepwiselm_generate(data,modelspec)
a samplesize-by-nbinputs matrix of doubles, the input variables where samplesize is the number of experiments and nbinputs is the number of variables
a 1-by-1 matrix of doubles or string. If modelspec is a double, integer value, greater or equal than 0, the total degree of the polynomial. If modelspec is a string, it can be equal to "constant", "linear", "interactions", "purequadratic", "quadratic" or "polyij". See below for a detailed description of each model.
a n-by-nbcoeffs matrix of doubles, the input of the generated linear model
a nbcoeffs-by-nbinputs matrix of doubles, integer value, greater or equal than 0, the exponents
Generate a model from a specification, with required interactions if necessary.
The variable modelspec allows to choose the total degree of the model.
The available string values of the modelspec are the following.
"constant" : only a constant term is included (same as modelspec=0)
"linear" : a constant term and each variable are included (same as modelspec=1)
"interactions" : a constant term, each variable and interactions are included (not quadratic term)
"purequadratic" : a constant term, each variable and quadratic terms are included (not interactions)
"quadratic" : a constant term, each variable, interactions and quadratic terms are included (same as modelspec=2)
"polyij" : a polynomial where the maximum degree of each monomial is given. For example, poly402 is for a model with three input variables : the maximum degree for X1 is 4, the maximum degree for X2 is 0, the maximum degree for X3 is 2.