# How to formulate quadratic function with interaction terms for the PLS fitting model?

7 messages
Open this post in threaded view
|

## How to formulate quadratic function with interaction terms for the PLS fitting model?

 Dear all, I am using the pls package of R to perform partial least square on a set of multivariate data.  Instead of fitting a linear model, I want to fit my data with a quadratic function with interaction terms.  But I am not sure how.  I will use an example to illustrate my problem: Following the example in the PLS manual: ## Read data  data(gasoline) gasTrain <- gasoline[1:50,] ## Perform PLS gas1 <- plsr(octane ~ NIR, ncomp = 10, data = gasTrain, validation = "LOO") where octane ~ NIR is the model that this example is fitting with. NIR is a collective of variables, i.e. NIR spectra consists of 401 diffuse reflectance measurements from 900 to 1700 nm. Instead of fitting with octane[i] = a[0] * NIR[0,i] + a[1] * NIR[1,i] + ... I want to fit the data with: octane[i] = a[0] * NIR[0,i] + a[1] * NIR[1,i] + ... + b[0]*NIR[0,i]*NIR[0,i] + b[1] * NIR[0,i]*NIR[1,i] + ... i.e. quadratic with interaction terms. But I don't know how to formulate this. May I have some help please? Thanks, Kelvin         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: How to formulate quadratic function with interaction terms for the PLS fitting model?

Open this post in threaded view
|

## Re: How to formulate quadratic function with interaction terms for the PLS fitting model?

Open this post in threaded view
|

## Re: How to formulate quadratic function with interaction terms for the PLS fitting model?

Open this post in threaded view
|