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




  • AdaOpt classification on MNIST handwritten digits (without preprocessing)
    AdaOpt classification on MNIST handwritten digits (without preprocessing)
  • RStudio Shortcuts and Tips
    Updated: May 2020 by Appsilon Data Science How to Work Faster in RStudio In this article we have compiled many of our favorite RStudio keyboard shortcuts, tips, and tricks to help increase your productivity while working with the RStudio IDE. We’ll also provide information about supplemental tools and techniques that are useful for data scientists […]
  • How to Safely Remove a Dynamic Shiny Module
    Despite their advantages, Dynamic Shiny Modules can destabilize the Shiny environment and cause its reactive graph to be rendered multiple times. In this blogpost, I present how to remove deleted module leftovers and make sure that your Shiny graph observers are rendered just once. While working with advanced Shiny applications, you have most likely encountered […]
  • Version 0.9.1 of NIMBLE released
    We’ve released the newest version of NIMBLE on CRAN and on our website. NIMBLE is a system for building and sharing analysis methods for statistical models, especially for hierarchical models and computationally-intensive methods (such as MCMC and SMC). Version 0.9.1 is primarily a bug fix release but also provides some minor improvements in functionality. Users of […]
  • April 2020: “Top 40” New CRAN Packages
    One hundred forty-eight new packages made it to CRAN in April. Here are my “Top 40” picks in nine categories: Computational Methods, Data, Machine Learning, Medicine, Science, Statistics, Time Series, Utilities, and Visualization. Computational Methods JuliaConnectoR v0.6.0: Allows users to import Julia packages and functions in such a way that they can be called directly […]

RSS Simply Statistics

  • Asymptotics of Reproducibility
    Every once in a while, I see a tweet or post that asks whether one should use tool X or software Y in order to “make their data analysis reproducible”. I think this is a reasonable question because, in part, there are so many good tools out there! This is undeniably a good thing and […]
  • Amplifying people I trust on COVID-19
    Like a lot of people, I’ve been glued to various media channels trying to learn about the latest with what is going on with COVID-19. I have also been frustrated - like a lot of people - with misinformation and the deluge of preprints and peer reviewed material. Some of this information is critically important […]
  • Is Artificial Intelligence Revolutionizing Environmental Health?
    NOTE: This post was written by Kevin Elliott, Michigan State University; Nicole Kleinstreuer, National Institutes of Health; Patrick McMullen, ScitoVation; Gary Miller, Columbia University; Bhramar Mukherjee, University of Michigan; Roger D. Peng, Johns Hopkins University; Melissa Perry, The George Washington University; Reza Rasoulpour, Corteva Agriscience, and Elizabeth Boyle, National Academies of Sciences, Engineering, and Medicine. […]

RSS Statistical Modeling, Causal Inference, and Social Science

  • An open letter expressing concerns regarding the statistical analysis and data integrity of a recently published and publicized paper
    James Watson prepared this open letter to **, **, **, and **, authors of ** and to ** (editor of **). The letter has approximately 96,032 signatures from approximately 6 continents. And I heard a rumor that they have contacts at the Antarctic Polar Station who are going to sign the thing once they can […]
  • Blast from the past
    Lizzie told me about this paper, “Bidirectionality, Mediation, and Moderation of Metaphorical Effects: The Embodiment of Social Suspicion and Fishy Smells,” which reports: As expected (see Figure 1), participants who were exposed to incidental fishy smells invested less money (M = $2.53, SD = $0.93) than those who were exposed to odorless water (M = […]
  • This is not a post about remdesivir.
    Someone pointed me to this post by a doctor named Daniel Hopkins on a site called, expressing skepticism about a new study of remdesivir. I guess some work has been done following up on that trial on 18 monkeys. From the KevinMD post: On April 29th Anthony Fauci announced the National Institute of Allergy […]