Description Usage Arguments Value Author(s) See Also Examples
Given a "fosr.vs
" object, produces a figure of estimated coefficient functions.
1 2 | ## S3 method for class 'fosr.vs'
plot.fosr.vs(object, ...)
|
object |
an object of class " |
... |
additional arguments. |
a figure of estimated coefficient functions.
Yakuan Chen yc2641@cumc.columbia.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | I = 100
p = 20
D = 50
grid = seq(0, 1, length = D)
beta.true = matrix(0, p, D)
beta.true[1,] = sin(2*grid*pi)
beta.true[2,] = cos(2*grid*pi)
beta.true[3,] = 2
psi.true = matrix(NA, 2, D)
psi.true[1,] = sin(4*grid*pi)
psi.true[2,] = cos(4*grid*pi)
lambda = c(3,1)
set.seed(100)
X = matrix(rnorm(I*p), I, p)
C = cbind(rnorm(I, mean = 0, sd = lambda[1]), rnorm(I, mean = 0, sd = lambda[2]))
fixef = X%*%beta.true
pcaef = C %*% psi.true
error = matrix(rnorm(I*D), I, D)
Yi.true = fixef
Yi.pca = fixef + pcaef
Yi.obs = fixef + pcaef + error
data = as.data.frame(X)
data$Y = Yi.obs
fit.mcp = fosr.vs(Y~., data = data[1:80,], method="grMCP")
plot(fit.mcp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.