(This article was first published on

**Daniel MarcelinoDaniel Marcelino » R**, and kindly contributed to R-bloggers)I hope to have finished the major load on my forecasting model algorithm. I also conclude this project with a new set of clear graphs, although, I still feel working on the colors and scales.

I’ve received a few emails asking for more details on the simulations and to make the code available, which is part of my plans since ever. But, first I’ve to conclude all the robust checks, and I’ve been quite busy these days working on other stuff.

Below is the Expected outcome simulated. The graphs come next. Last, is the convergence diagnostic graph.

```
R> summary(mcmc2014)
forecast class object:
MCMC: 1000 samples with a burnin of 500 and a thin of 5.
Predicted at 2014-09-10, using 32 polls from 6 houses.
Evidence starting at 2014-02-19.
Election at 2014-10-05.
Machine runtime: ~ 28 minutes.
Expected results + swing voters:
Expected results
PT 0.35051
PSDB 0.18537
PSB 0.21591
Others 0.05782
None 0.08691
Swing 0.10349
Probability Intervals (95%):
2.5% 50% 97.5%
PT 0.33273 0.34964 0.37397
PSDB 0.16884 0.18478 0.20501
PSB 0.17963 0.21576 0.25258
Others 0.04282 0.05766 0.07406
None 0.06892 0.08701 0.10305
Swing 0.08873 0.10387 0.11728
```

DILMA ROUSSEFF (PT)

**MARINA SILVA (PSB)**

**AÉCIO NEVES (PSDB)**

**OTHERS**

**WASTING**

**CONVERGENCE**

As it becomes clear, there are some strong spikes towards the end of the chain. I’ll look at this next.

To

**leave a comment**for the author, please follow the link and comment on his blog:**Daniel MarcelinoDaniel Marcelino » R**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...