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

getSample(whichParameters) breaks getSample(parametersOnly = FALSE) #219

Open
twest820 opened this issue Jul 2, 2021 · 1 comment
Open
Milestone

Comments

@twest820
Copy link

twest820 commented Jul 2, 2021

A user should be able to do something like getSample(parametersOnly = FALSE, whichParameters = 1) and get back a parameter array with their first MCMC parameter followed by the Lposterior, Llikelihood, and Lprior columns. However, it looks like these two lines

if (!is.null(whichParameters)) out = out[,whichParameters]

if (!is.null(whichParameters)) temp = temp[,whichParameters]

blindly slices Lposterior, Llikelihood, and Lprior off the output. Fix would just be not to do that.

Workaround is something like

as.data.frame(getSample()) %>% select(firstParameter, Lposterior, Llikelihood, Lprior)

which has the advantage of also avoiding the next issue I'm about to open.

@florianhartig
Copy link
Owner

Yep. I will leave this open for now because I don't think it's particularly critical and having looked at getSample I get the feeling we should have a more general look at the getSample structure, there is a lot of code that has accumulated around getSample that feels a bit clumsy, I think we should consider to re-model the entire implementation (behind the interface) instead of patching it up.

@florianhartig florianhartig added this to the BT 0.1.9 milestone Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants