simul_data_YX: Data generating function for multivariate plsR models

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

View source: R/simul_data_YX.R

Description

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

Usage

1
simul_data_YX(totdim, ncomp)

Arguments

totdim

Number of column 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_1,…,Y_r,X_1,…,X_{totdim})

Note

The value of r depends on the value of ncomp :

ncomp r
2 3
3 3
4 4

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_complete for highlighting the simulations parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
simul_data_YX(20,6)                          


if(require(plsdepot)){
dimX <- 6
Astar <- 2
(dataAstar2 <- t(replicate(50,simul_data_YX(dimX,Astar))))
library(plsdepot)
resAstar2 <- plsreg2(dataAstar2[,4:9],dataAstar2[,1:3],comps=5)
resAstar2$Q2
resAstar2$Q2[,4]>0.0975

dimX <- 6
Astar <- 3
(dataAstar3 <- t(replicate(50,simul_data_YX(dimX,Astar))))
library(plsdepot)
resAstar3 <- plsreg2(dataAstar3[,4:9],dataAstar3[,1:3],comps=5)
resAstar3$Q2
resAstar3$Q2[,4]>0.0975

dimX <- 6
Astar <- 4
(dataAstar4 <- t(replicate(50,simul_data_YX(dimX,Astar))))
library(plsdepot)
resAstar4 <- plsreg2(dataAstar4[,5:10],dataAstar4[,1:4],comps=5)
resAstar4$Q2
resAstar4$Q2[,5]>0.0975

rm(list=c("dimX","Astar"))
}

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