Giter Site home page Giter Site logo

tidyposterior's Introduction

tidyposterior

R-CMD-check Codecov test coverage CRAN_Status_Badge Downloads

This package can be used to conduct post hoc analyses of resampling results generated by models.

For example, if two models are evaluated with the root mean squared error (RMSE) using 10-fold cross-validation, there are 10 paired statistics. These can be used to make comparisons between models without involving a test set.

There is a rich literature on the analysis of model resampling results such as McLachlan’s Discriminant Analysis and Statistical Pattern Recognition and the references therein. This package follows the spirit of Benavoli et al (2017).

tidyposterior uses Bayesian generalized linear models for this purpose and can be considered an upgraded version of the caret::resamples() function. The package works with rsample objects natively but any results in a data frame can be used.

See Chapter 11 of Tidy Models with R for examples and more details.

Installation

You can install the released version of tidyposterior from CRAN with:

install.packages("tidyposterior")

And the development version from GitHub with:

# install.packages("pak")
pak::pak("tidymodels/tidyposterior")

Example

To illustrate, here are some example objects using 10-fold cross-validation for a simple two-class problem:

library(tidymodels)
#> ── Attaching packages ───────────────────────────────── tidymodels 1.0.0.9000 ──
#> ✔ broom        1.0.3          ✔ recipes      1.0.5.9000
#> ✔ dials        1.1.0.9000     ✔ rsample      1.1.1     
#> ✔ dplyr        1.1.0          ✔ tibble       3.1.8     
#> ✔ ggplot2      3.4.1          ✔ tidyr        1.3.0     
#> ✔ infer        1.0.4          ✔ tune         1.0.1.9003
#> ✔ modeldata    1.1.0.9000     ✔ workflows    1.1.3     
#> ✔ parsnip      1.0.4.9002     ✔ workflowsets 1.0.0     
#> ✔ purrr        1.0.1          ✔ yardstick    1.1.0.9000
#> ── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
#> ✖ purrr::discard() masks scales::discard()
#> ✖ dplyr::filter()  masks stats::filter()
#> ✖ dplyr::lag()     masks stats::lag()
#> ✖ recipes::step()  masks stats::step()
#> • Learn how to get started at https://www.tidymodels.org/start/
library(tidyposterior)

data(two_class_dat, package = "modeldata")

set.seed(100)
folds <- vfold_cv(two_class_dat)

We can define two different models (for simplicity, with no tuning parameters).

logistic_reg_glm_spec <-
  logistic_reg() %>%
  set_engine('glm')

mars_earth_spec <-
  mars(prod_degree = 1) %>%
  set_engine('earth') %>%
  set_mode('classification')

For tidymodels, the [tune::fit_resamples()] function can be used to estimate performance for each model/resample:

rs_ctrl <- control_resamples(save_workflow = TRUE)

logistic_reg_glm_res <- 
  logistic_reg_glm_spec %>% 
  fit_resamples(Class ~ ., resamples = folds, control = rs_ctrl)

mars_earth_res <- 
  mars_earth_spec %>% 
  fit_resamples(Class ~ ., resamples = folds, control = rs_ctrl)

From these, there are several ways to pass the results to the perf_mod() function. The most general approach is to have a data frame with the resampling labels (i.e., one or more id columns) as well as columns for each model that you would like to compare.

For the model results above, [tune::collect_metrics()] can be used along with some basic data manipulation steps:

logistic_roc <- 
  collect_metrics(logistic_reg_glm_res, summarize = FALSE) %>% 
  dplyr::filter(.metric == "roc_auc") %>% 
  dplyr::select(id, logistic = .estimate)

mars_roc <- 
  collect_metrics(mars_earth_res, summarize = FALSE) %>% 
  dplyr::filter(.metric == "roc_auc") %>% 
  dplyr::select(id, mars = .estimate)

resamples_df <- full_join(logistic_roc, mars_roc, by = "id")
resamples_df
#> # A tibble: 10 × 3
#>    id     logistic  mars
#>    <chr>     <dbl> <dbl>
#>  1 Fold01    0.856 0.845
#>  2 Fold02    0.933 0.951
#>  3 Fold03    0.934 0.937
#>  4 Fold04    0.864 0.858
#>  5 Fold05    0.847 0.854
#>  6 Fold06    0.911 0.840
#>  7 Fold07    0.867 0.858
#>  8 Fold08    0.886 0.876
#>  9 Fold09    0.898 0.898
#> 10 Fold10    0.906 0.894

We can then give this directly to perf_mod():

set.seed(101)
roc_model_via_df <- perf_mod(resamples_df, iter = 2000)
#> 
#> SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
#> Chain 1: 
#> Chain 1: Gradient evaluation took 4.3e-05 seconds
#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.43 seconds.
#> Chain 1: Adjust your expectations accordingly!
#> Chain 1: 
#> Chain 1: 
#> Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 1: 
#> Chain 1:  Elapsed Time: 0.379703 seconds (Warm-up)
#> Chain 1:                0.12234 seconds (Sampling)
#> Chain 1:                0.502043 seconds (Total)
#> Chain 1: 
#> 
#> SAMPLING FOR MODEL 'continuous' NOW (CHAIN 2).
#> Chain 2: 
#> Chain 2: Gradient evaluation took 9e-06 seconds
#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.09 seconds.
#> Chain 2: Adjust your expectations accordingly!
#> Chain 2: 
#> Chain 2: 
#> Chain 2: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 2: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 2: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 2: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 2: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 2: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 2: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 2: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 2: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 2: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 2: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 2: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 2: 
#> Chain 2:  Elapsed Time: 0.405567 seconds (Warm-up)
#> Chain 2:                0.179011 seconds (Sampling)
#> Chain 2:                0.584578 seconds (Total)
#> Chain 2: 
#> 
#> SAMPLING FOR MODEL 'continuous' NOW (CHAIN 3).
#> Chain 3: 
#> Chain 3: Gradient evaluation took 8e-06 seconds
#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.08 seconds.
#> Chain 3: Adjust your expectations accordingly!
#> Chain 3: 
#> Chain 3: 
#> Chain 3: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 3: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 3: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 3: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 3: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 3: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 3: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 3: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 3: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 3: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 3: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 3: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 3: 
#> Chain 3:  Elapsed Time: 0.366595 seconds (Warm-up)
#> Chain 3:                0.118549 seconds (Sampling)
#> Chain 3:                0.485144 seconds (Total)
#> Chain 3: 
#> 
#> SAMPLING FOR MODEL 'continuous' NOW (CHAIN 4).
#> Chain 4: 
#> Chain 4: Gradient evaluation took 9e-06 seconds
#> Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 0.09 seconds.
#> Chain 4: Adjust your expectations accordingly!
#> Chain 4: 
#> Chain 4: 
#> Chain 4: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 4: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 4: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 4: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 4: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 4: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 4: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 4: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 4: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 4: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 4: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 4: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 4: 
#> Chain 4:  Elapsed Time: 0.364 seconds (Warm-up)
#> Chain 4:                0.114266 seconds (Sampling)
#> Chain 4:                0.478266 seconds (Total)
#> Chain 4:

