Poor Man’s Climate Change Exploration, part II

In a previous post, we looked at daily temperature readings 1949-2018 from an observation spot in Stockholm archipelago, and noticed a very clear increasing trend.

Here, we’ll look at the same spot & same period, but instead of temperature, we’ll focus on wind speed. What do you think, has the wind speed increased, decreased or hasn’t it changed at all in these 70 years….?

svenska_hogarna_vindsvenska_hogarna_vind_trend

The same clear trend as for temperatures – wind speed is increasing. Personally, I’m not surprised, since if temperatures are raising, that means that there’s more energy in the atmosphere, and that should result in more wind.

Posted in development | Leave a comment

Poor Man’s Climate Change exploration

The Swedish Meteorological & Hydrological Institute (SMHI) provide Open Data, that is, some of its huge databases on all things weather.

I downloaded data on temperature from an observation post furthest out in the Stockholm archipelago, daily data on temperatures starting 1949 up including July 2018, and selected noon (12:00) as the time of day of interest.

Below graphs show the evolution of temperature, daily and monthly noon averages for a period of almost 70 years. The trendlines provide the inevitable conclusion: temperatures are raising. Whether this is due to climate change or something else – you tell me…

trendsSvenskaHogarna_12SvenskaHogarna_11SvenskaHogarna_10SvenskaHogarna_9SvenskaHogarna_8SvenskaHogarna_6SvenskaHogarna_5SvenskaHogarna_4SvenskaHogarna_3SvenskaHogarna_2SvenskaHogarna_1SvenskaHogarna_7

Posted in Big Data, Data Analytics, Statistics | Tagged , , | Leave a comment

Scientific Gambling: Increasing your investment by factor 100 in 10 weeks

with a bit of skill, domain knowledge and not least guts, it’s fully possible to double, triple or increase initial stake by ecen larger factor, in just a few weeks. Of course, as always in any investment, these is a possibility of significant losses, but with some careful preparations and follow-up, you can indeed 100-fold hour money in 10 weeks.

IMG_1655

Posted in development | Leave a comment

Gambling – moving odds simulation

Ever thought about how bookies set the odds for events…?  The problem at hand for a bookie is to set the odds in such a way that he makes a profit, regardless of what outcome the event has.

The way bookies achieve this feat is twofold:

– moving odds, i.e. The odds for the event change depending on how the punters place their bets.

– adding a markup to the odds, i.e. lowering the odds just a tiny fraction.

Below a simulation where random punters place random amounts of bets on one of two outcomes, A or B.  The solid red and blue lines show the cumulative bets over 10 betting rounds, while the red & blue lines with ‘x’ shows the money at risk for respective outcome. The orange line shows the total anout of income, i.e sum of bets.

In the figure, the blue x- lime is above the orange line, which means that should the outcome of the event be A, then the bookie will lose money. To guard against this loss, the bookie will ‘markup’ the odds for event A, by lowering the odds a bit, typically 5-10%.

IMG_1652

Posted in development, Gambling | Tagged | Leave a comment

Setting moving odds

https://www.facebook.com/groups/374872559676462/permalink/386118851885166/

Posted in development | Leave a comment

Convolutional Neural Networks with KERAS – Image recognition

A quick test shot with KERAS, inspired by this tutorial using the MNIST dataset of more than 60000 images of hand written digits. Task at hand: correctly identify as many as possible of these 28 x 28 images, looking like this:

six

I’m flabbergasted….! In less than 70 lines (seven-zero!) of Python/KERAS-code, and after a training session of about 20-30 min on my laptop, the CNN is able to correctly identify 99.2% of the images….!

keras_cnn_example

These really powerful libraries are way cool – almost to the point where they take the fun & challange out of it…! 🙂

Continue reading

Posted in Big Data, Complex Systems, Data Analytics, KERAS, Machine Learning, Neural networks, Numpy, Python | Tagged , , , , , , , | 2 Comments

Scientific Gambling – Bayesian prediction & betting results from FIFA World Cup 2018

final_points

32 teams, 64 games.  3 different ranking models tested, FIFA’s official, a “wisdom-of-crowds” (static), and a dynamic version of the wisdom-of-crowds model.

Prediction results: 67% of game outcomes correctly predicted.

