getData
#> function(n=100,alpha=0.4,beta_0=0.2,sigma=0.3,
#> p1=50,p2=25,p3=25,p=1000){
#> R1 = R2 = R3 <- 1
#> d <- R1+R2+R3
#> A0 <- matrix(c(
#> c(rep(1/sqrt(R1),p1),rep(sqrt(alpha),p2),rep(0,p3),rep(0,p-p1-p2-p3)),
#> c(rep(0,p1),rep(sqrt(1-alpha),p2),rep(0,p3),rep(0,p-p1-p2-p3)),
#> c(rep(0,p1),rep(0,p2),rep(1,p3),rep(0,p-p1-p2-p3))
#> ),nrow = d,byrow = TRUE)
#> A <- eps*A0
#> D0 <- matrix(c(1,0,0,
#> sqrt(beta_0),sqrt(1-beta_0),0,
#> 0,0,0),nrow = d,byrow = FALSE)
#> D <- eps*D0
#> q <- ncol(D)
#> L_total <- q+p
#> psi <- MASS::mvrnorm(n,mu = rep(0,d+L_total),Sigma = diag(d+L_total))
#> phi <- psi[,1:d,drop=F]
#> errorX <- matrix(rep(sqrt(1-apply(A^2,2,sum)),n),n,byrow = TRUE)
#> errorY <- matrix(rep(sqrt(1-apply(D^2,2,sum)),n),n,byrow = TRUE)
#> X <- phi%*%A + errorX*psi[,d+1:p,drop=F]
#> Y <- phi%*%D + errorY*psi[,d+p+1:q,drop=F]
#> list(X=X,Y=Y)
#> }
#> <bytecode: 0x110f55f58>
where the output is a list of two matrices X and Y.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4