comp_simulation: Simulation for composition data

Description Usage Arguments Details Examples

Description

Simulate compositional data.

Usage

1
2
3
comp_simulation(n, p, rho = 0.2, sigma = 0.5, gamma = 0.5, add.on = 1:5,
  beta = c(c(1, -0.8, 0.6, 0, 0, -1.5, -0.5, 1.2), rep(0, times = p - 8)),
  beta0 = 1, intercept = FALSE)

Arguments

n

sample size

p

size of compositional predictors falling in S^p

rho

a scaler used to generate p*p autocorrelation matrix

sigma

standard deviation for noise terms, which follows iid norm distribution with mean 0

gamma, add.on

To generate compsotional data, we first generate n*p matrix X from multivariate normal distribution and than transform it to compostional data. gamma is a scaler and add.on is a index vector. Assign log(p)*gamma to means of X for columns add.on , while others with 0's.

beta

coefficients for composition variables

beta0

coefficient for intercept

intercept

including intercept or not to generate response variable. Default value is FALSE

Details

The setup of this simulation follows Variable selection in regression with compositional covariates by WEI LIN, PIXU SHI, RUI FENG AND HONGZHE LI.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = 50
p = 30
rho = 0.2
sigma = 0.5
gamma = 0.5
add.on = 1:5
beta = c(1, -0.8, 0.6, 0, 0, -1.5, -0.5, 1.2)
beta = c( beta, rep(0, times = p - length(beta)) )
intercept = FALSE
Comp_data = comp_simulation(n = n, p = p, rho = rho, sigma = sigma, gamma  = gamma, add.on = add.on,
                            beta = beta, intercept = intercept)

jiji6454/Rpac_compReg documentation built on May 31, 2019, 5:01 a.m.