Learn R Programming

l2boost (version 1.0.3)

mvnorm.l2boost: multivariate normal data simulations.

Description

Create simulated dataset from a multivariate normal. Used to recreate data simulations from Ehrlinger and Ishwaran (2012).

Usage

mvnorm.l2boost(n = 100, p = 100, beta = NULL, which.beta = NULL, rho = 0)

Arguments

n

number of observations

p

number of coordinate directions in the design matrix

beta

a "true" beta vector of length p (default=NULL) See details.

which.beta

indicator vector for which beta coefficients to include as signal in simulation (default=NULL) see details

rho

correlation coefficient between coordinate directions

Value

  • call Matched function call

  • x design matrix of size n x p

  • y response vector of length n

Details

By default, mvnorm.l2boost creates a data set of n multivariate normal random observations of p covariates (see MASS:mvrnorm). The correlation matrix is constructed with 1 on the diagonals and the correlation coefficient rho on the off diagonals.

The response is constructed as follows: If a true beta vector is not supplied, the first 10 beta coefficients carry the signal with a value of 5, and the remaining p-10 values are set to zero. Given a beta.true vector, all values are used as specified. The coefficent vector is truncated to have p signal terms if length(beta.true) > p, and noise coordinates are added if length(beta.true) < p.

It is possible to pass an indicator vector which.beta to select specific signal elements from the full vector beta.true.

References

Ehrlinger J., and Ishwaran H. (2012). "Characterizing l2boosting" Ann. Statist., 40 (2), 1074-1101

Examples

Run this code
# NOT RUN {
#--------------------------------------------------------------------------
# Example: Multivariate normal data simulation

# Create a (reproducable) data set of size 100 x 100
set.seed(1024)
n<- 100
p<- 100

# Set 10 signal variables using a uniform beta=5, the remaining (p-10)=90 are
# set to zero indicating random noise.  
beta <- c(rep(5,10), rep(0,p-10))

# Example with orthogonal design matrix columns (orthogonal + noise)
ortho.data <- mvnorm.l2boost(n, p, beta)
cbind(ortho.data$y[1:5],ortho.data$x[1:5,])

# Example with correlation between design matrix columns
corr.data <- mvnorm.l2boost(n, p, beta, rho=0.65)
cbind(corr.data$y[1:5],corr.data$x[1:5,])


# }

Run the code above in your browser using DataLab