cv.SPQR | R Documentation |
Fits SPQR using either MLE or MAP method and computes K-fold cross-validation error based on pre-computed folds.
cv.SPQR( folds, X, Y, n.knots = 10, n.hidden = 10, activation = c("tanh", "relu", "sigmoid"), method = c("MLE", "MAP", "MCMC"), prior = c("ARD", "GP", "GSM"), hyperpar = list(), control = list(), normalize = FALSE, verbose = TRUE, seed = NULL, ... )
folds |
A list of CV folds, possibly that generated from |
X |
The covariate matrix (without intercept column) |
Y |
The response vector. |
n.knots |
The number of basis functions. Default: 10. |
n.hidden |
A vector specifying the number of hidden neurons in each hidden layer. Default: 10. |
activation |
The hidden layer activation. Either |
method |
Method for estimating SPQR. One of |
prior |
The prior model for variance hyperparameters. One of |
hyperpar |
A list of named hyper-prior hyperparameters to use instead of the default values, including
|
control |
A list of named and method-dependent parameters that allows finer control of the behavior of the computational approaches. 1. Parameters for MLE and MAP methods
2. Parameters for MCMC method These parameters are similar to those in
|
normalize |
If |
verbose |
If |
seed |
Random number generation seed. |
... |
other parameters to pass to |
control |
the list of all control parameters. |
cve |
the cross-validation error. |
folds |
the CV folds. |
createFolds.SPQR()
set.seed(919) n <- 200 X <- rbinom(n, 1, 0.5) Y <- rnorm(n, X, 0.8) folds <- createFolds.SPQR(Y, nfold = 5) ## compute 5-fold CV error cv.out <- cv.SPQR(folds=folds, X=X, Y=Y, method="MLE", normalize = TRUE, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.