Are you parallelizing your raster operations? You should!

If you plan to do anything with the raster package you should definitely consider parallelize all your processes, especially if you are working with very large image files. I couldn’t find any blog post describing how to parallelize with the raster package (it is well documented in the package documentation, though). So here my notes.

Thursday, 17 January 2019

2018 Italian general election: Details on my simulation

This article describes the simulation behind the app that you find here

This simulation of the results for the 2018 general election is based on the results from the last two national elections (the Italian parliament election in 2013 and the European Parliament election 2014) and national polls conducted until 16 February 2018. The simulation is based on one assumption, which is reasonable but not necessarily realistic: the relative territorial strength of parties is stable. From this assumption derives that if the national support for a party (as measured by national voting intention polls) varies, it varies consistently and proportionally everywhere. A rising tide lifts all boats and vice versa. The assumption has some empirical justification. If we compare the difference from the national support (in percentage) for each district in 2013 and 2014 we see a significant correlation, especially in the major parties.

Votes to party in the 2018 Chamber districts


Tuesday, 27 February 2018

NDVI, risk assessment and developing countries

The Normalized Difference Vegetation Index (NDVI) estimates the greenness of plants covering the surface of the Earth by measuring the light reflected by the vegetation into space. The main idea behind the NDVI is that visible and near-infrared light is absorbed in different proportions by healthy and unhealthy plants: a green plant will reflect 50% of the near infrared-light it receives and only 8% of the visible light while an unhealthy plant will reflect respectively 40% and 30%. NDVI can then be used to quantitatively compare vegetation conditions across time and space (and indeed is quite widely used, a Google Scholar search on NDVI produced 60,500 hits).


Thursday, 14 February 2013


Twitter: frbailo




  • GooglyPlusPlus gets ready for ICC Men’s T20 World Cup
    It is time!! So last weekend, I turned the wheels, moved the levers and listened to the hiss of steam, as I cranked up my Shiny app GooglyPlusPlus. The ICC Men’s T20 World Cup is just around the corner, and it was time to prepare for this event. This ... Continue reading: GooglyPlusPlus gets ready […]
  • Applications open: The Seventh Summer School on Statistical Methods for Linguistics and Psychology, 11-15 September 2023
    Applications are open (till 1st April 2023( for the seventh summer school on statistical methods for linguistics and psychology, to be held in Potsdam, Germany.Summer school website: of the highlights:&nbsp... Continue reading: Applications open: The Seventh Summer School on Statistical Methods for Linguistics and Psychology, 11-15 September 2023
  • Package dev with {fusen} & {attachment}: load all functions of a flat, manage qmd and auto-fill Remotes field
    You can read the original post in its original format on Rtask website by ThinkR here: Package dev with {fusen} & {attachment}: load all functions of a flat, manage qmd and auto-fill Remotes field One aim of our open-source packages at ThinkR is to make our development workflows easier. {attachment} and {... Continue reading: Package […]
  • Get Miles: using treemap to visualise running distances
    By 30th September 2022, I had clocked up a total of over 2000 km of running in 2022. This milestone was a good opportunity to look at how I got to this point. The code is shown below. First, we can make a histogram to look at the distance of runs. From this ... Continue […]
  • ggradar: radar plots with ggplot in R
    Businesses have tons of data. But 90% have no clue how to use it. Here’s what they are overlooking… Within-Group Analysis. Groups are important (think customer segments). But group-wise comparisons can be tricky. Thankfully an R package exists to hel... Continue reading: ggradar: radar plots with ggplot in R

RSS Simply Statistics

RSS Statistical Modeling, Causal Inference, and Social Science

  • (Now that faculty aren’t coming into the office anymore) Will universities ever recover?
    A few years ago I taught a course at Sciences Po in Paris. The classes were fine, the students were fine, but there was almost no academic community. I had an office in some weird building where they stuck visitors. … Continue reading →
  • What Nested R-hat teaches us about the classical R-hat
    (this post is by Charles) My colleagues Matt Hoffman, Pavel Sountsov, Lionel Riou-Durand, Aki Vehtari, Andrew Gelman, and I released a preprint titled “Nested R-hat: assessing the convergence of Markov chains Monte Carlo when running many short chains”. This is … Continue reading →
  • Not frequentist enough.
    I think that many mistakes in applied statistics could be avoided if people were to think in a more frequentist way. Look at it this way: In the usual way of thinking, you apply a statistical procedure to the data, … Continue reading →