Question

I am trying to apply RDA on my data in R, after some research I found that there is a package in R called "rda" which seems can do the job for me. However I looked at the description of the RDA function in that package and I'm a little confused now:

Usage given in R:

rda(x, y, xnew=NULL, ynew=NULL, prior=table(y)/length(y),alpha=seq(0, 0.99, len=10), delta=seq(0, 3, len=10), regularization="S", genelist=FALSE, trace=FALSE)

I'm not sure what do "alpha" and "delta" stand for in this case. I was taught that in RDA, there are two parameters "lambda" and "sigma", where lambda is a complexity parameter that dictates the balance between linear and quadratic discriminant analysis and sigma is another parameter to regularise the covariance matrix further. BOTH OF THEM ARE BETWEEN 0 AND 1.

But as for this "rda" function in R, the default values of delta is between 0 and 3 which confused me.

Could anyone explain this for me please? Thanks!

Was it helpful?

Solution

You can use the package klaR which have a function rda with a parametrization of regularization parameters similar to the one you described.

 detach(package:rda)     
 require(klaR)
 data(iris)
 x <- rda(Species ~ ., data = iris, gamma = 0.05, lambda = 0.2)
 predict(x, iris)

Is not a good idea to mix the two packages (namespace issue for some functions), it's better to detach rda if you want to use klaR (or the opposite).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top