View source: R/predict.msgps.R
predict.msgps | R Documentation |
This functions predicts fitted values via msgps function.
## S3 method for class 'msgps' predict(object, X, tuning,...) ## S3 method for class 'msgps' coef(object, tuning,...)
object |
Fitted |
X |
Matrix of vector of new input |
tuning |
Tuning parameter vector |
... |
Other parameters |
The object returned depends on type.
Kei Hirose
mail@keihirose.com
#data X <- matrix(rnorm(100*8),100,8) beta0 <- c(3,1.5,0,0,2,0,0,0) epsilon <- rnorm(100,sd=3) y <- X %*% beta0 + epsilon y <- c(y) #fit fit <- msgps(X,y) coef(fit) #extract coefficients at t selected by model selection criteria coef(fit,c(0, 0.5, 2.5)) #extract coefficients at some values of t predict(fit,X[1:10,]) #predict values at t selected by model selection criteria predict(fit,X[1:10,],c(0, 0.5, 2.5)) #predict values at some values of t
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.