simul_data_UniYX: Data generating function for univariate plsR models

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/simul_data_UniYX.R

Description

This function generates a single univariate response value Y and a vector of explanatory variables (X_1,…,X_{totdim}) drawn from a model with a given number of latent components.

Usage

1
simul_data_UniYX(totdim, ncomp)

Arguments

totdim

Number of columns of the X vector (from ncomp to hardware limits)

ncomp

Number of latent components in the model (from 2 to 6)

Details

This function should be combined with the replicate function to give rise to a larger dataset. The algorithm used is a port of the one described in the article of Li which is a multivariate generalization of the algorithm of Naes and Martens.

Value

vector

(Y,X_1,…,X_{totdim})

Author(s)

Frédéric Bertrand
frederic.bertrand@math.unistra.fr
https://fbertran.github.io/homepage/

References

T. Naes, H. Martens, Comparison of prediction methods for multicollinear data, Commun. Stat., Simul. 14 (1985) 545-576.
Morris, Elaine B. Martin, Model selection for partial least squares regression, Chemometrics and Intelligent Laboratory Systems 64 (2002) 79-89, doi: 10.1016/S0169-7439(02)00051-5.

See Also

simul_data_YX and simul_data_complete for generating multivariate data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
simul_data_UniYX(20,6)                          


dimX <- 6
Astar <- 2
simul_data_UniYX(dimX,Astar)
(dataAstar2 <- data.frame(t(replicate(50,simul_data_UniYX(dimX,Astar)))))
cvtable(summary(cv.plsR(Y~.,data=dataAstar2,5,NK=100, verbose=FALSE)))

dimX <- 6
Astar <- 3
simul_data_UniYX(dimX,Astar)
(dataAstar3 <- data.frame(t(replicate(50,simul_data_UniYX(dimX,Astar)))))
cvtable(summary(cv.plsR(Y~.,data=dataAstar3,5,NK=100, verbose=FALSE)))

dimX <- 6
Astar <- 4
simul_data_UniYX(dimX,Astar)
(dataAstar4 <- data.frame(t(replicate(50,simul_data_UniYX(dimX,Astar)))))
cvtable(summary(cv.plsR(Y~.,data=dataAstar4,5,NK=100, verbose=FALSE)))

rm(list=c("dimX","Astar","dataAstar2","dataAstar3","dataAstar4"))

plsRglm documentation built on March 16, 2021, 1:08 a.m.