Betting results best strategy (max probability), with uniform betting on all 64 games : 32% profit (as measured over overall stake)

Notable: all three medalists, France, Croatia, Belgium are “outliers”, i.e. outside of a confidence interval of 89%, in all three ranking schemes.

betting_strategyprediction_results_M1linreg_comparision_FIFA Rankinglinreg_comparision_Static Rankinglinreg_comparision_Dynamic Ranking

Posted in Bayes, Data Analytics, FIFA, Gambling, Probability, PYMC, Python, Statistics | Tagged , , , , , | Leave a comment

ÅF Offshore Race – S/Y Singdoy WP ETA Prediction

     LAT   LON  COG  DIST  LEGTIME  CUMDIST  TOT_TIME              TIMEDELTA
0  59.32 18.09    0   nan      nan      nan       nan                    NaT
1  59.32 18.11  103  0.84     0.12     0.84      0.12 0 days 00:07:14.260800
2  59.32 18.16   83  1.45     0.21     2.30      0.33 0 days 00:19:41.160000
3  59.34 18.21   57  1.72     0.25     4.02      0.57 0 days 00:34:28.027199
4  59.35 18.24   48  1.36     0.19     5.39      0.77 0 days 00:46:09.969600
5  59.36 18.27   54  1.00     0.14     6.38      0.91 0 days 00:54:43.318800
6  59.37 18.32   70  1.60     0.23     7.99      1.14 0 days 01:08:27.783600
7  59.37 18.35  100  0.92     0.13     8.91      1.27 0 days 01:16:20.308800
8  59.37 18.37   78  0.80     0.11     9.70      1.39 0 days 01:23:09.283200
9  59.37 18.39  100  0.44     0.06    10.14      1.45 0 days 01:26:56.882400
10 59.36 18.41  109  0.75     0.11    10.90      1.56 0 days 01:33:24.627600
11 59.36 18.44  103  0.94     0.13    11.84      1.69 0 days 01:41:29.976000
12 59.37 18.45   35  0.60     0.09    12.44      1.78 0 days 01:46:37.246800
13 59.40 18.45  355  1.69     0.24    14.13      2.02 0 days 02:01:06.402000
14 59.43 18.38  320  3.05     0.44    17.18      2.45 0 days 02:27:17.182800
15 59.43 18.39   85  0.40     0.06    17.58      2.51 0 days 02:30:41.983199
16 59.43 18.41  129  0.57     0.08    18.15      2.59 0 days 02:35:32.841600
17 59.43 18.42  117  0.50     0.07    18.64      2.66 0 days 02:39:48.715200
18 59.42 18.47   96  1.47     0.21    20.12      2.87 0 days 02:52:26.234400
19 59.42 18.48   90  0.34     0.05    20.46      2.92 0 days 02:55:22.040400
20 59.41 18.52  122  1.42     0.20    21.88      3.13 0 days 03:07:32.091600
21 59.39 18.55  140  1.41     0.20    23.29      3.33 0 days 03:19:36.879600
22 59.39 18.57  121  0.54     0.08    23.83      3.40 0 days 03:24:13.053600
23 59.38 18.59  120  0.80     0.11    24.63      3.52 0 days 03:31:05.987999
24 59.37 18.61  125  0.80     0.11    25.43      3.63 0 days 03:37:59.746800
25 59.38 18.65   79  1.34     0.19    26.78      3.83 0 days 03:49:30.054000
26 59.38 18.67   86  0.51     0.07    27.28      3.90 0 days 03:53:52.069200
27 59.38 18.69   83  0.49     0.07    27.77      3.97 0 days 03:58:03.414000
28 59.37 18.71  103  0.74     0.11    28.52      4.07 0 days 04:04:26.529600
29 59.37 18.74  102  0.80     0.11    29.32      4.19 0 days 04:11:16.861200
30 59.37 18.75  111  0.58     0.08    29.89      4.27 0 days 04:16:13.166400
31 59.36 18.77  140  0.92     0.13    30.81      4.40 0 days 04:24:06.192000
32 59.31 18.82  153  2.99     0.43    33.80      4.83 0 days 04:49:44.367600
33 59.31 18.83  109  0.34     0.05    34.14      4.88 0 days 04:52:39.316800
34 59.30 18.85  114  0.92     0.13    35.07      5.01 0 days 05:00:34.138800
35 59.30 18.87  105  0.60     0.09    35.67      5.10 0 days 05:05:44.635200
36 59.30 18.89  105  0.54     0.08    36.21      5.17 0 days 05:10:23.052000
37 59.30 18.90   93  0.40     0.06    36.61      5.23 0 days 05:13:50.512800
38 59.30 18.92   97  0.50     0.07    37.11      5.30 0 days 05:18:05.382000
39 59.30 18.94   96  0.57     0.08    37.68      5.38 0 days 05:23:00.405600
40 59.30 18.96   87  0.63     0.09    38.32      5.47 0 days 05:28:26.130000
41 59.30 18.96  118  0.17     0.02    38.48      5.50 0 days 05:29:51.752400
42 59.29 18.97  133  0.48     0.07    38.96      5.57 0 days 05:33:57.142799
43 59.29 18.98  119  0.26     0.04    39.22      5.60 0 days 05:36:09.572399
44 59.26 19.01  146  1.76     0.25    40.98      5.85 0 days 05:51:17.042400
45 59.15 19.15  146  7.98     1.14    48.96      6.99 0 days 06:59:41.049600
46 58.10 19.42  172 63.54     9.08   112.50     16.07 0 days 16:04:16.392000
47 57.38 19.09  193 44.85     6.41   157.35     22.48 0 days 22:28:41.548800
48 56.88 18.25  222 40.73     5.82   198.08     28.30 1 days 04:17:50.445600
49 56.89 18.12  279  4.28     0.61   202.37     28.91 1 days 04:54:33.847200
50 56.93 18.12    0  2.26     0.32   204.63     29.23 1 days 05:13:57.424800
51 57.06 18.17   12  8.05     1.15   212.68     30.38 1 days 06:22:57.842400
52 57.07 18.17  350  0.94     0.13   213.62     30.52 1 days 06:31:01.639200
53 57.12 18.17    2  2.88     0.41   216.50     30.93 1 days 06:55:44.068800
54 57.21 18.09  335  6.13     0.88   222.63     31.80 1 days 07:48:15.634800
55 57.27 18.07  349  3.32     0.47   225.95     32.28 1 days 08:16:41.048400
56 57.37 18.12   15  6.05     0.86   232.00     33.14 1 days 09:08:32.002799
57 57.47 18.10  353  6.22     0.89   238.22     34.03 1 days 10:01:51.873600
58 57.55 18.09  353  4.87     0.70   243.08     34.73 1 days 10:43:34.028400
59 57.61 18.21   45  5.61     0.80   248.69     35.53 1 days 11:31:39.914399
60 57.64 18.29   55  3.00     0.43   251.70     35.96 1 days 11:57:25.038000
61 59.16 19.14   16 94.69    13.53   346.39     49.48 2 days 01:29:03.181200
62 59.28 18.94  320  9.87     1.41   356.26     50.89 2 days 02:53:37.388400

IMG_1623IMG_1624IMG_1625

Posted in development | Leave a comment

An area preserving map projection

area preserving map projection

Posted in Maritime Technology, Nautical Information Systems | Tagged | Leave a comment

Capturing NMEA sentences over WiFi using Python

In order to figure out how the NMEA-WiFi Gateway deals with clients, e.g. if it expects any “handshake” or any other communication setup protocol, I decided to write a simulator mimicing the gateway, and then using iRegatta 2 from Zifago to verify that it can read the simulated NMEA messages sent by my “soft” gateway.

So, in the video above, my laptop (on the right) is pretending to be the NMEA-WiFi gateway, constantly broadcasting UDP packages containing NMEA sentences onto the network, and on the left my iPad running iRegatta 2 is collecting them and displaying the information obtained from the sentences.

With the communication between the Gateway and its clients now figured out, I’m able to collect full race data, including multiday races, from all the instruments onboard onto my laptop for after race “post mortem” race performance analysis.

Posted in Data Analytics, Maritime Technology, Nautical Information Systems, NMEA, Numpy, performance, Python, Simulation, TCPIP | Tagged , , , , , , , , , , , , | Leave a comment