R/nnig_sim.R

Defines functions nnig_sim

Documented in nnig_sim

## File Name: nnig_sim.R
## File Version: 0.20

nnig_sim <- function(N, coef)
{
    p <- coef$p
    X <- matrix(NA, nrow=N, ncol=p)
    for (ii in 1:p){
        X[,ii] <- fleishman_sim(N=N, coef=coef$fcoef[ii,] )
    }
    A <- coef$A
    Y <- matrix(0, nrow=N, ncol=p)
    colnames(Y) <- paste0("Y", 1:coef$p)
    for (ii in 1:p){
        for (hh in 1:p){
            Y[,ii] <- Y[,ii] + A[ii,hh] * X[,hh]
        }
    }
    #- output
    return(Y)
}

Try the miceadds package in your browser

Any scripts or data that you put into this service are public.

miceadds documentation built on Jan. 7, 2023, 1:09 a.m.