# NOT RUN {
library(rrpack)
n <- 100; p <- 500; q <- 50
xrank <- 10; nrank <- 3; rmax <- min(n, p, q, xrank)
nlam <- 100; gamma <- 2
rho_E <- 0.3
rho_X <- 0.5
nlev <- 0
vlev <- 0
vout <- NULL
vlevsd <- NULL
nout <- 0.1 * n
s2n <- 1
voutsd <- 2
simdata <- rrr.sim5(n, p, q, nrank, rx = xrank, s2n = s2n,
rho_X = rho_X, rho_E = rho_E, nout = nout, vout = vout,
voutsd = voutsd,nlev = nlev,vlev=vlev,vlevsd=vlevsd)
Y <- simdata$Y
X <- simdata$X
fit <- r4(Y, X, maxrank = rmax,
method = "rowl0", ic.type= "PIC")
summary(fit)
coef(fit)
which(apply(fit$s,1,function(a)sum(a^2))!=0)
# }
Run the code above in your browser using DataLab