From this, the posterior distributions for each model can be obtained from the tidy() method:

roc_model_via_df %>% 
  tidy() %>% 
  ggplot(aes(x = posterior)) + 
  geom_histogram(bins = 40, col = "blue", fill = "blue", alpha = .4) + 
  facet_wrap(~ model, ncol = 1) + 
  xlab("Area Under the ROC Curve")

Faceted histogram chart. Area Under the ROC Curve along the x-axis, count along the y-axis. The two facets are logistic and mars. Both histogram looks fairly normally distributed, with a mean of 0.89 for logistic and 0.88 for mars. The full range is 0.84 to 0.93.

See contrast_models() for how to analyze these distributions

Contributing

This project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

tidyposterior's People

Contributors

aeklant avatar davisvaughan avatar emilhvitfeldt avatar ezequielpaura avatar hfrick avatar juliasilge avatar lawwu avatar mikemahoney218 avatar mone27 avatar topepo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tidyposterior's Issues

Error when installing tidyposterior from CRAN

< -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

The problem

ERROR: lazy loading failed for package ‘tidyposterior’

I'm having trouble with ...

Reproducible example

install.packages("tidyposterior")
Installing package into ‘/Users/kamaulindhardt_1/Library/R/3.6/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘rstanarm’

There are binary versions available but the
source versions are later:
binary source needs_compilation
rstanarm 2.19.2 2.21.1 TRUE
tidyposterior 0.0.3 0.1.0 FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) no
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/rstanarm_2.19.2.tgz'
Content type 'application/x-gzip' length 33305501 bytes (31.8 MB)

downloaded 31.8 MB

The downloaded binary packages are in
/var/folders/6p/c87kn7652k3bb9lw5j3c2rn00000gp/T//RtmpLkGtyy/downloaded_packages
installing the source package ‘tidyposterior’

trying URL 'https://cran.rstudio.com/src/contrib/tidyposterior_0.1.0.tar.gz'
Content type 'application/x-gzip' length 233442 bytes (227 KB)

downloaded 227 KB

  • installing source package ‘tidyposterior’ ...
    ** package ‘tidyposterior’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    namespace ‘rstanarm’ 2.19.2 is being loaded, but >= 2.21.1 is required
    Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package ‘tidyposterior’
  • removing ‘/Users/kamaulindhardt_1/Library/R/3.6/library/tidyposterior’
    Warning in install.packages :
    installation of package ‘tidyposterior’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/6p/c87kn7652k3bb9lw5j3c2rn00000gp/T/RtmpLkGtyy/downloaded_packages’

Name clarity

Just ran into tidybayes and realized that many people first learning about tidyposterior will probably expect it to be about tidying posterior MCMC samples for Stan, etc.

May be worthwhile to consider a name that emphasizes model assessment or predictive performance more heavily.

error on install

Im trying to install tidyposterior, without succes.

Im on a Linux Lubuntu 18.04 LTS.

The console shows the following message. I've already installed rstan with dependensies.

> install.packages('tidyposterior', dependencies = TRUE) Installing package into ‘/home/olesendan/R/x86_64-pc-linux-gnu-library/3.5’ (as ‘lib’ is unspecified) 

trying URL 'https://cloud.r-project.org/src/contrib/tidyposterior_0.0.1.tar.gz' Content type 'application/x-gzip' length 2293594 bytes (2.2 MB) 
================================================== 
downloaded 2.2 MB  
* installing *source* package ‘tidyposterior’ ... 
** package ‘tidyposterior’ successfully unpacked and MD5 sums checked 
** R 
** data 
*** moving datasets to lazyload DB 
** inst 
** byte-compile and prepare package for lazy loading 
Warning: S3 methods ‘VarCorr.stanreg’, ‘as.array.stanreg’, ‘as.data.frame.stanreg’, ‘as.data.frame.summary.stanreg’, ‘as.matrix.stanreg’, ‘bayes_R2.stanreg’, ‘coef.stanmvreg’, ‘coef.stanreg’, ‘confint.stanreg’, ‘family.stanmvreg’, ‘family.stanreg’, ‘fitted.stanmvreg’, ‘fitted.stanreg’, ‘fixef.stanmvreg’, ‘fixef.stanreg’, ‘formula.stanmvreg’, ‘formula.stanreg’, ‘get_x.default’, ‘get_x.gamm4’, ‘get_x.lmerMod’, ‘get_x.stanmvreg���, ‘get_y.default’, ‘get_y.stanmvreg’, ‘get_z.lmerMod’, ‘get_z.stanmvreg’, ‘launch_shinystan.stanreg’, ‘log_lik.stanjm’, ‘log_lik.stanmvreg’, ‘log_lik.stanreg’, ‘loo.stanreg’, ‘loo_linpred.stanreg’, ‘loo_model_weights.stanreg_list’, ‘loo_predict.stanreg’, ‘loo_predictive_interval.stanreg’, ‘model.frame.stanmvreg’, ‘model.frame.stanreg’, ‘model.matrix.stanreg’, ‘names.stanreg_list’, ‘ngrps.stanmvreg’, ‘ngrps.stanreg’,  [... truncated] Error in library.dynam(lib, package, package.lib) :    shared object ‘rstanarm.so’ not found ERROR: lazy loading failed for package ‘tidyposterior’ 
* removing ‘/home/olesendan/R/x86_64-pc-linux-gnu-library/3.5/tidyposterior’ 
Warning in install.packages :   installation of package ‘tidyposterior’ had non-zero exit status  
The downloaded source packages are in 	‘/tmp/Rtmp75c4ES/downloaded_packages’

Have others experienced this?

Greetings from Denmark
Dan Olesen

Replace uses of `posterior_linpred`

When the function rstanarm::posterior_linpred() is used for prediction, users see this message:

Instead of posterior_linpred(..., transform=TRUE) please call posterior_epred(), which provides equivalent functionality.

Looks like it's time to replace the uses of this function.

Related to tidymodels/TMwR#43

Release tidyposterior 0.0.3

Prepare for release:

  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Polish NEWS
  • Review pkgdown reference index for, e.g., missing topics

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Explicitly document / LaTeX up the form of tidyposterior models

Re: our conversation earlier this week about a lot of people not realizing that tidyposterior just estimates a standard ANOVA / mixed-model with Stan, I think it would be good to explicitly write out the mathemetical form of the model that tidyposterior fits in a visible location.

tidyr field in DESCRIPTION needs updating

I tried running the example

I.E.

library(tidyposterior)
# See ? precise_example
data(precise_example)

# Get classification accuracy results for analysis

