Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd examples of inference for static Bayesian models #9
Comments
|
That sounds like a nice idea. Do you plan to keep this self-contained within a file in |
|
My plan was to make it a top-level function with tests, help page and later include it in a vignette. For the help page, I was going to either do a separate help file for each and have What is your preference on demo vs top-level function? |
|
I sometimes cheat and leave them in So thumbs up from me. |
|
This all sounds good to me... and I'd use as many source files as you need to organize things logically (if things start to get out of hand we can always introduce some more structure). I think one of my comments on your last commit was based on forgetting exactly what was in which repository, so just ignore it. |
|
Thanks @eddelbuettel and @adamjohansen for such quick responses regarding the number of changes in my planned pull request. Adam's comment about whether it's a good idea to use default data if there are issues with the data that the user inputs got me thinking about how I've implemented this example. I figured that the choice of priors, tuning parameters, etc. are all specific to this one example so it probably doesn't make sense to allow users to input their own data. The example is generally used for model choice so I've included the full data set in the package and users can select the model. Does this sound alright to you? I could try to make this example more generally applicable but dealing with the priors could be challenging. When I was including the full data set, I went back to the original source and noticed an error in the data I had been using. It turns out that the paper I got the data from had an error where one observation was misprinted. This unfortunately means that I need to redo the numerical integration to get the true log evidence estimates. This isn't a major issue - it'll just be two numbers in the .Rd file that need updating later. |
|
Personally, my inclination would probably be to make both (hyper)prior parameters and data something which can be specified from R because that's closer to the way I'd expect most real applications to look, but that's a detail and something that could be tweaked later. A working proof of concept implementation of this sort of thing seems useful. The other detail doesn't seem like too much to worry about at this stage, either, but do stick a comment in somewhere indicating that the calculation does need redoing to avoid confusing anyone if it gets forgotten. |
|
Thanks Adam. My questions were mostly in response to Adam's comment so I'll submit this as a pull request now to make the most of the time difference. I removed the incorrect log evidence and put the correct log evidence values for the two models in but they are only correct to one decimal place so I will improve on that later. Sorry, that wasn't really clear from what I said. |
|
Great, thanks. |
Currently the examples are based on particle filtering so it would be nice to have an example of how to use this package for inference on static Bayesian models. My plan is to add an example which is based on estimating the parameters of a linear regression model. This example is sometimes used as a test for new methods (albeit a 'toy' test) and I thought it would be good for pedagogical reasons due to its simplicity. The log normalizing constant is known for this example.
Data annealing and likelihood annealing are two common approaches, so I will create files for each approach and do a single pull request (they are fairly similar).
I plan to do adaptation on the likelihood annealing approach in a future request, probably as a third file. If three files on one example is too much then I can hold off on the likelihood annealing version until I do adaptation.
@eddelbuettel @adamjohansen