Skip to content
D-vine quantile regression
R C++
Branch: master
Clone or download
Latest commit 6e507a3 Dec 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows submitted Dec 2, 2019
R fix quantiles for ordered response Nov 28, 2019
docs update badges in README Nov 28, 2019
inst/include last little bug Nov 12, 2019
man use nonpar in README Nov 28, 2019
src add boost flag Dec 2, 2019
tests fix random failure of unit tests Nov 28, 2019
vignettes update API docs Nov 28, 2019
.Rbuildignore .github -> .Rbuildignore Nov 27, 2019
.gitignore fix quantiles for ordered response Nov 28, 2019
DESCRIPTION LinkingTo wdm Nov 27, 2019
LICENSE Initial commit Feb 17, 2017
NAMESPACE adapt for new kde1d/rvinecopulib versions Nov 18, 2019
NEWS.md update NEWS Nov 27, 2019
README.Rmd use nonpar in README Nov 28, 2019
README.md use nonpar in README Nov 28, 2019
_pkgdown.yml update for new rvinecopulib version (#6) Aug 21, 2018
codecov.yml allow for fixed order + add unit tests (#5) May 28, 2018
cran-comments.md submitted Dec 2, 2019
vinereg.Rproj

README.md

vinereg

R 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:

    # install.packages("devtools")
    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 ~ ., family = "nonpar", data = mtcars))
#> D-vine regression model: mpg | wt, qsec, drat 
#> nobs = 32, edf = 19.33, cll = -56.94, caic = 152.55, cbic = 180.88

summary(fit)
#>    var       edf         cll       caic       cbic      p_value
#> 1  mpg  0.000000 -100.189867 200.379733 200.379733           NA
#> 2   wt 10.597257   29.409422 -37.624331 -22.091551 1.062440e-08
#> 3 qsec  5.739523    7.867765  -4.256484   4.156141 1.286392e-02
#> 4 drat  2.996463    5.973303  -5.953681  -1.561657 7.542848e-03

# 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 23.33594 22.56025
#> 2 22.30219 21.68133
#> 3 25.71678 25.58609
#> 4 20.21699 20.36290

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.

You can’t perform that action at this time.