search for: ncomp

Displaying 20 results from an estimated 67 matches for "ncomp".

Did you mean: comp
2003 Dec 09
2
problem with pls(x, y, ..., ncomp = 16): Error in inherit s( x, "data.frame") : subscript out of bounds
I don't know the details of pls (in the pls.pcr package, I assume), but if you use validation="CV", that says you want to use CV to select the best number of components. Then why would you specify ncomp as well? Andy > From: ryszard.czerminski at pharma.novartis.com > > When I try to use ncomp parameter in pls procedure I get > following error: > > > library(pls.pcr) > > m <- pls(x, y, validation = "CV", niter = 68, ncomp = 16) > Error in inherits(x...
2004 May 27
1
R-1.9.0: Error in paste(ncomp, "LV's") : Argument "ncomp" is missing, with no default
...The same thing works fine in 1.8.1 Best regards, Ryszard # R-1.9.0 library(pls.pcr) nr <- 8; ndim <- 2 x <- matrix(rnorm(nr*ndim), nrow=nr) y <- as.matrix(x[,1]) for (i in 2:ndim) y <- y + x[,i] y <- y + rnorm(length(y)) m <- pls(x,y,validation='CV') # Error in paste(ncomp, "LV's") : Argument "ncomp" is missing, with no default
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 make the interaction between x and x ^ 2 use the comman...
2011 Nov 30
1
Invalid number of components, ncomp
Error in mvr(Kd_nM ~ qsar, ncomp = 6, data = my, validation = "CV", method = "kernelpls") :   Invalid number of components, ncomp How I can fix this? [[alternative HTML version deleted]]
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 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. True, but better I believe: see ?poly. e.g. poly(cb...
2008 May 01
4
efficient code - yet another question
...39;t know (or I can't see it) the part of the code that can be improved (but it is clear that the bottle neck is the for and while loops). I would really appreciate any ideas/comments/etc... Thanks ################################################################# pca.nipals <- function(X, ncomp, iter = 50, toler = sqrt(.Machine$double.eps)) # X...data matrix, ncomp...number of components, # iter...maximal number of iterations per component, # toler...precision tolerance for calculation of components { Xh <- scale(X, center = TRUE, scale = FALSE) nr <- 0 T <- NULL;...
2017 Jul 16
2
How to formulate quadratic function with interaction terms for the PLS fitting model?
...; > 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 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. > > True, but better I b...
2010 Jul 08
4
Column header strategy
...4 D.5 , etc. all the way to D.185 I was under the impression from several R examples in pls that if you name your columns like above, you should be able to simply call all the D factors with "D", instead of going in and putting a plus sign between each column. miceD <- plsr(pID50~D, ncomp=10,data = micetitletest) Error in model.frame.default(formula = pID50 ~ D, data = micetitletest) : invalid type (closure) for variable 'D' VS. miceD <- plsr(pID50 ~ D.1 + D.2 + D.3 + D.4 etc. to D.185 , ncomp=10, data = micetitletest) What am I missing above that's causing that...
2009 Jun 26
0
calculate AIC
...5.67,4.888,5.354,5.681, 7.372,7.372,6.811,4.654,6.18,6.994,8.47,8.466,6.113,6.695,6.695,7.269,6.205, 6.838,9.3,6.994,7.408,7.869,6.755), X5=c(0.25,0.67,0.28,0.52,0.25,0.25,0.25,0.67,0.54,0.67,0.67,0.54,0.2,0.2, 0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,1.08,0.67,0.67, 0.67,0.51) ) ncomp<-5 model<-plsr(y~ .,data=data,ncomp=ncomp,validation="LOO",x="TRUE",y="TRUE",model="TRUE") y<-model$y y.hat<-model$fitted.value[,,ncomp] residuals<-model$residuals[,,ncomp] sigmaML<-sqrt(mean(residuals^2)) loglik<-sum(dnorm(y,y.hat,sigmaM...
2011 Mar 22
1
In ppls package kernel method is unsupported?
require(ppls) data(BOD) X<-BOD[,1] y<-BOD[,2] Xtest=seq(min(X),max(X),length=200) dummy<-X2s(X,Xtest,deg=3,nknot=20) Z<-dummy$Z Ztest<-dummy$Ztest size<-dummy$sizeZ P<-Penalty.matrix(size,order=2) lambda<-200 number.comp<-3 penalized.pls(Z,y,P=lambda*P,ncomp=number.comp)$coefficients # By default kernel=F penalized.pls(Z,y,P=lambda*P,ncomp=number.comp,kernel=TRUE)$coefficients # Same as above...?! penalized.pls.kernel(Z,y,M=lambda*P,ncomp=number.comp) # But using directly, coefficients are different. -- Mi³ego dnia [[alternative HTML version delete...
2017 Jul 16
0
How to formulate quadratic function with interaction terms for the PLS fitting model?
...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 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. >> &gt...
2005 Aug 27
1
PLSR: model notation and reliabilities
...constructed by 3 indicators (Y1,Y2,Y3). Actually my model is far more complicated, I just give a simplified example here. Which is the correct notation for the model (I'm skipping the crossvalidation for the moment) : MyModel <- plsr(Y1+Y2+Y3 ~ ((D1a+D1b+D1c)*m1) + ((D2a+D2b+D2c)*m2),ncomp=2) or : Y <- cbind(Y1,Y2,Y3) X1 <- cbind(D1a,D1b,D1c) X2 <- cbind(D2a,D2b,D2c) MyModel <- plsr( Y ~ (X1*m1) + (X2*m2),ncomp=2) How do I calculate the internal composite reliabilty (ICR) ? Is the Average variable explained (AVE) the mentioned as "% variance explained&...
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
...a.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 <- gasoline[1:50,] gas1 <- plsr(octane ~ poly(as.matrix(NIR), 2), ncomp = 10, data = gasTrain, validation = "LOO") Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value > gas1 <- plsr(octane ~ poly(as.matrix(gasTrain$NIR), degree=2), ncomp = 10, data = gasTrain, validation = "CV") Error in rep...
2017 Jul 13
4
Quadratic function with interaction terms for the PLS fitting model?
...on 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. >> >...
2007 Nov 01
2
Some problem in opening connection with" .dat" extention file in matrix(scan) function of R 2.5
...blem while I m trying to run a program .I m attaching both the program and the data to which I have to obtain my estimation results. "Motives.dat" is the data file, and "OBTfile4.3" is the complete code of program. by Running this // rawdata<-matrix(scan(inputFile, n = nsubj*ncomp), nsubj, ncomp, byrow = TRUE) \\ The error appears to be // Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file 'motives_pc.dat', reason 'No such file or directory' in: file(file, "r") \\ where # name of preference...
2008 Mar 15
1
again with polr
hello everybody solved the problem with summary, now I have another one eg I estimate > try.op <- polr( > as.ordered(sod.sit.ec.fam) ~ > log(y) + > log(1 + nfiglimin) + > log(1 + nfiglimagg) + > log(ncomp - nfiglitot) + > eta + > I(eta^2) + > uomo + > elem + > laurea + > saluteno + > extra > , > data = dfscale, > method...
2008 Jul 16
2
How to extract component number of RMSEP in RMSEP plot
Hi R-listers, I would like to know how can i extract component no. when the RMSEP is lowest? Currently, I only plot it manually and then only feed the ncomp to the jack knife command. However, I would like to automate this step. Please let me know. Many thanks. Rgrds, [[alternative HTML version deleted]]
2011 May 17
1
Help with PLSR with jack knife
...he 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 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, validation = "LOO") and BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, validation = "CV") I have also used the following command to obtain the loadings BHPLS1_Loadings <- loadings(BHPLS1) Now I am unsure of how to utilise th...
2011 May 18
1
Help with Memory Problems (cannot allocate vector of size)
While doing pls I found the following problem > BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, jackknife = >FALSE, validation = "LOO") when not enabling jackknife the command works fine, but when trying to enable jackknife i get the following error. >BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, jackknife = >TRUE, valid...
2011 Oct 18
1
problem in exceuting PLS
...et=NULL dataset$X=NULL len=length(variable) for( i in 1:len) { var=variable[i] if(i==1) { dataset$X=as.matrix(Data[var]) } if(i>1) { dataset$X=as.matrix(cbind(dataset$X,Data[var])) } } depVar="Y" dataset$Y=as.matrix(cbind(Data[depVar])) pls1=mvr(Y~X,data=dataset,ncomp=4) summary(pls1) On execution the error is Error in get(as.character(FUN), mode = "function", envir = envir) : object 'X6' of mode 'function' was not found Please help me on this -- View this message in context: http://r.789695.n4.nabble.com/problem-in-exceuting-PLS...