DGP: Data Generate Process

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

Generate the covariates and the response for generalized linear models in simulation.

Usage

1
DGP(n, p, alpha, norm = 0, no = NA, betanui = NULL, model = "gaussian")

Arguments

n

the sample size.

p

the dimension of the covariates.

alpha

the coefficients in moving average model

norm

the norm of coefficient vector under the alternative hypothesis (norm of β or β^{(2)}), the default is 0 (the null hypothesis).

no

the number of nonzero coefficients under the alternative hypothesis (do not account the number of nuisance parameter). The default is NA, which means the data are generated under the null hypothesis.

betanui

the vector which denotes the value of the nuisance coefficients. The default is NULL which means the global test.

model

a character string to describe the model. The default is "gaussian", which denotes the linear model. The other options are "poisson", "logistic" and "negative_binomial" models.

Value

An object of class "DGP" is a list containing the following components:

X

the design matrix with n rows and p columns, where n is the sample size and p is the dimension of the covariates.

Y

the response with length n

Note

The covariates X[i]=(X[i1],X[i2],...,X[ip]) are generated by the moving average model

X[ij]=α[1]Z[ij]+α[2]Z[i(j+1)]+...+α[T]Z[i(j+T-1)],

where Z[i]=(Z[i1],Z[i2],...,Z[i(p+T-1)]) were generated from the p+T-1 dimensional standard normal distribution

Author(s)

Bin Guo

References

Guo, B. and Chen, S. X. (2015). Tests for High Dimensional Generalized Linear Models.

See Also

HDGLM_test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
alpha=runif(5,min=0,max=1)
## Example 1: Linear model
## H_0:  \beta_0=0
DGP_0=DGP(80,320,alpha)

## Example 2: Logistic model
## H_0:  \beta_0=0
DGP_0=DGP(80,320,alpha,model="logistic")

## Example 3:  Linear model with the first five coefficients to be nonzero,
## the square of the norm of the coefficients to be 0.2
DGP_0=DGP(80,320,alpha,sqrt(0.2),5)

Example output



HDGLM documentation built on May 1, 2019, 10:19 p.m.

Related to DGP in HDGLM...