Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Solving real life problems using computational statistics and R

aentropico
October 24, 2012

Solving real life problems using computational statistics and R

We discuss different applications of computational statistics to social and daily life problems. We talk about simple implementations of mathematical tools and abstractions using R - a language for computational statistics. This deck is oriented to people with interests in programing and the potential of rapid mathematical prototyping and data visualization.

aentropico

October 24, 2012
Tweet

More Decks by aentropico

Other Decks in Technology

Transcript

  1. Motivation Solving problems: Brute Force vs. R About us Solving

    Real Life Problems Using Computational Statistics and R Juan Pablo Mar´ ın D´ ıaz CIO Sebasti´ an P´ erez Saaibi CEO aentr´ opico October 24, 2012 1 / 31
  2. Motivation Solving problems: Brute Force vs. R About us Motivation

    What is R? Where to get R? Motivation Why are scientific tools so ’beautiful’ and nevertheless neglected in most real-world applications? People don’t believe that math can help Math is not easy to master. 2 / 31
  3. Motivation Solving problems: Brute Force vs. R About us Motivation

    What is R? Where to get R? Motivation Why are scientific tools so ’beautiful’ and nevertheless neglected in most real-world applications? Not easy to use. Not replicable. Time consuming. Costly. 3 / 31
  4. Motivation Solving problems: Brute Force vs. R About us Motivation

    What is R? Where to get R? What is R? Awesome language for applied statistics. Open source adaptation of SPLUS. Large community. Exponential user growth. 4 / 31
  5. Motivation Solving problems: Brute Force vs. R About us Motivation

    What is R? Where to get R? Where to get R? cran.r-project.org More than 3500 Packages for physics, statistics, biology, bioinformatics, financial engineering, etc... Recommended IDE RStudio, awesome!. rstudio.org 5 / 31
  6. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to estimate rain in Africa? Plant rain sensors all over the place? If yesterday didn’t rain, then tomorrow ... 6 / 31
  7. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to estimate rain in Africa? Probabilistic graphical modeling for undestanding time series. (relation to financial engineering) Math: Kalman filtering R: ts 7 / 31
  8. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to detect Gaming Fraud? Hire countless private investigators. Hand-count lotto purchases per location. 8 / 31
  9. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to detect Gaming Fraud? Market Share distribution coupled with coupled with instability heat-map calendar detection. Math: Anomaly detection, Forecasting R: ggplot2, calendarHeatMap 9 / 31
  10. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s my optimal investment portfolio? Choose yesterday’s fastest horse. Full diversification. 0.98 1.00 SBI 1.0 1.1 1.2 1.3 1.4 SPI 0.98 1.02 1.06 1.10 SII 0.99 1.01 1.03 LMI 1.00 1.10 1.20 2005-11-01 2006-05-30 2006-12-26 MPI Time 1.0 1.2 1.4 ALT 1.00 1.04 1.08 LPP25 1.00 1.05 1.10 1.15 LPP40 1.00 1.10 1.20 2005-11-01 2006-05-30 2006-12-26 LPP60 Time x 10 / 31
  11. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s my optimal investment portfolio? Series 2000-01-02 2004-02-25 2008-04-20 -100 0 50 150 Series PX - SX5 - UKX - TPX - MXE - SEN - NDE - CEC - SPT - AS5 - SBR - SWI - JNX - DJU SPI SPI SPX SX5 UKX TPX MXE SEN NDE CEC SPT AS5 2000-01-02 2004-02-25 2008-04-20 0 20 40 60 80 Weights Recommendation Weights % Horizon = 12m | Smoothing: 12m | Startup: 1m | Shift 1m 2000-01-02 2004-02-25 2008-04-20 -4 0 2 4 6 8 Weights Rebalance Weights Changes % Horizon = 12 | Smoothing: 12m | Startup: 1m | Shift 1m Start: 2000-12-31 2000-01-02 2004-02-25 2008-04-20 -60 -20 20 Portfolio vs Benchmark Cumulated Horizon = 12m | Smoothing: 12m | Startup: 1m | Shift 1m MV | covEstimator -0.5 -0.3 -0.1 2000 2002 2004 2006 2008 2010 Drawdowns | Portfolio vs Benchmark Drawdowns (Max) Portfolio DD = -0.2 | Benchmark DD = -0.57 Strategy: myStrategy Portfolio Benchmark Total Return 36.78 1.64 Mean Return 0.33 0.01 StandardDev Return 1.46 4.56 Maximum Loss -6.73 -13.49 Portfolio Specification: Type: MV Optimize: minRisk Estimator: covEstimator Constraints: "LongOnly" Math Tools: Risk-adjusted dynamic portfolio optimization R: fportfolio, rmetrics, ggplot2 11 / 31
  12. Motivation Solving problems: Brute Force vs. R About us Problem:

    Where are entrepreneurs having the most impact inside a country? Make a really long/expensive survey. Look at results, 3-5 years later. 12 / 31
  13. Motivation Solving problems: Brute Force vs. R About us Problem:

    Where are entrepreneurs having the most impact inside a country? Math Tools: Complex Network Analysis, Activity Metrics. R: maps, ggmap, gephi. 13 / 31
  14. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to understand Innovation Ecosystems? Write endless reports. Make infinite interviews. 14 / 31
  15. Motivation Solving problems: Brute Force vs. R About us Problem:

    How to understand Innovation Ecosystems? Social Network Analysis to understand complex dynamics in regional innovation systems. Math: Graph theory, Spectral Analysis R: igraph 15 / 31
  16. Motivation Solving problems: Brute Force vs. R About us Problem:

    Should I participate in a governmental call for bids? Make a very solid proposal. Let the best win! 16 / 31
  17. Motivation Solving problems: Brute Force vs. R About us Problem:

    Should I participate in a governmental call for bids? Math Tools: Game Theory, Monte Carlo Simulations R: mcmc, ggplot2. 17 / 31
  18. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s the optimal number of elevators for a building? Circle area: A = π ∗ r2 = Ncircle Square area: A = 4 ∗ r2 = Nsquare ˆ π = 4 Ncircle Nsquare 18 / 31
  19. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s the optimal number of elevators for a building? Circle area: A = π ∗ r2 = Ncircle Square area: A = 4 ∗ r2 = Nsquare ˆ π = 4 Ncircle Nsquare 19 / 31
  20. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s the optimal number of elevators for a building? Circle area: A = π ∗ r2 = Ncircle Square area: A = 4 ∗ r2 = Nsquare ˆ π = 4 Ncircle Nsquare 20 / 31
  21. Motivation Solving problems: Brute Force vs. R About us Problem:

    What’s the optimal number of elevators for a building? Math Tools: Monte Carlo Simulations R: Object Oriented Programming - S4 classes. 21 / 31
  22. Motivation Solving problems: Brute Force vs. R About us Problem:

    Who should you talk to in THIS meetup? Smile and be as friendly as you can. Bring TONS of business cards. 22 / 31
  23. Motivation Solving problems: Brute Force vs. R About us Problem:

    Who should you talk to in THIS meetup? Math Tools: Network Centrality, NLP, text mining R: twitteR, ggplot2, wordcloud, tm, Rcurl 23 / 31
  24. Motivation Solving problems: Brute Force vs. R About us Problem:

    Who should you talk to in THIS meetup? 30 % of this meet up attendees have twitter handles Only this guys have their profile protected aldoulloa and AleOrmazabalC 24 / 31
  25. Motivation Solving problems: Brute Force vs. R About us Problem:

    Who should you talk to in THIS meetup? p337er pestefo hoyenlanoche beingnithya bernarditojo Rob_Bless Chueks corrego Pecanha sontek john_fisherman feranto denistodirica tumultus jpmarindiaz hemanthsk Marc_Fuentes burgosmann startupchile sirlund el_Ale Arkanus 2bbie juernando spsaaibi Network Diameter: 5 Graph Density: 0.053 Average Degree: 2.56 25 / 31
  26. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide Team 26 / 31
  27. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide What we solve 27 / 31
  28. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide How we solve it 28 / 31
  29. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide We provide 29 / 31
  30. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide Our motto 30 / 31
  31. Motivation Solving problems: Brute Force vs. R About us Team

    What we solve How we solve it We provide Thanks! Visit us at http://aentropi.co twitter: @aentropico Contact Details: Juan Pablo [email protected] twitter: @jpmarindiaz Sebasti´ an [email protected] twitter: @spsaaibi 31 / 31