Description Usage Arguments Details Value Author(s) References Examples
This function can be used for simulations to evaluate the performance of linear model selection with independent predictors.
1 2 3 |
n |
sample size. |
p.all |
maximum model dimension, i.e., number of candidate predictors plus 1. |
p.true |
true model dimension, i.e., number of predictors with nonzero coefficients plus 1. |
R2 |
coefficient of determination for the true model. |
beta0 |
true model intercept; in some contexts this value may be arbitrary. |
yname |
name for the generated outcome vector. |
xname |
name for the generated model matrix. |
xy
simulates entries of a model matrix independently from the
standard normal distribution, then simulates outcomes whose mean is simply beta0
plus the sum of the first
p.true - 1
predictors. The errors are normal with mean 0 and
standard deviation chosen so as to attain the given R2
; see Tibshirani & Knight (1999), p. 538.
A list with components X
(model matrix, without intercept column) and y
(outcome vector).
Philip Reiss phil.reiss@nyumc.org and Lei Huang huangracer@gmail.com
Tibshirani, R., and Knight, K. (1999). The covariance inflation criterion for adaptive model selection. Journal of the Royal Statistical Society, Series B, 61, 529–546.
1 2 3 4 5 6 7 8 9 10 11 12 | # Generate 40 vectors of 8 candidate predictors, of which
# (the first) 2 have nonzero coefficients, along with 40 outcomes,
# with R^2=.8
tmp = xy(40, 9, 3, .8)
# As a side effect, the above created objects y5 and X59,
# equal to tmp$y and tmp$X respectively.
# The following lines can then be used to examine how different
# information criteria fare at identifying the true model as "best".
ic.min(y3, x39)
eic(y3, x39, nboot=100)
cvic(y3, x39)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.