Describe the solution you'd like
When estimating a Bayesian Regression model using brms you can select the option sample_prior = "yes" in order to also sample from the priors, in addition to obtaining posterior samples updated by the data. Currently, when having sampled the priors this way, the bayesfactor_parameters function still samples from the priors again which requires additional waiting time. I wonder if there is an option to change this behavior of the bayesfactor_parameters function to test if samples from the priors are saved in the brmsfit object and if that is the case do not sample from the priors again.
How could we do it?
I think there should be a simple way to test if a brmsfit object contains samples from the priors. And if that is the case these could be passed to the bayesfactor_parameters function in a similar way as passing priors from an unupdated model via the prior argument. Maybe I am overlooking something about the way the samples from the prior are stored in the brmsfit object. But the hypothesis function in brms requires to include samples from the priors to obtain Bayes Factors, so the prior samples should be accessible in the brmsfit object.
Describe the solution you'd like
When estimating a Bayesian Regression model using
brmsyou can select the optionsample_prior = "yes"in order to also sample from the priors, in addition to obtaining posterior samples updated by the data. Currently, when having sampled the priors this way, thebayesfactor_parametersfunction still samples from the priors again which requires additional waiting time. I wonder if there is an option to change this behavior of thebayesfactor_parametersfunction to test if samples from the priors are saved in thebrmsfitobject and if that is the case do not sample from the priors again.How could we do it?
I think there should be a simple way to test if a
brmsfitobject contains samples from the priors. And if that is the case these could be passed to thebayesfactor_parametersfunction in a similar way as passing priors from an unupdated model via thepriorargument. Maybe I am overlooking something about the way the samples from the prior are stored in thebrmsfitobject. But thehypothesisfunction inbrmsrequires to include samples from the priors to obtain Bayes Factors, so the prior samples should be accessible in thebrmsfitobject.