diff --git a/DESCRIPTION b/DESCRIPTION index 76ed4f1..b35c966 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: vinereg Type: Package Title: D-Vine Quantile Regression -Version: 0.9.0 +Version: 0.9.1 Authors@R: c( person("Thomas", "Nagler",, "mail@tnagler.com", role = c("aut", "cre")), person("Dani", "Kraus",,, role = c("ctb")) diff --git a/NEWS.md b/NEWS.md index de8d813..1184621 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,11 @@ -# vinereg 0.9.0 +# vinereg 0.9.1 + +BUG FIX + +* fix unnecessary error when calling `vinereg()` with weights. + + + # vinereg 0.9.0 NEW FEATURE diff --git a/docs/404.html b/docs/404.html index 298c358..174e89a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@
@@ -103,8 +103,7 @@Nagler T (2023). vinereg: D-Vine Quantile Regression. -R package version 0.9.0, https://tnagler.github.io/vinereg/. +R package version 0.9.1, https://tnagler.github.io/vinereg/.
@Manual{, title = {vinereg: D-Vine Quantile Regression}, author = {Thomas Nagler}, year = {2023}, - note = {R package version 0.9.0}, + note = {R package version 0.9.1}, url = {https://tnagler.github.io/vinereg/}, }@@ -101,8 +101,7 @@
An R package for D-vine copula based mean and quantile -regression.
+ +An R package for D-vine copula based mean and quantile regression.
See the package -website.
+See the package website.
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.
+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.
cll(object, newdata, cores = 1)
cll(object, newdata, cores = 1)
an object of class vinereg
.
matrix of response and covariate values for which to compute the conditional distribution.
integer; the number of cores to use for computations.
# \dontshow{
-set.seed(1)
-# }
-# simulate data
-x <- matrix(rnorm(500), 250, 2)
-y <- x %*% c(1, -2)
-dat <- data.frame(y = y, x = x, z = as.factor(rbinom(250, 2, 0.5)))
-
-# fit vine regression model
-fit <- vinereg(y ~ ., dat)
-
-cll(fit, dat)
+ # \dontshow{
+set.seed(1)
+# }
+# simulate data
+x <- matrix(rnorm(500), 250, 2)
+y <- x %*% c(1, -2)
+dat <- data.frame(y = y, x = x, z = as.factor(rbinom(250, 2, 0.5)))
+
+# fit vine regression model
+fit <- vinereg(y ~ ., dat)
+
+cll(fit, dat)
#> [1] 325.684
-fit$stats$cll
+fit$stats$cll
#> [1] 325.684
cpit(object, newdata, cores = 1)
cpit(object, newdata, cores = 1)
an object of class vinereg
.
matrix of response and covariate values for which to compute the conditional distribution.
integer; the number of cores to use for computations.
# \dontshow{
-set.seed(1)
-# }
-# simulate data
-x <- matrix(rnorm(500), 250, 2)
-y <- x %*% c(1, -2)
-dat <- data.frame(y = y, x = x, z = as.factor(rbinom(250, 2, 0.5)))
-
-# fit vine regression model
-fit <- vinereg(y ~ ., dat)
-
-hist(cpit(fit, dat)) # should be approximately uniform
+
plot_effects(object, alpha = c(0.1, 0.5, 0.9), vars = object$order)
plot_effects(object, alpha = c(0.1, 0.5, 0.9), vars = object$order)
a vinereg
object
vector of quantile levels.
vector of variable names.
# 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)
-plot_effects(fit)
-#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
+
an object of class vinereg
.
matrix of covariate values for which to predict the quantile.
vector of quantile levels; NA
predicts the mean based on an
average of the 1:10 / 11
-quantiles.
integer; the number of cores to use for computations.
unused.
A data.frame of quantiles where each column corresponds to one + + +
A data.frame of quantiles where each column corresponds to one
value of alpha
.
# 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))
+ # 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))
#> D-vine regression model: y | x.2, x.1
#> nobs = 100, edf = 2, cll = 12.48, caic = -20.95, cbic = -15.74
-
-# inspect model
-summary(fit)
+
+# inspect model
+summary(fit)
#> var edf cll caic cbic p_value
#> 1 y 0 -214.61264 429.2253 429.2253 NA
#> 2 x.2 1 68.82503 -135.6501 -133.0449 8.692058e-32
#> 3 x.1 1 158.26435 -314.5287 -311.9235 8.261084e-71
-plot_effects(fit)
-#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
+plot_effects(fit)
+#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
-
-# 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))
+
+# 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")))
+
+## fixed variable order (no selection)
+(fit <- vinereg(y ~ ., dat, order = c("x.2", "x.1", "z.1")))
#> D-vine regression model: y | x.2, x.1, z.1
#> nobs = 100, edf = 2, cll = 12.48, caic = -20.95, cbic = -15.74
@@ -145,8 +156,7 @@ Examples
an object of class "formula"; same as lm()
.
data frame (or object coercible by as.data.frame()
) containing
the variables in the model.
see family_set
argument of rvinecopulib::bicop()
.
selection criterion based on conditional log-likelihood.
"loglik"
(default) imposes no correction; other choices are
"aic"
and "bic"
.
the order of covariates in the D-vine, provided as vector of
variable names (after calling
vinereg:::expand_factors(model.frame(formula, data))
); selected
automatically if order = NA
(default).
list of options passed to kde1d::kde1d()
, must be one value
for each margin, e.g. list(xmin = c(0, 0, NaN))
if the response and first
covariate have non-negative support.
optional vector of weights for each observation.
integer; the number of cores to use for computations.
further arguments passed to rvinecopulib::bicop()
.
if TRUE, vinereg assumes that marginal distributions have been taken care of in a preliminary step.
An object of class vinereg. It is a list containing the elements
An object of class vinereg. It is a list containing the elements
the formula used for the fit.
indices of selected variables.
Use
-predict.vinereg()
to predict conditional quantiles. summary.vinereg()
shows the contribution of each selected variable with the associated
+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.
# 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))
+ # 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))
#> D-vine regression model: y | x.2, x.1
#> nobs = 100, edf = 2, cll = 17.47, caic = -30.94, cbic = -25.73
-
-# inspect model
-summary(fit)
+
+# inspect model
+summary(fit)
#> var edf cll caic cbic p_value
#> 1 y 0 -218.94275 437.8855 437.8855 NA
#> 2 x.2 1 73.02642 -144.0528 -141.4477 1.264121e-33
#> 3 x.1 1 163.38599 -324.7720 -322.1668 4.851392e-73
-plot_effects(fit)
-#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
+plot_effects(fit)
+#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
-
-# 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))
+
+# 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")))
+
+## fixed variable order (no selection)
+(fit <- vinereg(y ~ ., dat, order = c("x.2", "x.1", "z.1")))
#> D-vine regression model: y | x.2, x.1, z.1
#> nobs = 100, edf = 2, cll = 17.47, caic = -30.94, cbic = -25.73
@@ -212,8 +236,7 @@ Examples