vinereg | R Documentation |
Sequential estimation of a regression D-vine for the purpose of quantile prediction as described in Kraus and Czado (2017).
vinereg(
formula,
data,
family_set = "parametric",
selcrit = "aic",
order = NA,
par_1d = list(),
weights = numeric(),
cores = 1,
...,
uscale = FALSE
)
formula |
an object of class "formula"; same as |
data |
data frame (or object coercible by |
family_set |
see |
selcrit |
selection criterion based on conditional log-likelihood.
|
order |
the order of covariates in the D-vine, provided as vector of
variable names (after calling
|
par_1d |
list of options passed to |
weights |
optional vector of weights for each observation. |
cores |
integer; the number of cores to use for computations. |
... |
further arguments passed to |
uscale |
if TRUE, vinereg assumes that marginal distributions have been taken care of in a preliminary step. |
If discrete variables are declared as ordered()
or factor()
, they are
handled as described in Panagiotelis et al. (2012). This is different from
previous version where the data was jittered before fitting.
An object of class vinereg. It is a list containing the elements
the formula used for the fit.
criterion used for variable selection.
the data used to fit the regression model.
list of marginal models fitted by kde1d::kde1d()
.
an rvinecopulib::vinecop_dist()
object containing the fitted
D-vine.
fit statistics such as conditional log-likelihood/AIC/BIC and p-values for each variable's contribution.
order of the covariates chosen by the variable selection algorithm.
indices of selected variables.
Use
predict.vinereg()
to predict conditional quantiles. summary.vinereg()
shows the contribution of each selected variable with the associated
p-value derived from a likelihood ratio test.
Kraus and Czado (2017), D-vine copula based quantile regression, Computational Statistics and Data Analysis, 110, 1-18
Panagiotelis, A., Czado, C., & Joe, H. (2012). Pair copula constructions for multivariate discrete data. Journal of the American Statistical Association, 107(499), 1063-1072.
predict.vinereg
# simulate data
x <- matrix(rnorm(200), 100, 2)
y <- x %*% c(1, -2)
dat <- data.frame(y = y, x = x, z = as.factor(rbinom(100, 2, 0.5)))
# fit vine regression model
(fit <- vinereg(y ~ ., dat))
# inspect model
summary(fit)
plot_effects(fit)
# model predictions
mu_hat <- predict(fit, newdata = dat, alpha = NA) # mean
med_hat <- predict(fit, newdata = dat, alpha = 0.5) # median
# observed vs predicted
plot(cbind(y, mu_hat))
## fixed variable order (no selection)
(fit <- vinereg(y ~ ., dat, order = c("x.2", "x.1", "z.1")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.