Description Usage Arguments Value Examples
View source: R/lambda.mul.sdwd.r
Conduct a k-fold cross-validation for mul.sdwd
and returns the optimal pair of L1 and L2 parameters.
1 2 3 4 5 6 7 8 9 10 | lambda.mul.sdwd(
X,
y,
R = 1,
lambda1.vec = c(0, 1e-04, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25),
lambda2.vec = c(0.25, 0.5, 0.75, 1, 3, 5),
nfolds = 10,
convThresh = 10^(-7),
nmax = 500
)
|
X |
A multiway array with dimensions N \times P_1 \times ... \times P_K. The first dimension (N) give the cases (e.g.subjects) to be classified. |
y |
A vector of length N with class label (-1 or 1) for each case. |
R |
Assumed rank of the coefficient array. |
lambda1.vec |
A vector of L1 candidates. Default is c(0, 1e-4, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25). |
lambda2.vec |
A vector of L2 candidates. Default is c(0.25, 0.50, 0.75, 1.00, 3, 5). |
nfolds |
The number of folds. Default value is 10. |
convThresh |
The algorithm stops when the distance between B_new and B_old is less than convThresh. Default is 1e-7. |
nmax |
Restrics how many iterations are allowed. Default is 500. |
A list of components
par
Optimal pair of L1 and L2 and the maximum t test statistic.
tstats
Test statistics for all L1 and L2 condidates.
1 2 3 4 5 6 7 | ## Load gene expression time course data (?IFNB_Data for more info)
data(IFNB_Data)
Class=2*(Class-1)-1 #redefine classes to -1 or 1
## Select penalty parameters by cross-validation
lambda.msdwd1 <- lambda.mul.sdwd(DataArray,y=Class,R=1,lambda1.vec=c(0, 1e-4, 0.001, 0.005, 0.01),
lambda2.vec=c(0.50, 1.00, 3, 5), nfolds = 10,convThresh=10^(-5),nmax=500)
lambda.msdwd1$par
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.