Estimating parameters of a dynamic linear model I want to implement (in R) the following very simple Dynamic Linear Model for which I have 2 unknown time varying parameters (the variance of the observation error $\epsilon^1_t$ and the variance of the state error $\epsilon^2_t$).
$  
\begin{matrix}  
Y_t & = & \theta_t + \epsilon^1_t\\     
\theta_{t+1} & = & \theta_{t}+\epsilon^2_t  
\end{matrix}  $
I want to estimate these parameters at each time point, without any look ahead bias.
From what I understand, I can use either a MCMC (on a rolling window to avoid the look ahead bias), or a particle filter (or Sequential Monte Carlo - SMC).  
Which method would you use, and
What are the pros and cons of these two methods?
Bonus question: In these methods, how do you select the speed of change of the parameters? I guess we have to input an information here, because there is a bargain between using a lot of data to estimate the parameters and using less data to react more quickly to a change in the parameter?
 A: If you have time varying parameters and want to do things sequentially (filtering), then SMC makes the most sense. MCMC is better when you want to condition on all of the data, or you have unknown static parameters that you want to estimate. Particle filters have issues with static parameters (degeneracy). 
A: Have a look at the dlm package and its vignette. I think you might find what you are looking for from the vignette. The package authors have also written a book Dynamic Linear Models with R.
A: I've read Dynamic Linear Models with R (good book), the final chapter deals with sequential Monte Carlo / particle filtering. It also includes some R code; however, in the concluding remarks of chapter 5 they explicitly warn that SMC becomes increasingly unreliable as additional time passes because the errors accumulate. Thus, they recommend "refreshing" the particle filter with the posterior distribution from a full MCMC sample every $T$ periods. Perhaps I misread their warnings, but this would seem to imply that you are better off with the rolling window MCMC. However, I would think there are substantial computer processing constraints with that method. For example, assuming you had 1,000 different univariate time series with 50 observations each and it took you 10 minutes to run a full MCMC Gibbs sampler. Then, it would take you 340 days ($(1000 \times (50-1) \times 10) \div 60 \div 24$) of continuous processing to estimate the parameters without look-ahead bias. Maybe my estimate of the time it takes to run the MCMC is wildly off, but I think it's a conservative but reasonable estimate.
It's been several years since you asked the question, so I'd be curious if you yourself have an answer now.