library(dplyr)
accuracy <- precise_example %>%
   select(id, contains("Accuracy")) %>%
   setNames(tolower(gsub("_Accuracy$", "", names(.)))) 
accuracy

# Model the accuracy results
acc_model <- perf_mod(accuracy, seed = 13311, verbose = FALSE 

Got the following error:

Error in mutate_impl(.data, dots) : 
  Evaluation error: object 'statistic' not found.

I was able to trace the error to the version of tidyr, so here are my findings:

  • tidyr 0.6.2 - Doesn't work
  • tidyr >= 0.7.1- Works

Not sure if 0.7.1 is the minimal version (0.7.0 would be my guess), but I think the DESCRIPTION file needs to be updated.

metric_sets

yardstick will return multiple metrics in a stacked format. We should have an option to use this format directly.

library(tidymodels)
#> ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────── tidymodels 0.0.2 ──
#> ✔ broom     0.5.1       ✔ purrr     0.3.2  
#> ✔ dials     0.0.2       ✔ recipes   0.1.5  
#> ✔ dplyr     0.8.0.1     ✔ rsample   0.0.4  
#> ✔ ggplot2   3.1.1       ✔ tibble    2.1.1  
#> ✔ infer     0.4.0       ✔ yardstick 0.0.2  
#> ✔ parsnip   0.0.2
#> ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ──
#> ✖ purrr::discard() masks scales::discard()
#> ✖ dplyr::filter()  masks stats::filter()
#> ✖ dplyr::lag()     masks stats::lag()
#> ✖ recipes::step()  masks stats::step()

# Multiple regression metrics
multi_metric <- metric_set(rmse, rsq, ccc)

# The returned function has arguments:
# fn(data, truth, estimate, na_rm = TRUE, ...)
multi_metric(solubility_test, truth = solubility, estimate = prediction)
#> # A tibble: 3 x 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 rmse    standard       0.722
#> 2 rsq     standard       0.879
#> 3 ccc     standard       0.934

Created on 2019-05-18 by the reprex package (v0.2.1)

Tidymodels installation is failing on Linux platform

Hi
I am unable to install the tidymodels R package due to the following errors. Can you please help me understand whats going on?

> install.packages('tidymodels')

g++: error: unrecognized command line option ‘-03’
make: *** [stan_files/lm.o] Error 1

ERROR: compilation failed for package ‘rstanarm’
Warning in install.packages :
installation of package ‘rstanarm’ had non-zero exit status

ERROR: dependency ‘rstanarm’ is not available for package ‘tidyposterior’
Warning in install.packages :
installation of package ‘tidyposterior’ had non-zero exit status

ERROR: dependency ‘tidyposterior’ is not available for package ‘tidymodels’
Warning in install.packages :
installation of package ‘tidyposterior’ had non-zero exit status

Session Info:

`> sessionInfo()`
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8    LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] recipes_0.1.12    workflows_0.1.1   infer_0.5.1       scales_1.0.0      rsample_0.0.7     broom_0.5.6      
 [7] parsnip_0.1.1     yardstick_0.0.6   ggeasy_0.1.2      rio_0.5.16        janitor_2.0.1     patchwork_1.0.0  
[13] reticulate_1.16   furrr_0.1.0       future_1.17.0     e1071_1.7-3       lubridate_1.7.9   pander_0.6.3     
[19] data.table_1.12.8 forcats_0.4.0     stringr_1.4.0     dplyr_1.0.0       purrr_0.3.4       readr_1.3.1      
[25] tidyr_1.0.0       tibble_3.0.1      ggplot2_3.2.1     tidyverse_1.3.0   foreach_1.4.7     ROracle_1.3-1    
[31] DBI_1.0.0        

loaded via a namespace (and not attached):
 [1] nlme_3.1-139       fs_1.3.1           doParallel_1.0.15  DiceDesign_1.8-1   httr_1.4.1         tools_3.6.0       
 [7] backports_1.1.5    R6_2.4.1           rpart_4.1-15       lazyeval_0.2.2     colorspace_1.4-1   nnet_7.3-12       
[13] withr_2.1.2        tidyselect_1.1.0   curl_4.2           compiler_3.6.0     cli_2.0.2          rvest_0.3.5       
[19] xml2_1.2.2         digest_0.6.25      foreign_0.8-71     pkgconfig_2.0.3    lhs_1.0.2          dbplyr_1.4.4      
[25] rlang_0.4.6        readxl_1.3.1       rstudioapi_0.11    generics_0.0.2     jsonlite_1.6.1     zip_2.0.4         
[31] magrittr_1.5       Matrix_1.2-17      Rcpp_1.0.4.6       munsell_0.5.0      fansi_0.4.0        GPfit_1.0-8       
[37] lifecycle_0.2.0    stringi_1.4.3      pROC_1.16.2        snakecase_0.11.0   MASS_7.3-51.4      plyr_1.8.4        
[43] grid_3.6.0         blob_1.2.0         parallel_3.6.0     listenv_0.8.0      crayon_1.3.4       lattice_0.20-38   
[49] splines_3.6.0      haven_2.3.1        hms_0.5.3          pillar_1.4.4       codetools_0.2-16   reprex_0.3.0      
[55] glue_1.4.1         packrat_0.5.0      modelr_0.1.8       vctrs_0.3.1        cellranger_1.1.0   gtable_0.3.0      
[61] assertthat_0.2.1   gower_0.2.1        openxlsx_4.1.5     prodlim_2019.11.13 survival_2.44-1.1  class_7.3-15      
[67] timeDate_3043.102  iterators_1.0.12   hardhat_0.1.3      lava_1.6.7         globals_0.12.5     ellipsis_0.3.1    
[73] ipred_0.9-9       

0.0.2 checklist

Prepare for release:

  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Polish NEWS
  • If new failures, update email.yml then revdepcheck::revdep_email_maintainers()

Perform release:

  • Create RC branch (for bigger releases)
  • Bump version (in DESCRIPTION and NEWS)
  • devtools::check_win_devel() (again!)
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Tag release
  • Merge RC back to master branch
  • pkgdown::build_site()
  • Bump dev version
  • Write blog post Deferred for a tidymodels general update.

Template from r-lib/usethis#338

Release tidyposterior 1.0.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::cloud_check()
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post
  • Ping Tracy Teal on Slack

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Invalid stanfit object produced please report bug

Hello,

I tried tidyposterior and running the example provided here:

https://topepo.github.io/tidyposterior/index.html?utm_content=buffer290c0&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

I got the following:

acc_model <- perf_mod(accuracy, seed = 13311, verbose = FALSE)

Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) : 
  c++ exception (unknown reason)
trying deprecated constructor; please alert package maintainer

SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).

Gradient evaluation took 0.000388 seconds
1000 transitions using 10 leapfrog steps per transition would take 3.88 seconds.
Adjust your expectations accordingly!


