D-Vine Quantile Regression

Implements D-vine quantile regression models with parametric or nonparametric pair-copulas. See Kraus and Czado (2017) and Schallhorn et al. (2017) .


Travis-CI Build Status AppVeyor Build Status Coverage status CRAN status

An R package for D-vine copula based mean and quantile regression.

How to install

  • the stable release from CRAN:

    install.packages("vinereg")
  • the latest development version:

    devtools::install_github("tnagler/vinereg", build_vignettes = TRUE)

Functionality

See the package website.

Example

set.seed(5)
library(vinereg)
data(mtcars)
 
# declare factors and discrete variables
for (var in c("cyl", "vs", "gear", "carb"))
    mtcars[[var]] <- as.ordered(mtcars[[var]])
mtcars[["am"]] <- as.factor(mtcars[["am"]])
 
# fit model
(fit <- vinereg(mpg ~ ., data = mtcars))
#> D-vine regression model: mpg | disp, hp, gear, carb, cyl, am.1, wt, vs, qsec, drat 
#> nobs = 32, edf = 95, cll = -56.09, caic = 302.19, cbic = 441.43
 
summary(fit)
#>     var     edf          cll       caic       cbic      p_value
#> 1   mpg 3.2e-11 -98.59271949 197.185439 197.185439           NA
#> 2  disp 2.0e+00  29.53428159 -55.068563 -52.137091 1.490817e-13
#> 3    hp 3.0e+00   2.33231128   1.335377   5.732585 1.980680e-01
#> 4  gear 5.0e+00   2.16379041   5.672419  13.001099 5.032784e-01
#> 5  carb 7.0e+00   2.25663902   9.486722  19.746873 7.191178e-01
#> 6   cyl 9.0e+00   1.57187334  14.856253  28.047876 9.583219e-01
#> 7  am.1 1.0e+01   1.75059329  16.498813  31.156172 9.670581e-01
#> 8    wt 1.3e+01   1.62623809  22.747524  41.802091 9.968597e-01
#> 9    vs 1.3e+01   0.52958111  24.940838  43.995405 9.999946e-01
#> 10 qsec 1.6e+01   0.70430954  30.591381  54.043155 9.999992e-01
#> 11 drat 1.7e+01   0.02886845  33.942263  58.859773 1.000000e+00
 
# show marginal effects for all selected variables
plot_effects(fit)
#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
 
# predict mean and median
head(predict(fit, mtcars, alpha = c(NA, 0.5)), 4)
#>       mean      0.5
#> 1 19.34836 19.36129
#> 2 19.17641 19.19810
#> 3 25.28064 25.13942
#> 4 19.70841 19.67779

Vignettes

For more examples, have a look at the vignettes with

vignette("abalone-example", package = "vinereg")
vignette("bike-rental", package = "vinereg")

References

Kraus and Czado (2017). D-vine copula based quantile regression. Computational Statistics & Data Analysis, 110, 1-18. link, preprint

Schallhorn, N., Kraus, D., Nagler, T., Czado, C. (2017). D-vine quantile regression with discrete variables. Working paper, preprint.

News

vinereg 0.5.0

DEPENDS

  • require rvinecopulib (>= 0.3.0) due to breaking changes in this package.

BUG FIXES

  • prevent nan errors in loglik calculation.

  • allow for empty and bivariate models.

  • properly pass degree parameter for margin al estimation.

vinereg 0.4.0

BUG FIXES

  • Fix handling of uscale in fitted.vinereg().

  • Fix handling of mult parameter for pair-copula fits in vinereg().

  • Fix orientation of asymmetric pair-copulas.

vinereg 0.3.0

DEPENDS

  • Use furrr and fututre packages instead of parallel, doParallel, and foreach for parallelization.

NEW FEATURES

  • New print() and summary() generics for vinereg objects.

  • New plot_effects() method to show the marginal effects of variables.

  • Allow to predict the mean with predict(object, alpha = NA).

vinereg 0.2.0

  • First official release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("vinereg")

0.5.0 by Thomas Nagler, a year ago


https://tnagler.github.io/vinereg


Report a bug at https://github.com/tnagler/vinereg/issues


Browse source code at https://github.com/cran/vinereg


Authors: Thomas Nagler [aut, cre] , Dani Kraus [ctb]


Documentation:   PDF Manual  


GPL-3 license


Imports cctools, rvinecopulib, future, furrr, kde1d

Suggests knitr, rmarkdown, ggplot2, PivotalR, quantreg, tidyr, dplyr, purrr, scales, mgcv, testthat, covr


See at CRAN