Displaying 20 results from an estimated 2000 matches similar to: "Interactions"
2008 Oct 20
1
Calculate SPE in PLS package
Dear list,
I want to calculate SPE (squared prediction error) in x-space, can
someone help?
Here are my codes:
fit.pls<-
plsr(Y~X,data=DAT,ncomp=3,scale=T,method='oscorespls',validation="CV",x=
T)
actual<-fit.pls$model$X
pred<-fit.pls$scores %*% t(fit.pls$loadings)
SPE.x<-rowSums((actual-pred)^2)
Am I missing something here?
Thanks in advance.
Stella Sim
2007 Jan 02
0
pls version 2.0-0
Version 2.0-0 of the pls package is now available on CRAN.
The pls package implements partial least squares regression (PLSR) and
principal component regression (PCR). Features of the package include
- Several plsr algorithms: orthogonal scores, kernel pls and simpls
- Flexible cross-validation
- A formula interface, with traditional methods like predict, coef,
plot and summary
- Functions
2007 Jan 02
0
pls version 2.0-0
Version 2.0-0 of the pls package is now available on CRAN.
The pls package implements partial least squares regression (PLSR) and
principal component regression (PCR). Features of the package include
- Several plsr algorithms: orthogonal scores, kernel pls and simpls
- Flexible cross-validation
- A formula interface, with traditional methods like predict, coef,
plot and summary
- Functions
2013 Mar 02
2
caret pls model statistics
Greetings,
I have been exploring the use of the caret package to conduct some plsda
modeling. Previously, I have come across methods that result in a R2 and
Q2 for the model. Using the 'iris' data set, I wanted to see if I could
accomplish this with the caret package. I use the following code:
library(caret)
data(iris)
#needed to convert to numeric in order to do regression
#I
2017 Jul 13
0
How to formulate quadratic function with interaction terms for the PLS fitting model?
Below.
-- Bert
Bert Gunter
On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini <luigi.biagini at gmail.com> wrote:
> I have two ideas about it.
>
> 1-
> i) Entering variables in quadratic form is done with the command I
> (variable ^ 2) -
> plsr (octane ~ NIR + I (nir ^ 2), ncomp = 10, data = gasTrain, validation =
> "LOO"
> You could also use a new variable
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
> On Jul 13, 2017, at 10:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> poly(NIR, degree = 2) will work if NIR is a matrix, not a data.frame.
> The degree argument apparently *must* be explicitly named if NIR is
> not a numeric vector. AFAICS, this is unclear or unstated in ?poly.
I still get the same error with:
library(pld)
data(gasoline)
gasTrain <-
2017 Jul 13
3
How to formulate quadratic function with interaction terms for the PLS fitting model?
I have two ideas about it.
1-
i) Entering variables in quadratic form is done with the command I
(variable ^ 2) -
plsr (octane ~ NIR + I (nir ^ 2), ncomp = 10, data = gasTrain, validation =
"LOO"
You could also use a new variable NIR_sq <- (NIR) ^ 2
ii) To insert a square variable, use syntax I (x ^ 2) - it is very
important to insert I before the parentheses.
iii) If you want to
2017 Jul 16
0
How to formulate quadratic function with interaction terms for the PLS fitting model?
??
If I haven't misunderstood, they are completely different!
1) NIR must be a matrix, or poly(NIR,...) will fail.
2) Due to the previously identified bug in poly, degree must be
explicitly given as poly(NIR, degree =2,raw = TRUE).
Now consider the following example:
> df <-matrix(runif(60),ncol=3)
> y <- runif(20)
> mdl1 <-lm(y~df*I(df^2))
> mdl2
2017 Jul 16
2
How to formulate quadratic function with interaction terms for the PLS fitting model?
> On Jul 13, 2017, at 7:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> Below.
>
> -- Bert
> Bert Gunter
>
>
>
> On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini <luigi.biagini at gmail.com> wrote:
>> I have two ideas about it.
>>
>> 1-
>> i) Entering variables in quadratic form is done with the command I
>>
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
> On Jul 12, 2017, at 6:58 PM, Ng, Kelvin Sai-cheong <kscng at connect.hku.hk> wrote:
>
> 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
2013 Jul 13
1
Alternative to eval(cl, parent.frame()) ?
Dear developeRs,
I maintain a package 'pls', which has a main fit function mvr(), and
functions plsr() and pcr() which are meant to take the same arguments as
mvr() and do exactly the same, but have different default values for the
'method' argument. The three functions are all exported from the name
space.
In the 'pre namespace' era, I took inspiration from lm() and
2005 Aug 27
1
PLSR: model notation and reliabilities
I'm new in both R and statistics. I "did my homework",
I tried the archives and whatever I managed to get
from the sources, but still I need assistance with
the plsr package.
I have a model with 2 core determinants D1 and D2,
made by 3 indicators each (D1a,D1b,D1c and so on).
Also I have 2 moderating variables (m1,m2), where
m1 moderates D1 and m2 modarates D2.
The dependent
2007 Oct 16
1
data structure for plsr
All,
I am working with NIR spectral data and it was great to find that the example in ?plsr also used spectral data. Unfortunately, I am having difficulty figuring out how the "yarn" dataset is structured to allow for the plsr model to read:
library(pls)
data(yard)
yarn.oscorespls <- mvr(density ~ NIR, 6, data = yarn, validation = "CV", method = "oscorespls")
2009 Jun 26
0
calculate AIC
Dear all,
I want to calculate AIC values of PLSR models. But I find that AIC and extractAIC functions in R could not be used to calculate AIC values of PLSR models. Now I write a section of code(below) to calculate it. But I don't known whether the result is right or not. If I am wrong, please give me some suggestions. Thanks a lot.
Rong Huang
data<-data.frame(
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
Bert,
The 'degree' argument follows the "..." argument in the function declaration:
poly(x, ..., degree = 1, coefs = NULL, raw = FALSE, simple = FALSE)
Generally, any arguments after the "..." must be explicitly named, but as per the Details section of ?poly:
"Although formally degree should be named (as it follows ...), an unnamed second argument of length 1
2018 Apr 24
0
[RFC] Turn the MachineOutliner on by default in AArch64 under -Oz
Thanks for reducing that for me!
The outliner pulls out the following:
OUTLINED_FUNCTION_0: // @OUTLINED_FUNCTION_0
.cfi_sections .debug_frame
.cfi_startproc
// %bb.0:
adrp x29, g1
add x29, x29, :lo12:g1
adrp x30, g2 // This adrp shouldn’t have been outlined.
ret
It shouldn’t be pulling out that adrp. There’s a special case for arps in
2011 May 17
1
Help with PLSR with jack knife
Hi
I am analysing a dataset of 40 samples each with 90,000 intensity measures for
various peptides. I am trying to identify the Biomarkers (i.e. most significant
peptides). I beleive that PLS with jack knifing, or alternativeley
CMV(cross-model-validation) are multivariateThe 40 samples belong to four
different groups.
I have managed to conduct the plsr using the commands:
BHPLS1 <-
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
Hi Bert,
Ok, to your initial point, the key nuance is that if 'x' is a vector, you can leave the 'degree' argument unnamed, however, if 'x' is a matrix, you cannot. That aspect of the behavior does not seem to change if poly() is called stand alone or, as suggested in ?poly, within a formula to be parsed.
Working on tracing through the code using debug(), the error is
2017 Jul 13
2
Quadratic function with interaction terms for the PLS fitting model?
Marc:
1. I am aware of the need to explicitly name arguments after ... --
see the R Language definition where this can be inferred from the
argument matching rules.
2. I am aware of the stated exception for poly(). However:
> x1 <- runif(20)
> x2 <- runif(20)
> mx <- cbind(x1,x2)
> poly(mx,2)
Error in poly(dots[[i]], degree, raw = raw, simple = raw) :
'degree'
2017 Jul 13
2
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