Iteration:    1 / 2000 [  0%]  (Warmup)
[1] "Error in sampler$call_sampler(args_list[[i]]) : " "  c++ exception (unknown reason)"                
error occurred during calling the sampler; sampling not done
Error in check_stanfit(stanfit) : 
  Invalid stanfit object produced please report bug```



Best wishes,
Dimitris

How to interpret perf_mod and contrast_models results?

I was just wondering if it's possible to interpret the results from the perf_mod and contrast_models functions using 95% posterior intervals.

Also, I'm not sure if the posterior distribution should (in general) cover the different samples obtained from the rsample package. For example, running some code for comparison of different Cox models (for survival analysis), I obtained the plot below. The different concordance indexes for 50 resamples of Monte Carlo cross-validation are shown in blue, and the lines in black corresponds to the posterior distribution after running perf_mod. What intrigues me is that the distribution seems too narrow with respect to the spread of the different resamples.

screen shot 2018-01-02 at 19 24 50

Sorry for asking this, it's the first time I use the stan R package, and trying to adopt a more Bayesian approach (and mentality) rather than the typical p-values.

Models failing in tune_grid() while tuning xgboost hyperparameters using R Tidymodels

Hi,
I am not sure where I am going wrong. When I run the following all models within the tuning grid are failing. I get this warning message: 'All models failed in tune_grid()'. Any help will be very much appreciated. @topepo ?

Warning message:
All models failed in tune_grid(). See the `.notes` column. 
> Sys.time() - s
Time difference of 27.69011 secs
> xgb_res
#  5-fold cross-validation 
# A tibble: 5 x 5
  splits             id    .metrics .notes            .predictions
  <list>             <chr> <list>   <list>            <list>      
1 <split [1.9K/480]> Fold1 <NULL>   <tibble [20 × 1]> <NULL>      
2 <split [1.9K/480]> Fold2 <NULL>   <tibble [20 × 1]> <NULL>      
3 <split [1.9K/480]> Fold3 <NULL>   <tibble [20 × 1]> <NULL>      
4 <split [1.9K/480]> Fold4 <NULL>   <tibble [20 × 1]> <NULL>      
5 <split [1.9K/479]> Fold5 <NULL>   <tibble [20 × 1]> <NULL> 

# PREPROCESSING -- RECIPE ---------------------------------------------------------------------

library(recipes)

xgb_recipe <- recipe(EVENT ~ ., data = train_data) %>% # define target & data
  #step_string2factor(all_nominal()) %>%          
  #step_dummy(all_predictors()) %>%               
  recipes::step_other(all_nominal(), threshold = 0.01) %>%  
  recipes::step_nzv(all_nominal()) %>%    
  #step_downsample(EVENT) %>%                             
  prep()
> xgb_recipe

> Data Recipe
> 
> Inputs:
> 
> role #variables outcome 1 predictor 272
> 
> Training data contained 2427 data points and no missing data.
> 
> Operations:
> 
> Collapsing factor levels for PROGRAM_TYPE_CODE, PREFERENCE_NUMBER, ... [trained] Sparse, unbalanced variable filter removed PRIOR_PGRD_PRG_YR, PRIOR_TF_SC_PRG_YR, ETHNIC_GROUP_DESC, HASEMAIL, ... [trained]

# XGB SPEC ------------------------------------------------------------------------------------


xgb_spec <- boost_tree(
  trees = 600,                                 ## nround=6000
  tree_depth = tune(), min_n = tune(),         ## max_depth = 6
  loss_reduction = tune(),                     ## first three: model complexity
  sample_size = tune(), mtry = tune(),         ## randomness
  learn_rate = tune(),                          ## step size,
  #num_class=4,
  #objective = 'multi:softprob' #%>%
  #nthreads=20 %>%
  #print_every_n = 300
  ) %>% 
  set_engine("xgboost") %>% 
  set_mode("classification")


xgb_spec

# GRID ----------------------------------------------------------------------------------------

xgb_grid <- grid_latin_hypercube(
  tree_depth(),
  min_n(),
  loss_reduction(),
  sample_size = sample_prop(),
  finalize(mtry(), train_data),
  learn_rate(),
  size = 20
  )

> xgb_grid
> A tibble: 20 x 6 tree_depth min_n loss_reduction sample_size mtry learn_rate 1 4 15 1.71e- 6 0.256 110 2.14e- 9 2 7
> 29 4.08e- 8 0.836 97 2.07e-10 3 10 26
> 6.44e- 7 0.883 66 7.59e- 8 4 8 28 9.77e- 1 0.964 270 3.90e- 8 5 1 19 4.27e- 4
> 0.733 208 8.00e- 4 6 3 5 1.61e+ 1 0.392 220 4.04e-10 7 5 9 1.48e- 9 0.673 163
> 1.63e- 7 8 11 34 4.20e- 5 0.569 178 1.69e- 8 9 12 38 7.80e+ 0 0.143 79 8.67e- 7 10
> 4 12 5.58e- 9 0.946 173 1.17e- 2 11 14
> 2 1.30e- 4 0.805 202 1.10e- 4 12 15 21
> 9.15e- 3 0.454 134 3.82e- 3 13 9 21 4.99e- 6 0.500 10 2.91e- 9 14 7 17 7.60e-10
> 0.232 248 1.57e- 6 15 12 11 4.85e- 1 0.297 21 1.23e- 5 16 7 35 7.63e- 8 0.516 95
> 9.60e- 2 17 2 6 1.01e- 1 0.353 48 3.57e- 6 18 10 23 2.57e-10 0.161 33 1.46e- 2 19
> 13 40 2.00e- 3 0.715 150 3.44e- 5 20 5
> 32 1.25e- 2 0.610 234 4.95e- 4
> 


# WORKFLOW ------------------------------------------------------------------------------------

xgb_wf <- workflow() %>%
  add_recipe(xgb_recipe) %>%
  add_model(xgb_spec)

xgb_wf


> ══ Workflow ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ Preprocessor: Recipe Model: boost_tree()
> 
> ── Preprocessor ─────────────────────────────────────────────────────────────────────────────────────────────────────────── 2 Recipe Steps
> 
> ● step_other() ● step_nzv()
> 
> ── Model ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Boosted Tree Model Specification (classification)
> 
> Main Arguments: mtry = tune() trees = 600 min_n = tune()
> tree_depth = tune() learn_rate = tune() loss_reduction = tune()
> sample_size = tune()
> 
> Computational engine: xgboost

# CROSS-VALIDATION Resamples  -----------------------------------------------------------------
set.seed(123)
xgb_cv_folds <-
  recipes::bake(                       #bake() takes a trained recipe and applies the operations
    xgb_recipe,                        #to a data set to create a design matrix.
    new_data = train_data
  ) %>%
  rsample::vfold_cv(v = 5)

xgb_cv_folds

# TUNING --------------------------------------------------------------------------------------

all_cores <- parallel::detectCores(logical = FALSE)
library(doParallel)
cl <- makePSOCKcluster(all_cores)
registerDoParallel(cl)


s <- Sys.time()
set.seed(2020)
xgb_res <- tune_grid(
  xgb_wf,
  resamples = cv_folds,
  grid = xgb_grid,
  control = control_grid(save_pred = TRUE,
                         verbose = TRUE)
  )
Sys.time() - s


> Warning message: All models failed in tune_grid(). See the .notes column.


> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8    LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] tidymodels_0.1.0.9000 knitr_1.25            ROCit_1.1.1           DiagrammeR_1.0.6.1    doParallel_1.0.15    
 [6] xgboost_0.90.0.2      doMC_1.3.6            iterators_1.0.12      glmnet_4.0            Matrix_1.2-17        
[11] kernlab_0.9-29        tune_0.1.0            dials_0.0.7           recipes_0.1.12        workflows_0.1.1      
[16] infer_0.5.1           scales_1.0.0          rsample_0.0.7         broom_0.5.6           parsnip_0.1.1        
[21] yardstick_0.0.6       ggeasy_0.1.2          rio_0.5.16            janitor_2.0.1         patchwork_1.0.0      
[26] reticulate_1.16       furrr_0.1.0           future_1.17.0         e1071_1.7-3           lubridate_1.7.9      
[31] pander_0.6.3          data.table_1.12.8     forcats_0.4.0         stringr_1.4.0         dplyr_1.0.0          
[36] purrr_0.3.4           readr_1.3.1           tidyr_1.0.0           tibble_3.0.1          ggplot2_3.2.1        
[41] tidyverse_1.3.0       foreach_1.4.7         ROracle_1.3-1         DBI_1.0.0            

loaded via a namespace (and not attached):
 [1] readxl_1.3.1       backports_1.1.5    tidytext_0.2.4     plyr_1.8.4         lazyeval_0.2.2    
 [6] splines_3.6.0      listenv_0.8.0      SnowballC_0.7.0    digest_0.6.25      htmltools_0.4.0   
[11] fansi_0.4.0        magrittr_1.5       openxlsx_4.1.5     remotes_2.1.1      globals_0.12.5    
[16] modelr_0.1.8       gower_0.2.1        hardhat_0.1.3      prettyunits_1.1.1  colorspace_1.4-1  
[21] blob_1.2.0         rvest_0.3.5        haven_2.3.1        xfun_0.10          callr_3.4.3       
[26] crayon_1.3.4       jsonlite_1.6.1     survival_2.44-1.1  glue_1.4.1         gtable_0.3.0      
[31] ipred_0.9-9        pkgbuild_1.0.8     shape_1.4.4        Rcpp_1.0.4.6       GPfit_1.0-8       
[36] foreign_0.8-71     lava_1.6.7         prodlim_2019.11.13 htmlwidgets_1.5.1  httr_1.4.1        
[41] RColorBrewer_1.1-2 ellipsis_0.3.1     pkgconfig_2.0.3    nnet_7.3-12        dbplyr_1.4.4      
[46] utf8_1.1.4         tidyselect_1.1.0   labeling_0.3       rlang_0.4.6        DiceDesign_1.8-1  
[51] munsell_0.5.0      cellranger_1.1.0   tools_3.6.0        visNetwork_2.0.9   cli_2.0.2         
[56] generics_0.0.2     evaluate_0.14      processx_3.4.2     fs_1.3.1           zip_2.0.4         
[61] packrat_0.5.0      nlme_3.1-139       xml2_1.2.2         tokenizers_0.2.1   compiler_3.6.0    
[66] rstudioapi_0.11    curl_4.2           reprex_0.3.0       lhs_1.0.2          stringi_1.4.3     
[71] highr_0.8          ps_1.3.3           lattice_0.20-38    vctrs_0.3.1        pillar_1.4.4      
[76] lifecycle_0.2.0    R6_2.4.1           janeaustenr_0.1.5  codetools_0.2-16   MASS_7.3-51.4     
[81] assertthat_0.2.1   rprojroot_1.3-2    withr_2.1.2        hms_0.5.3          grid_3.6.0        
[86] rpart_4.1-15       timeDate_3043.102  class_7.3-15       snakecase_0.11.0   pROC_1.16.2       
[91] tidypredict_0.4.5 

Move `master` branch to `main`

The master branch of this repository will soon be renamed to main, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.

That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master --> main change.

The purpose of this issue is to:

  • Help us firm up the list of targetted repositories
  • Make sure all maintainers are aware of what's coming
  • Give us an issue to close when the job is done
  • Give us a place to put advice for collaborators re: how to adapt

message id: euphoric_snowdog

more specific classes for `Bayes_resample`

based on the rset type:

  • default for vfold (no repeats), mc_cv, bootstraps, group_vfold, and ordinary data frames
  • AR(1) for rolling_origin
  • nested effects for repeated vfold

Isn't it a problem that parameters estimation is executed without notification that it is unidentifiable?

Isn't it a problem that parameters estimation is executed without notification that it is unidentifiable?

I was curious about what perf_mod was running and read the code and tidymodels reference.

As a result, I understood that rstanarm::stan_glmer was running behind the scenes.
And I understand that stan_glmer is a combination of lme4's glmer and lmer with stan.

I wanted to see how the results would change when I changed the hetero_var without using stan.
When I tried to run the same thing as perf_mod with glmer and lmer
When hetero_var=T, it was stopped by an error code and could not be executed.

However, perf_mod can do it.
We can check for errors after execution, but do we need to stop the user before execution?
I would like to ask if it is necessary to give the user a chance to notice before execution.

Example:

library(tidymodels)
library(tidyposterior)

data(two_class_dat, package = "modeldata")

set.seed(100)
folds <- vfold_cv(two_class_dat,v=25)

logistic_reg_glm_spec <-
  logistic_reg() %>%
  set_engine('glm')

mars_earth_spec <-
  mars(prod_degree = 1) %>%
  set_engine('earth') %>%
  set_mode('classification')

rs_ctrl <- control_resamples(save_workflow = TRUE)
logistic_reg_glm_res <- 
  logistic_reg_glm_spec %>% 
  fit_resamples(Class ~ ., resamples = folds, control = rs_ctrl)

mars_earth_res <- 
  mars_earth_spec %>% 
  fit_resamples(Class ~ ., resamples = folds, control = rs_ctrl)

logistic_roc <- 
  collect_metrics(logistic_reg_glm_res, summarize = FALSE) %>% 
  dplyr::filter(.metric == "roc_auc") %>% 
  dplyr::select(id, logistic = .estimate)

mars_roc <- 
  collect_metrics(mars_earth_res, summarize = FALSE) %>% 
  dplyr::filter(.metric == "roc_auc") %>% 
  dplyr::select(id, mars = .estimate)

resamples_df <- full_join(logistic_roc, mars_roc, by = "id")

if user perf_mod:

perf_mod(hetero_var=T,resamples_df)
perf_mod(hetero_var=F,resamples_df)

if I set hetero_var=T, I get an error, but it gets executed.

Warning messages:
1: There were 28 divergent transitions after warmup. See
http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them. 
2: Examine the pairs() plot to diagnose sampling problems
 
3: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#bulk-ess 
4: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#tail-ess 

In lme4, it stops before executing.

library(lme4)
resamples_df_stan_off <- pivot_longer(resamples_df,
                     cols = c(-dplyr::matches("(^id$)|(^id[0-9])")),
                     names_to = "model",
                     values_to = "statistic")

hetero_F <- statistic ~  model + (1 | id)
hetero_T <- statistic ~  model + (model + 0 | id)

glmer(formula = hetero_T,data=resamples_df_stan_off)
lmer(formula = hetero_T,data=resamples_df_stan_off)
Error: ... ; the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable

If there is no risk in the implementation of perf_mod, there is no problem.
In that case, I'd like to ask why we don't need to stop as an interest.

Upkeep for tidyposterior

Pre-history

  • usethis::use_readme_rmd()
  • usethis::use_roxygen_md()
  • usethis::use_github_links()
  • usethis::use_pkgdown_github_pages()
  • usethis::use_tidy_github_labels()
  • usethis::use_tidy_style()
  • usethis::use_tidy_description()
  • urlchecker::url_check()

2020

  • usethis::use_package_doc()
    Consider letting usethis manage your @importFrom directives here.
    usethis::use_import_from() is handy for this.
  • usethis::use_testthat(3) and upgrade to 3e, testthat 3e vignette
  • Align the names of R/ files and test/ files for workflow happiness.
    usethis::rename_files() can be helpful.

2021

  • usethis::use_tidy_dependencies()
  • usethis::use_tidy_github_actions() and update artisanal actions to use setup-r-dependencies
  • Remove check environments section from cran-comments.md
  • Bump required R version in DESCRIPTION to 3.4
  • Use lifecycle instead of artisanal deprecation messages, as described in Communicate lifecycle changes in your functions
  • Add RStudio to DESCRIPTION as funder, if appropriate

2022

  • usethis::use_tidy_coc()
  • Update errors to rlang 1.0.0
  • Update pkgdown site using instructions at https://tidytemplate.tidyverse.org
  • Re-publish released site using r-lib/pkgdown#2051
  • Ensure pkgdown development is mode: auto in pkgdown config
  • Handle and close any still-open master --> main issues
  • Update README badges, instructions in r-lib/usethis#1594

Feature Request: Crossed random effects for multilevel data

In tidymodels/TMwR#288, I suggested adding the feature of having {tidyposterior} detect multilevel data (e.g., from rsample::group_vfold_cv()) and add random effects for the grouping/cluster variable to the model comparison analysis. This would usually be a cross-classified model with random effects (e.g., intercepts) for both resample and group. Accounting for this extra level of dependency in the data is important to properly estimating uncertainty.

I will work on posting some example code below (but am running low on time today).

Release tidyposterior 0.1.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

An error with installing rstanarm pckage

I got the following error with downloading the rstanarm packages

Error: package or namespace load failed for ‘rstanarm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘Matrix’ 1.2-11 is already loaded, but >= 1.2.13 is required
In addition: Warning message:
package ‘rstanarm’ was built under R version 3.4.4

How to solve this?
Many thanks

Unable to install in CentOS7

Console output below.

Tried installing a few ways, and all give the same error message:

  1. from CRAN
  2. from RStudio Package Manager Linux binaries
  3. from RStudio Package Manager Source

Error message is uninformative, as shown below, so unable to dig deeper.

When dependencies is TRUE, it fails on rstanarm install. Since I've no need for this package , for now, to use with tidymodels, hence setting dependencies=FALSE, which I'd expected for the install of tidyposterior to pass.

Note that rstan was installed successfully following its guide, so previous filed issues don't help in this case.

Minimal, runnable code:

> install.packages("tidyposterior", dependencies=FALSE)                                                      
trying URL 'https://cloud.r-project.org/src/contrib/tidyposterior_0.0.2.tar.gz'
Content type 'application/x-gzip' length 60111 bytes (58 KB)
==================================================
downloaded 58 KB

ERROR: dependency ârstanarmâ is not available for package âtidyposteriorâ
* removing â/opt/R/3.6.2/lib/R/library/tidyposteriorâ

The downloaded source packages are in
        â/tmp/RtmpV9MytD/downloaded_packagesâ
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("tidyposterior", dependencies = F) :
  installation of package âtidyposteriorâ had non-zero exit status

Session Info:

> sessioninfo::session_info()
â Session info âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
 setting  value
 version  R version 3.6.2 (2019-12-12)
 os       Red Hat Enterprise Linux Server 7.3 (Maipo)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Chicago
 date     2020-02-15

â Packages âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
 package     * version date       lib source
 assertthat    0.2.1   2019-03-21 [1] RSPM (R 3.6.1)
 cli           2.0.1   2020-01-08 [1] RSPM (R 3.6.2)
 crayon        1.3.4   2017-09-16 [1] RSPM (R 3.6.2)
 fansi         0.4.1   2020-01-08 [1] RSPM (R 3.6.2)
 glue          1.3.1   2019-03-12 [1] CRAN (R 3.6.2)
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.2)
 withr         2.1.2   2018-03-15 [1] RSPM (R 3.6.1)

[1] /opt/R/3.6.2/lib/R/library

Upkeep for tidyposterior

2023

Necessary:

  • Update copyright holder in DESCRIPTION: person(given = "Posit Software, PBC", role = c("cph", "fnd"))
  • Double check license file uses '[package] authors' as copyright holder. Run use_mit_license()
  • Update email addresses *@rstudio.com -> *@posit.co
  • Update logo (https://github.com/rstudio/hex-stickers); run use_tidy_logo()
  • usethis::use_tidy_coc()
  • usethis::use_tidy_github_actions()

Optional:

  • Review 2022 checklist to see if you completed the pkgdown updates
  • Prefer pak::pak("org/pkg") over devtools::install_github("org/pkg") in README
  • Consider running use_tidy_dependencies() and/or replace compat files with use_standalone()
  • use_standalone("r-lib/rlang", "types-check") instead of home grown argument checkers
  • Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples

Error when installing tidyposterior. ERROR: compilation failed for package ‘rstanarm’

I am so sorry to post this kind of mess. But I am just not sure what is going on here. Why is it so cryptic?

> remotes::install_github("tidymodels/tidyposterior")
Downloading GitHub repo tidymodels/tidyposterior@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                               
2: CRAN packages only                
3: None                              
4: rstanarm (2.19.2 -> 2.21.1) [CRAN]

Enter one or more numbers, or an empty line to skip updates: yes
Enter one or more numbers, or an empty line to skip updates: 1
rstanarm (2.19.2 -> 2.21.1) [CRAN]
Installing 1 packages: rstanarm
Installing package into ‘/Users/kamaulindhardt_1/Library/R/3.6/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
         binary source needs_compilation
rstanarm 2.19.2 2.21.1              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘rstanarm’

trying URL 'https://cran.rstudio.com/src/contrib/rstanarm_2.21.1.tar.gz'
Content type 'application/x-gzip' length 3548723 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

* installing *source* package ‘rstanarm’ ...
** package ‘rstanarm’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/bernoulli.stan
Wrote C++ file "stan_files/bernoulli.cc"


clang++ -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I"/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/BH/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/Rcpp/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include" -I"/Users/kamaulindhardt_1/Library/R/3.6/library/RcppParallel/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include `"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fPIC  -Wall -g -O2  -c stan_files/bernoulli.cc -o stan_files/bernoulli.o
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:1:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Core:540:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:2:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/LU:47:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Cholesky:12:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Jacobi:29:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Cholesky:43:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/QR:15:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Householder:27:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/QR:48:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:5:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/SVD:48:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:6:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Geometry:58:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Eigenvalues:58:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:14:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:26:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/SparseCore:66:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:14:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:27:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/OrderingMethods:71:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:14:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:29:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/SparseCholesky:43:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:14:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:32:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/SparseQR:34:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:14:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:33:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/IterativeLinearSolvers:46:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:22:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigenForward.h:32:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/CholmodSupport:45:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:22:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigenForward.h:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/KroneckerProduct:34:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:22:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigenForward.h:39:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/Polynomials:135:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:22:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/RcppEigenForward.h:40:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/SparseExtra:51:
/Users/kamaulindhardt_1/Library/R/3.6/library/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:14:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
    #pragma clang diagnostic pop
                             ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat.hpp:283:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/prob/gaussian_dlm_obs_rng.hpp:138:7: warning: unused variable 'n' [-Wunused-variable]
  int n = G.rows();  // number of states
      ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:17:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/fun/columns_dot_self.hpp:8:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/fun/dot_self.hpp:38:41: warning: all paths through this function will call itself [-Winfinite-recursion]
  inline static double square(double x) { return square(x); }
                                        ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:70:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/functor/integrate_ode_adams.hpp:5:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/functor/cvodes_integrator.hpp:126:18: warning: unused variable 'coupled_size' [-Wunused-variable]
    const size_t coupled_size = cvodes_data.coupled_ode_.size();
                 ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:6:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/core.hpp:46:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13: warning: unused function 'set_zero_all_adjoints' [-Wunused-function]
