Change point vs. no change point

I have coded a change point model in Stan. It is essentially identical to the one in section 15.2 of the manual, except modelling normally distributed data instead of Poisson. So the parameters are mu1 (pre change point mean), mu2 (post change point mean), and sigma (same before and after).

However, the model assumes that a change point exists. I’d like to have a way to decide if there really was a change point. A couple of ideas I’ve had so far:

  1. Look at the posterior distribution of mu2 - mu1. Decide based on whether the, say, 95% interval includes zero. Or look at Prob(mu2 > mu1) and decide there was a change point if it’s, say, > 95%.

  2. Compare the change point model to a simple normal inference model (just mu and sigma) using something like WAIC.

However for # 2 it’s not immediately obvious to me how to calculate the log likelihood for the change point model. I imagine the way to do it is something like:

generated quantities {
      real log_lik[T];
      for (t in 1:T)
         log_lik[t] = normal_lpdf(D[t] | t < s ? mu1 : mu2 , sigma);

where s is the expected value of the change point for each iteration, determined from lp.

Is this correct?

Any other suggestions on how to decide whether or not there is a change point?



Thanks. I’ll look into using LOOIC.