Hansen: Generate data as in Hansen (2007)

Description Usage Arguments Value References Examples

Description

This function generates data as in Hansen (2007).

Usage

1
Hansen(alpha, n, r2, J, JJ = 1000, rho = 0, equi = FALSE, include.intercept = TRUE)

Arguments

alpha

Scalar determining the rate of decay.

n

The sample size.

r2

The population coefficient of determination.

J

The number of variables to observe.

JJ

The number of terms to use to approximate infinite sums.

rho

The correlation.

equi

Logical, if TRUE then the covariance matrix is an equicorrelation matrix with correlation coefficient rho. If FALSE, then the correlation is power decaying.

include.intercept

Logical, if TRUE then an intercept is included and there are J - 1 random variables.

Value

Returns a list with the following:

X

An n * J matrix containing the independent variables.

y

An n * 1 matrix containing the dependent variable.

mu

An n * 1 matrix containing the true conditional mean.

References

Hansen, Bruce (2007) Least Squares Model Averaging, Econometrica, 75(4):1175-1189.

Examples

1
2
## Generate data as in Hansen:
## Not run: data <- Hansen(alpha = 0.5, n = 50, r2 = 0.5, J = ceiling(3*50^(1/3)), JJ = 1000, rho = 0, equi = FALSE)

sebastianandersson/FMA documentation built on May 29, 2019, 4:57 p.m.