Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyse_baSAR() crashes for various settings of variable.names #521

Closed
mcol opened this issue Dec 6, 2024 · 0 comments · Fixed by #522
Closed

analyse_baSAR() crashes for various settings of variable.names #521

mcol opened this issue Dec 6, 2024 · 0 comments · Fixed by #522
Labels
bug Clear problem or crash
Milestone

Comments

@mcol
Copy link
Contributor

mcol commented Dec 6, 2024

These crash:

analyse_baSAR(CWOSL.sub,
                source_doserate = c(0.04, 0.001),
                signal.integral = c(1, 2),
                background.integral = c(8, 10),
                method_control = list(n.chains = 1,
                                      variable.names = c('central_D', 'sigma_D', 'D', 'Q', 'a', 'b')),
                n.MCMC = 10, verbose = FALSE)

# Error in plot_matrix[4, i] : subscript out of bounds
# In addition: Warning messages:
# 1: [analyse_baSAR()] Only multiple grain data provided, automatic selection skipped
# 2: [analyse_baSAR()] [calc_OSLLxTxRatio()] Number of background channels for Tx < 25, error estimation might not be reliable # This warning occurred 3 times
# 3: In rjags::jags.model(file = textConnection(baSAR_models[[distribution]]),  :
#   Adaptation incomplete

analyse_baSAR(CWOSL.sub,
                source_doserate = c(0.04, 0.001),
                signal.integral = c(1, 2),
                background.integral = c(8, 10),
                method_control = list(n.chains = 1,
                                      variable.names = c('sigma_D')),
                n.MCMC = 10, verbose = FALSE)

# Error: [analyse_baSAR()] Plots for 'central_D' and 'sigma_D' could not be produced. You are probably monitoring the wrong variables

analyse_baSAR(CWOSL.sub,
                source_doserate = c(0.04, 0.001),
                signal.integral = c(1, 2),
                background.integral = c(8, 10),
                method_control = list(n.chains = 1,
                                      variable.names = c('central_D', 'sigma_D')),
                n.MCMC = 10, verbose = FALSE)

# Error in matrixStats::colQuantiles(x = plot_matrix, probs = c(0.25, 0.75)) :
#  Argument 'x' is of type ‘list’. Only 'integer', 'numeric', and 'logical' is supported.

This is not a crash, but the error message doesn't make sense to me, as the set of names is a subset of the default names:

analyse_baSAR(CWOSL.sub,
                source_doserate = c(0.04, 0.001),
                signal.integral = c(1, 2),
                background.integral = c(8, 10),
                method_control = list(n.chains = 1,
                                      variable.names = c('central_D', 'sigma_D', 'D')),
                n.MCMC = 10, verbose = FALSE)

# [analyse_baSAR()] Error: Wrong 'variable.names' monitored, dose responses curves could not be plotted

This is also not a crash, but we could avoid the error message with better validation:

analyse_baSAR(CWOSL.sub,
                source_doserate = c(0.04, 0.001),
                signal.integral = c(1, 2),
                background.integral = c(8, 10),
                method_control = list(n.chains = 1,
                                      variable.names = ""),
                n.MCMC = 10, verbose = FALSE)

# Error in parse.varnames(variable.names[type == t]) :
#   Invalid variable subset
¬¬¬
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Clear problem or crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant