Skip to content

Commit

Permalink
Release 0.9.1 + 0.9.2 (#14)
Browse files Browse the repository at this point in the history
* fix unnecessary error when calling `vinereg()` with weights.

* bump version

* update README

* submitted

* preproc define to fix boost issue

* make discrete tests more lenient for now

* bump version

---------

Co-authored-by: tnagler <thomas.nagler@tum.de>
  • Loading branch information
tnagler and tnagler committed Jan 18, 2024
1 parent 5a45aca commit 44c3a09
Show file tree
Hide file tree
Showing 25 changed files with 235 additions and 187 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ LICENSE
^docs$
^\.github/workflows/R-CMD-check\.yaml$
.github
^CRAN-SUBMISSION$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: vinereg
Type: Package
Title: D-Vine Quantile Regression
Version: 0.9.0
Version: 0.9.2
Authors@R: c(
person("Thomas", "Nagler",, "mail@tnagler.com", role = c("aut", "cre")),
person("Dani", "Kraus",,, role = c("ctb"))
Expand Down
16 changes: 15 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# vinereg 0.9.2

BUG FIX

* add compiler flag to prevent boost/functional from using `unary_function`.


# vinereg 0.9.1

BUG FIX

* fix unnecessary error when calling `vinereg()` with weights.


# vinereg 0.9.0

NEW FEATURE
Expand Down Expand Up @@ -35,7 +49,7 @@ BUG FIXES

* prevent `rvinecopulib` from spawning own threads.

# NEW FEATURES
NEW FEATURES

* add `uscale` option to allow for external marginal modeling.

Expand Down
1 change: 1 addition & 0 deletions R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ finalize_margins <- function(margins, data) {
margins[[k]]$nobs <- nrow(data)
margins[[k]]$var_name <- names(margins)[k] <- colnames(data)[k]
}
margins[[1]]$loglik <- sum(log(kde1d::dkde1d(data[[1]], margins[[1]])))
margins
}

9 changes: 5 additions & 4 deletions R/vinereg.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ vinereg <- function(formula, data, family_set = "parametric", selcrit = "aic",
par_method = "mle",
nonpar_method = "quadratic",
mult = 1,
weights = weights,
psi0 = 0.9,
presel = TRUE,
keep_data = FALSE
Expand All @@ -120,6 +119,7 @@ vinereg <- function(formula, data, family_set = "parametric", selcrit = "aic",
bicop,
modifyList(arg, list(...))
)$controls
ctrl$weights <- numeric()

if (!all(is.na(order))) {
check_order(order, names(mfx))
Expand Down Expand Up @@ -148,12 +148,13 @@ vinereg <- function(formula, data, family_set = "parametric", selcrit = "aic",

# now we need the correct ordering in selected_vars
selected_vars <- sapply(order, function(x) which(x == names(mfx)))
args <- append(
args <- modifyList(
ctrl,
list(
data = u,
var_types = var_types,
cores = cores,
weights = weights,
structure = dvine_structure(rank(c(1, selected_vars)))
)
)
Expand All @@ -180,9 +181,9 @@ vinereg <- function(formula, data, family_set = "parametric", selcrit = "aic",
u <- as.matrix(mfx)
}

args <- append(
args <- modifyList(
ctrl,
list(data = u, var_types = var_types, cores = cores)
list(data = u, var_types = var_types, cores = cores, weights = weights)
)
fit <- do.call(select_dvine_cpp, args)
if (!uscale)
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(

# vinereg
[![R build status](https://github.com/tnagler/vinereg/workflows/R-CMD-check/badge.svg)](https://github.com/tnagler/vinereg)
[![Coverage status](https://codecov.io/gh/tnagler/vinereg/branch/master/graph/badge.svg)](https://codecov.io/github/tnagler/vinereg?branch=master)
<!-- [![Coverage status](https://codecov.io/gh/tnagler/vinereg/branch/main/graph/badge.svg)](https://app.codecov.io/github/tnagler/vinereg?branch=main) -->
[![CRAN status](https://www.r-pkg.org/badges/version/vinereg)](https://cran.r-project.org/package=vinereg)

An R package for D-vine copula based mean and quantile regression.
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

[![R build
status](https://github.com/tnagler/vinereg/workflows/R-CMD-check/badge.svg)](https://github.com/tnagler/vinereg)
[![Coverage
status](https://codecov.io/gh/tnagler/vinereg/branch/master/graph/badge.svg)](https://codecov.io/github/tnagler/vinereg?branch=master)
<!-- [![Coverage status](https://codecov.io/gh/tnagler/vinereg/branch/main/graph/badge.svg)](https://app.codecov.io/github/tnagler/vinereg?branch=main) -->
[![CRAN
status](https://www.r-pkg.org/badges/version/vinereg)](https://cran.r-project.org/package=vinereg)

Expand Down Expand Up @@ -39,30 +38,31 @@ See the [package website](https://tnagler.github.io/vinereg/).

# fit model
(fit <- vinereg(mpg ~ ., family = "nonpar", data = mtcars))
#> D-vine regression model: mpg | disp, qsec, hp
#> nobs = 32, edf = 24.35, cll = -56.11, caic = 160.93, cbic = 196.63
#> D-vine regression model: mpg | disp, qsec, hp, drat
#> nobs = 32, edf = 25.6, cll = -51.94, caic = 155.08, cbic = 192.61

summary(fit)
#> var edf cll caic cbic p_value
#> 1 mpg 0.000000 -100.189867 200.379733 200.3797334 NA
#> 2 disp 12.663078 29.654825 -33.983493 -15.4227648 5.284917e-08
#> 3 qsec 2.447922 4.326359 -3.756874 -0.1688666 2.101665e-02
#> 4 hp 9.242147 10.096325 -1.708356 11.8381898 1.898984e-02
#> var edf cll caic cbic p_value
#> 1 mpg 0.000000 -100.189867 200.379733 200.379733 NA
#> 2 disp 13.187762 29.521786 -32.668047 -13.338271 9.065782e-08
#> 3 qsec 2.272103 4.454079 -4.363952 -1.033648 1.559593e-02
#> 4 hp 7.178554 10.836467 -7.315826 3.206038 3.267907e-03
#> 5 drat 2.965553 3.441702 -0.952298 3.394419 7.382604e-02

# show marginal effects for all selected variables
plot_effects(fit)
#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

<img src="man/figures/README-unnamed-chunk-1-1.png" width="100%" />


# predict mean and median
head(predict(fit, mtcars, alpha = c(NA, 0.5)), 4)
#> mean 0.5
#> 1 22.39380 22.29866
#> 2 22.23677 22.08015
#> 3 25.33841 24.92450
#> 4 20.33708 20.16153
#> 1 22.58394 22.45433
#> 2 22.53425 22.41825
#> 3 25.10289 24.93384
#> 4 20.70358 20.80241

## Vignettes

Expand Down
2 changes: 0 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

## Results
* 0 errors, 0 warnings

There are no reverse dependencies.
5 changes: 2 additions & 3 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 8 additions & 21 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pandoc: 3.1.1
pkgdown: 2.0.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
abalone-example: abalone-example.html
bike-rental: bike-rental.html
last_built: 2023-06-26T13:47Z
last_built: 2023-10-18T15:06Z

Loading

0 comments on commit 44c3a09

Please sign in to comment.