Skip to main content


Elecciones en Guatemala y Ciencia de Datos

A mediados de este año tendremos nuevas elecciones en Guatemala. Las elecciones siempre son una excelente oportunidad para realizar investigación. Son sucesos que generan mucha expectativa y atención, y por ende, una buena fuente de datos y un muy buen laboratorio para experimentar modelos. Para las elecciones anteriores, realicé un modelo de proyección  que estimaba los resultados de la primera vuelta. Utilizando datos de las encuestas publicadas, hice un modelo utilizando Cadenas de Markov, el cual arrojó datos, con un mes de anticipación, con un margen de un 3% de los valores obtenidos en la primera vuelta.  Para estas elecciones, he decidido realizar otro análisis, esta vez un poco más a detalle. Para esto, he dividido el proceso en tres partes: Minería de datos Análisis de datos Proyección  Minería de Datos En este artículo describiré un poco de la primer parte del proceso. Antes de pensar en modelos de proyección, es importante considerar los datos que

La matemática que proyecta al Campeón del Mundo

Con el inicio del mundial me dediqué a jugar un poco con datos para realizar modelos de predicción de los encuentros. Ha sido una buena experiencia para pensar más en lo que en realidad significa realizar modelos de predicción, así como para ponerle más entusiasmo al torneo. En primer lugar, es importante hablar sobre lo que significa predecir  o proyectar  un resultado. Es imposible predecir el futuro como tal, sin embargo, es posible crear modelos que den una tendencia hacia algún resultado. Modelos determinísticos se basan en leyes fundamentales para modelar fenómenos. Por ejemplo, en la física, los modelos de movimiento de los cuerpos ofrecen trayectorias teóricas que describen su movimiento. En la práctica, estos modelos dan resultados aproximados de las trayectorias, debido a errores de medición, incertezas, y demás errores presentes en los parámetros y variables presentes. Por esto, dichos modelos presentan un modelo con cierto margen de error . Con métodos más precisos d

Using math to extract information from social data

Many people say we are in the information era, but it seems that we are passed this. Nowadays, information is within everyone's reach, about everything and as much as we want. Data is not the issue anymore, at least most of the time. The real issue is  how to analyze the data.  It seems that having information is not the problem now, but actually having too much  data. One of the places in which we can find too much data are social networks. The richness of social networks is that they are a continuous flow of interesting data, what I like to call social data .  Social data is so rich as you can extract information from it in so many ways. One is to analyze what people express over a specific topic on social media. To this end, I developed  a way to identify the most important ideas found on a stream of user comments. Basically an algorithmic summary tool.  With a data set of a few tens of user comments, it is easy to grasp the general feelings and thoughts that

2016 General Election Prediction

The presidential election is just few days away and this is the perfect time to jump into the prediction game as many others had ( Nate Silver , Sam Wang ,  Drew Linzer , and others). One way to estimate the outcome of the election results is to use data from polls. Many factors can be taken into consideration when performing a projection, such as historical trends, media coverage, debates, etc., but the advantage of considering polls is that it gives a data that is chronologically close to the desired event. We can think about the election as a guessing game: How much does each candidate measure  on election day? We are measuring  each candidate on the population on election day and polls give a good source of information on how this measurement is currently changing. It is important to realize that these measurements are dynamic  and get affected by events.  Every time big polls are published, knowing the current measurement makes it to change . This is known in physical

How the Zika connects Puerto Rico

Given the importance of the recent Zika outbreak, I decided to perform some analysis on how the virus is spreading. I found very good data about Puerto Rico, so decided to focus there. With data from each municipality in Puerto Rico, it is possible to find a connectivity map of the island according to how the virus spreads there. By analyzing the growth of cases over time in each municipality treat them as independent series and performing correlation analysis, we have that the most relevant connectivity groups are given by the following graph. There are 5 clear connectivity groups based on their response to the virus, Group 1 Group 2 Group 3 Group 4 Group 5 And the strongest connectivity is given by the following graph, This connectivity is given by an adjacency matrix obtained by calculating the r² coefficients among the municipalities. In this graphs are displayed only the strongest r² coefficients. 

Financial models for the NBA

A portfolio analysis can be performed in order to analyze how effective the NBA teams were during the 2016 season. It is possible to think of both Eastern and Western Conferences to be a benchmark  that we can reference teams to. When we analyze each team's performance against the overall performance of the entire benchmark, it is possible to discover how effective and consistent teams are. This can tell us how risky or stable a team is, and how much of a pay off teams offer for being risky.  With this we can find that the most stable teams in the Eastern Conference are Chicago and Atlanta, and in the Western Conference were New Orleans and Utah. On the other hand, the most volatile teams were Philadelphia and New York in the Eastern Conference, and Houston and LA Lakers in the Western Conference.  Likewise, it can be found that the most representative teams for the performance of the Eastern Conference were Philadelphia and Miami, and for the Western Confere

The NBA champions and the Stock Market

Analyzing statistics in modern day sports is one of the prime sport-fan pastimes. However it is possible to capture more information than just a plain statistical description of the data. For example, it is possible to use financial models and techniques to understand performance in sports in a more insightful way. In  particular, in the case of the recent NBA finals, we can analyze the performance of each player as if it were a financial asset.  A financial asset or security is anything that has the potential of giving a financial return overtime, such as stocks, bonds, treasury bills, and others. In this way, our goal is to analyze and asses a player's performance, and identify how reliable and efficient he is. In the case of the 2016 NBA Champions, the Cleveland Cavaliers, we can perform this analysis by studying the player's individual performance compared to that of their conference during the 2016 season. Here we can determine how sensitive a player is wi