Blog Archives

SAS PROC MCMC in R: Nonlinear Poisson Regression Models

December 6, 2014
By
SAS PROC MCMC in R: Nonlinear Poisson Regression Models

In exercise 61.1 the problem is that the model has bad mixing. In the SAS manual the mixing is demonstrated after which a modified distribution is used to fix the model.In this post the same problem is tackled in R; MCMCpack, RJags, RStan and LaplaceDemon. MCMCpack has quite some mixing problems, RStan seems to do best.DataTo quote the SAS...

Read more »

Change in temperature in Netherlands over the last century

November 30, 2014
By
Change in temperature in Netherlands over the last century

I read a post 'race for the warmest year' at sargasso.nl. They used a plot, originating from Ed Hawkins to see how 2014 progressed to be warmest year. Obviously I wanted to make the same plot using R. In addition, I wondered which parts of the year had...

Read more »

When should I change to snow tires in Netherlands

November 23, 2014
By
When should I change to snow tires in Netherlands

The Royal Netherlands Meteorological Institute has weather information by day for a number of Dutch stations. In this post I want to use those data for a practical problem: when should I switch to winter tires? (or is that snow tires? In any case nails...

Read more »

SAS PROC MCMC example in R; Poisson Regression

November 16, 2014
By

In this post I will try to copy the calculations of SAS's PROC MCMC example 61.5 (Poisson Regression) into the various R solutions. In this post Jags, RStan, MCMCpack, LaplacesDemon solutions are shown. Compared to the first post in this series, rcppbugs and mcmc are not used. Rcppbugs has no poisson distribution and while I know how to...

Read more »

The completeness of online gun shooting victim counts

November 9, 2014
By
The completeness of online gun shooting victim counts

There are a number of on line efforts to register victims of shootings online. Shootingtracker tries to register all mass shootings, those with four or more victims. Slate had the gun death tally (GDT), gun deaths starting at Newtown, running thro...

Read more »

Tuning Laplaces Demon IV

November 2, 2014
By
Tuning Laplaces Demon IV

This is the last post of testing Laplaces Demon algorithms. In the last algorithms there are some which are completely skipped because they are not suitable for the problem. Reversible Jump is for variable selection. Sequential Metropolis-within-Gibbs,...

Read more »

Tuning Laplaces Demon III

October 26, 2014
By
Tuning Laplaces Demon III

This is the third post with LaplacesDemon tuning. same problem, different algorithms. For introduction and other code see this post. The current post takes algorithms Independence Metropolis to Reflective Slice Sampler.Independence MetropolisIndependen...

Read more »

Tuning Laplaces Demon II

October 19, 2014
By
Tuning Laplaces Demon II

I am continuing with my trying all algorithms of Laplaces Demon. It is actually quite a bit more work than I expected but I do find that some of the things get clearer. Now that I am close to the end of calculating this second batch I learned that ther...

Read more »

Tuning LaplacesDemon

October 12, 2014
By
Tuning LaplacesDemon

I was continuing with my Bayesian algorithms in R exercise. For these exercises I port SAS PROC MCMC examples to the various R solutions. However, the next example was logit model and that's just too simple, especially after last week's Jacobian for th...

Read more »

Bayes models from SAS PROC MIXED in R, post 2

October 5, 2014
By

This is my second post in converting SAS's PROC MCMC examples in R. The task in his week is determining the transformation parameter in a Box-Cox transformation. SAS only determines Lambda, but I am not so sure about that. What I used to do was get an ...

Read more »