Brazilian Presidential Election

September 3, 2014
By

(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)

pt

MARINA SILVA (PSB)

psb

AÉCIO NEVES (PSDB)

aecio

OTHERS

others

WASTING

none

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

convergence

convergence_bt

To leave a comment for the author, please follow the link and comment on their blog: Daniel MarcelinoDaniel Marcelino » R.

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



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

Mango solutions



RStudio homepage



Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training



http://www.eoda.de









ODSC

CRC R books series













Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)