static void set_zero_all_adjoints() {
            ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:6:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/core.hpp:47:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints_nested.hpp:17:13: warning: 'static' function 'set_zero_all_adjoints_nested' declared in header file should be declared 'static inline' [-Wunneeded-internal-declaration]
static void set_zero_all_adjoints_nested() {
            ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat.hpp:278:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/prob/dirichlet_log.hpp:5:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/prob/dirichlet_lpmf.hpp:60:9: warning: unused type alias 'T_partials_vec' [-Wunused-local-typedef]
  using T_partials_vec = typename Eigen::Matrix<T_partials_return, -1, 1>;
        ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat.hpp:328:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/prob/poisson_log_glm_log.hpp:5:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/prim/mat/prob/poisson_log_glm_lpmf.hpp:52:9: warning: unused type alias 'T_alpha_val' [-Wunused-local-typedef]
  using T_alpha_val = typename std::conditional_t<
        ^
In file included from stan_files/bernoulli.cc:3:
In file included from stan_files/bernoulli.hpp:18:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/rstan/include/rstan/stan_fit.hpp:35:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4:
In file included from /Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat.hpp:51:
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/fun/squared_distance.hpp:27:11: warning: unused type alias 'idx_t' [-Wunused-local-typedef]
    using idx_t = typename index_type<matrix_v>::type;
          ^
/Users/kamaulindhardt_1/Library/R/3.6/library/StanHeaders/include/stan/math/rev/mat/fun/squared_distance.hpp:64:11: warning: unused type alias 'idx_t' [-Wunused-local-typedef]
    using idx_t = typename index_type<matrix_d>::type;
          ^
In file included from stan_files/bernoulli.cc:3:
stan_files/bernoulli.hpp:2651:24: warning: unused typedef 'local_scalar_t__' [-Wunused-local-typedef]
        typedef double local_scalar_t__;
                       ^
make: *** [stan_files/bernoulli.o] Interrupt: 2
make: *** Deleting intermediate file `stan_files/bernoulli.cc'
ERROR: compilation failed for package ‘rstanarm’
* removing ‘/Users/kamaulindhardt_1/Library/R/3.6/library/rstanarm’
* restoring previous ‘/Users/kamaulindhardt_1/Library/R/3.6/library/rstanarm’

Failed to load "tidyposterior" due to Error: object ‘posterior_epred’ is not exported by 'namespace:rstanarm'

This is likely due to posterior_epred() being moved to rstantools and not under rstanarm.

> library('tidyposterior') 
Error: package or namespace load failed for ‘tidyposterior’:  object ‘posterior_epred’ is not exported by 'namespace:rstanarm'

> packageVersion('rstanarm')
[1] ‘2.21.3’
> packageVersion('tidyposterior')
[1] ‘1.0.0’
> packageVersion('rstantools')
[1] ‘2.2.0’

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] rstantools_2.2.0   posterior_1.3.1    ggrepel_0.9.2      forcats_0.5.2      kableExtra_1.3.4   rstanarm_2.21.3   
 [7] Rcpp_1.0.9         corrr_0.4.4        yardstick_1.1.0    workflowsets_1.0.0 workflows_1.1.2    tune_1.0.1        
[13] tidyr_1.2.1        tibble_3.1.8       rsample_1.1.1      recipes_1.0.3      purrr_1.0.0        parsnip_1.0.3     
[19] modeldata_1.0.1    infer_1.0.4        ggplot2_3.4.0      dplyr_1.0.10       dials_1.1.0        scales_1.2.1      
[25] broom_1.0.2        tidymodels_1.0.0  

loaded via a namespace (and not attached):
  [1] backports_1.4.1      systemfonts_1.0.4    plyr_1.8.8           igraph_1.3.5         splines_4.1.2        crosstalk_1.2.0     
  [7] listenv_0.9.0        inline_0.3.19        digest_0.6.31        foreach_1.5.2        htmltools_0.5.4      fansi_1.0.3         
 [13] checkmate_2.1.0      memoise_2.0.1        magrittr_2.0.3       globals_0.16.2       gower_1.0.1          RcppParallel_5.1.5  
 [19] matrixStats_0.63.0   svglite_2.1.0        xts_0.12.2           hardhat_1.2.0        timechange_0.1.1     prettyunits_1.1.1   
 [25] colorspace_2.0-3     rvest_1.0.3          xfun_0.36            jsonlite_1.8.4       callr_3.7.3          crayon_1.5.2        
 [31] lme4_1.1-31          survival_3.4-0       zoo_1.8-11           iterators_1.0.14     glue_1.6.2           gtable_0.3.1        
 [37] ipred_0.9-13         webshot_0.5.3        distributional_0.3.1 pkgbuild_1.4.0       rstan_2.21.7         future.apply_1.10.0 
 [43] abind_1.4-5          DBI_1.1.3            miniUI_0.1.1.1       viridisLite_0.4.1    xtable_1.8-4         GPfit_1.0-8         
 [49] stats4_4.1.2         lava_1.7.0           StanHeaders_2.21.0-7 prodlim_2019.11.13   DT_0.26              httr_1.4.4          
 [55] htmlwidgets_1.6.0    threejs_0.3.3        ellipsis_0.3.2       farver_2.1.1         pkgconfig_2.0.3      loo_2.5.1           
 [61] sass_0.4.4           nnet_7.3-18          utf8_1.2.2           labeling_0.4.2       tidyselect_1.2.0     rlang_1.0.6         
 [67] DiceDesign_1.9       reshape2_1.4.4       later_1.3.0          cachem_1.0.6         munsell_0.5.0        tools_4.1.2         
 [73] cli_3.5.0            generics_0.1.3       evaluate_0.19        stringr_1.5.0        fastmap_1.1.0        yaml_2.3.6          
 [79] processx_3.8.0       knitr_1.41           future_1.30.0        nlme_3.1-161         mime_0.12            xml2_1.3.3          
 [85] compiler_4.1.2       bayesplot_1.10.0     shinythemes_1.2.0    rstudioapi_0.14      lhs_1.1.6            bslib_0.4.2         
 [91] stringi_1.7.8        ps_1.7.2             lattice_0.20-45      Matrix_1.5-3         nloptr_2.0.3         markdown_1.4        
 [97] tensorA_0.36.2       conflicted_1.1.0     shinyjs_2.1.0        vctrs_0.5.1          pillar_1.8.1         lifecycle_1.0.3     
[103] furrr_0.3.1          jquerylib_0.1.4      httpuv_1.6.7         R6_2.5.1             bookdown_0.30        promises_1.2.0.1    
[109] renv_0.16.0          gridExtra_2.3        parallelly_1.33.0    codetools_0.2-18     boot_1.3-28.1        colourpicker_1.2.0  
[115] MASS_7.3-58.1        gtools_3.9.4         assertthat_0.2.1     withr_2.5.0          shinystan_2.6.0      parallel_4.1.2      
[121] grid_4.1.2           rpart_4.1.19         timeDate_4021.107    class_7.3-20         minqa_1.2.5          rmarkdown_2.19      
[127] shiny_1.7.4          lubridate_1.9.0      base64enc_0.1-3      dygraphs_1.1.1.6  

Exception: Exception: multiply: A[1] is -nan, but must not be nan!

I am running an Hierarchical model with poisson family and this error appears. I could not find anywhere on the internet talking about this error.
I would like to know what this error means:

Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:"
"Chain 3: Exception: Exception: multiply: A[1] is -nan, but must not be nan!

Fix Getting Started

Hello thanks for the fantastic R library.

In the Getting Started guide found at https://tidymodels.github.io/tidyposterior/articles/Getting_Started.html

Please change the line:

rocs_stacked <- gather(rocs)

To:

rocs_stacked <- gather(rocs, key = model, value = statistic, -id)

As the column headers are otherwise key and value in the rocs_stacked datatable only, which then does not work when graphing:

ggplot(rocs_stacked, aes(x = model, y = statistic, group = id, col = id)) + 
  geom_line(alpha = .75) + 
  theme(legend.position = "none")

Not sure if this broke due to different versions of something, my session info:

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.3.0       stringr_1.3.1       purrr_0.3.0         readr_1.3.1         tidyr_0.8.2         tibble_2.0.1       
 [7] tidyverse_1.2.1     bindrcpp_0.2.2      dplyr_0.7.8         tidyposterior_0.0.2 ggplot2_3.1.0      

loaded via a namespace (and not attached):
 [1] nlme_3.1-137       matrixStats_0.54.0 xts_0.11-2         lubridate_1.7.4    threejs_0.3.1      httr_1.4.0        
 [7] rstan_2.18.2       tools_3.5.2        backports_1.1.3    utf8_1.1.4         R6_2.3.0           DT_0.5            
[13] lazyeval_0.2.1     colorspace_1.4-0   withr_2.1.2        tidyselect_0.2.5   gridExtra_2.3      prettyunits_1.0.2 
[19] processx_3.2.1     compiler_3.5.2     rvest_0.3.2        cli_1.0.1          xml2_1.2.0         shinyjs_1.0       
[25] labeling_0.3       colourpicker_1.0   scales_1.0.0       dygraphs_1.1.1.6   ggridges_0.5.1     callr_3.1.1       
[31] digest_0.6.18      StanHeaders_2.18.1 minqa_1.2.4        rstanarm_2.18.2    base64enc_0.1-3    pkgconfig_2.0.2   
[37] htmltools_0.3.6    lme4_1.1-19        readxl_1.2.0       htmlwidgets_1.3    rlang_0.3.1        rstudioapi_0.9.0  
[43] shiny_1.2.0        bindr_0.1.1        generics_0.0.2     jsonlite_1.6       zoo_1.8-4          crosstalk_1.0.0   
[49] gtools_3.8.1       inline_0.3.15      magrittr_1.5       loo_2.0.0          bayesplot_1.6.0    Matrix_1.2-15     
[55] Rcpp_1.0.0         munsell_0.5.0      fansi_0.4.0        stringi_1.2.4      yaml_2.2.0         MASS_7.3-51.1     
[61] pkgbuild_1.0.2     plyr_1.8.4         grid_3.5.2         parallel_3.5.2     promises_1.0.1     crayon_1.3.4      
[67] miniUI_0.1.1.1     lattice_0.20-38    haven_2.0.0        splines_3.5.2      hms_0.4.2          ps_1.3.0          
[73] pillar_1.3.1       igraph_1.2.2       markdown_0.9       shinystan_2.5.0    reshape2_1.4.3     codetools_0.2-16  
[79] stats4_3.5.2       rstantools_1.5.1   glue_1.3.0         rsample_0.0.4      modelr_0.1.2       nloptr_1.2.1      
[85] httpuv_1.4.5.1     cellranger_1.1.0   gtable_0.2.0       assertthat_0.2.0   mime_0.6           xtable_1.8-3      
[91] broom_0.5.1        later_0.7.5        rsconnect_0.8.13   survival_2.43-3    shinythemes_1.1.2 

Thanks!

dplyr compatibility

Make sure that the overloaded class posterior is maintained when and subsetting is used (using NextMethod)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.