Distribution Fitting with multiple changepoints I have a time series of a random variable x, which randomly moves in and out of three broader states- "generally increasing", "generally decreasing", "more or less staying still". The distribution of x in each of these 3 states is gaussian with different means and variances. 
Given the above time series of x, is there a way to iteratively fit the 3 distributions without knowing when the multiple changes happen? Preferably without using hidden markov models?
 A: The changepoint package in the R software provides the option for doing the above.  To demonstrate with a toy example:
library(changepoint)
set.seed(1)
x=c(rnorm(50,0,1),rnorm(50,5,3),rnorm(50,10,1),rnorm(50,3,10))
out=cpt.meanvar(x,method="PELT")
cpts(out) # gives 50,100,150 as changepoints

The above uses the cpt.meanvar function as you want to identify a change in mean and variance.  The default is to assume a Normal distribution so you are good there.  The default is to identify 1 change so we use method='PELT' to tell the function to identify multiple changes uses the PELT algorithm (exact minimization of the objective function in approximately linear time).  
There are many things you can do with the output, cpts(out) gives you the changepoint locations but you can also plot:
plot(out,cpt.width=3)

Here i've changed the width of the changepoint lines (means) to be thicker than the default (1), you can also use all your normal plotting arguments.
We have used the default penalty MBIC in calculating the segmentation above but if your data are not independent within each segment you need to change this.  There is the CROPS penalty which gives you a range of segmentations between two penalty values:
out1=cpt.meanvar(x,method='PELT',penalty='CROPS',pen.value=c(10,500))
plot(out1,diagnostic=TRUE)

You need to make sure that your pen.value upper limit gives a segmentation with 0 changepoints for the diagnostic to make sense.  In the diagnostic plot you get the number of changepoints against the negative-log-likelihood. The idea is that when true changes are added the negative-log-likelihood goes down a large amount, when you add false changes then the negative-log-likelihood show a small improvement in fit.  For this simulation it is clear that the appropriate number of changes is 3 but for real data it can be less clear.  Once the number of changes has been decided you can plot that number using:
plot(out1,ncpts=3,cpt.width=3)

