Closed mebrooks closed 2 years ago
I can't see right now how this is related to glmmTMB. I will check, too. The current master on GitHub is the version to be submitted?
Yes, the master branch of glmmTMB is the one we plan to submit. I'm still trying to reproduce a few elusive errors that only show up on either Windows or Linux, but that probably shouldn't affect the error in performance
.
When you find the time, please relocate that repo one directory higher ;-)
I always stumble upon this error when I try remotes::install_github("glmmTMB/glmmTMB")
.
Hm, can't reproduce.
library(performance)
if (require("rstanarm") && require("rstantools")) {
model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500, refresh = 0)
r2_bayes(model)
model <- stan_lmer(
Petal.Length ~ Petal.Width + (1 | Species),
data = iris,
chains = 1,
iter = 500,
refresh = 0
)
r2_bayes(model)
}
#> Loading required package: rstanarm
#> Loading required package: Rcpp
#> This is rstanarm version 2.21.1
#> - See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!
#> - Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.
#> - For execution on a local, multicore CPU with excess RAM we recommend calling
#> options(mc.cores = parallel::detectCores())
#> Loading required package: rstantools
#> This is rstantools version 2.1.1
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: The largest R-hat is 1.05, indicating chains have not mixed.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#r-hat
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> # Bayesian R2 with Compatibility Interval
#>
#> Conditional R2: 0.954 (95% CI [0.942, 0.963])
#> Marginal R2: 0.824 (95% CI [0.728, 0.893])
Created on 2022-03-02 by the reprex package (v2.0.1)
As you can see from the session info, glmmTMB isn't even involved in this example. Could it be that rstan(arm) is failing on your system, so revdep-checks yield an error due to Stan problem, not due to problems from performance in conjunction with glmmTMB?
(same when I load glmmTMB)
library(performance)
library(glmmTMB)
if (require("rstanarm") && require("rstantools")) {
model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500, refresh = 0)
r2_bayes(model)
model <- stan_lmer(
Petal.Length ~ Petal.Width + (1 | Species),
data = iris,
chains = 1,
iter = 500,
refresh = 0
)
r2_bayes(model)
}
#> Loading required package: rstanarm
#> Loading required package: Rcpp
#> This is rstanarm version 2.21.1
#> - See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!
#> - Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.
#> - For execution on a local, multicore CPU with excess RAM we recommend calling
#> options(mc.cores = parallel::detectCores())
#> Loading required package: rstantools
#> This is rstantools version 2.1.1
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> # Bayesian R2 with Compatibility Interval
#>
#> Conditional R2: 0.952 (95% CI [0.941, 0.963])
#> Marginal R2: 0.814 (95% CI [0.722, 0.892])
Created on 2022-03-02 by the reprex package (v2.0.1)
@strengejacke, but you are using your local/GitHub version of performance.
It is possible that the development version of performance has somehow already fixed whatever the issue is, but it's still present in the CRAN version. Reverse dependency check will be run against the CRAN version.
Same results for CRAN version:
library(glmmTMB)
library(performance)
if (require("rstanarm") && require("rstantools")) {
model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500, refresh = 0)
r2_bayes(model)
model <- stan_lmer(
Petal.Length ~ Petal.Width + (1 | Species),
data = iris,
chains = 1,
iter = 500,
refresh = 0
)
r2_bayes(model)
}
#> Loading required package: rstanarm
#> Loading required package: Rcpp
#> This is rstanarm version 2.21.1
#> - See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!
#> - Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.
#> - For execution on a local, multicore CPU with excess RAM we recommend calling
#> options(mc.cores = parallel::detectCores())
#> Loading required package: rstantools
#> This is rstantools version 2.1.1
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> Warning: 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
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> # Bayesian R2 with Compatibility Interval
#>
#> Conditional R2: 0.954 (95% CI [0.941, 0.963])
#> Marginal R2: 0.820 (95% CI [0.721, 0.904])
Created on 2022-03-02 by the reprex package (v2.0.1)
Usually, the complete example is totally unrelated to glmmTMB (unless stan_lmer()
uses glmmTMB).
Looks like an issue not related to glmmTMB. If you still get errors from revdep checks when submitting to CRAN, due to performance, we will be able to submit an update in time.
I'm getting the same error again while checking reverse dependencies for version 1.1.4. I'll ignore it based on your comments last time. The contents of problems.md
are as follows.
checking examples ... ERROR
Running examples in ‘performance-Ex.R’ failed
The error most likely occurred in:
> ### Name: r2_bayes
> ### Title: Bayesian R2
> ### Aliases: r2_bayes r2_posterior r2_posterior.brmsfit
> ### r2_posterior.stanreg r2_posterior.BFBayesFactor
>
> ### ** Examples
>
...
https://mc-stan.org/misc/warnings.html#tail-ess
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] " 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
Error in dimnamesGets(x, value) :
invalid dimnames given for “dgCMatrix” object
Calls: stan_lmer ... colnames<- -> dimnames<- -> dimnames<- -> dimnamesGets
Execution halted
I'm checking reverse dependencies for an upcoming release. The deadline is March 13th, but I would like to submit sooner if possible. The checks indicate a problem with the
performance
package (details below).