SPQR | R Documentation |
Main function of the package. Fits SPQR using the maximum likelihood estimation (MLE), maximum a posterior (MAP) or
Markov chain Monte Carlo (MCMC) method. Returns an object of S3 class SPQR
.
SPQR( 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, ... )
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 |
An object of class SPQR
. A list containing mostly internal model fitting
information to be used by helper functions.
Xu SG, Reich BJ (2021). Bayesian Nonparametric Quantile Process Regression and Estimation of Marginal Quantile Effects. Biometrics. doi: 10.1111/biom.13576
set.seed(919) n <- 200 X <- rbinom(n, 1, 0.5) Y <- rnorm(n, X, 0.8) control <- list(iter = 200, warmup = 150, thin = 1) fit <- SPQR(X = X, Y = Y, method = "MCMC", control = control, normalize = TRUE, verbose = FALSE) ## summarize output summary(fit) ## plot estimated PDF plotEstimator(fit, type = "PDF", X = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.