Where to BBQ?

In 2021 I wanted to be part of a GovHack team. I was inspired by Simon Victory‘s presentation on how experience as it sounded like a fun way to meet other people also interested in data and make something useful. Unfortunately the ACT went into lockdown a few weeks before the 2021 competition so it wasn’t possible to meet in person and I decided to tackle a problem by myself.

After looking over abundance of datasets available and match them the GovHack challenges, I decided to integrate ACT government data assets on public amenities such as BBQs, toilets, bubblers and playgrounds. The ACT government has datasets on the location and types of different amenities on their public data portal, they even have maps which chart the different locations of all the different amenities. Unfortunately the maps only show one type of amenity this means there are different maps for BBQs, toilets, dog parks and therefore you can’t see which BBQs have toilets near them or which parks have bubblers etc. .

Putting all the amenities on one map would be too messy, so I could only focus on one type of amenity. There are already apps for public toilets so I thought something for BBQs could be good. My idea was to create a map of BBQs and then add filters for the type of BBQ (gas, electric or wood) and if it had toilets, bubblers or a playground near by, the end result would be a map of BBQ locations over the ACT that met your needs.

It was a two stage process to build the tool, first was collecting and integrating all the ACT location data together . The second stage was actually presenting it in a visually pleasing manner. Collecting the data was simple, the ACT government provides a very easy to use API and clean data. There are a lot of BBQs which are clustered, instead of displaying these individually it made sense to group them together. I didn’t want to go through the bother of hand crafting groupings so I used a Density-based spatial clustering of applications with noise(DBSCAN) to find groups of BBQs, all I had to do was manually tweak two parameters, the distance between nodes and number of nodes in a cluster to get good groupings of BBQs. With groups of BBQs now worked out I had to figure out which had amenities close to them, this meant doing a cross join of all amenities with all BBQs and then figuring out if they were within the 100m distance threshold. As all the BBQs and the amenities were within the ACT, there wasn’t too much data and hence a cross join was feasible, however I don’t know how I would go about making this more efficient if I wanted to extend this to a bigger region, all of Australia.

With the data sufficiently wrangled I could move onto step two, map making. This is the first time I’ve made an interactive map and there are a plethora of options, I’m familiar with Python and I found the Bokeh visualisation framework was simple to use in Python and easy to export to the web. After a bit of tinkering around I was able to add custom filtering widgets, and thus was born my GovHack submission.

Bokeh Plot

You can find the original submission here, for a 46 hour submission I am pretty proud of myself, I even got an Honourable Mention as part of the Reimagining Government Services challenge. It needs more polish and it is mobile unfriendly, I could have made use of a designer.

Later on I made a version where all amenities are displayed, it’s a bit messy but provides information on even more amenities like dog parks and basketball courts, you can find it here.

The ACT government has done a really great job recording all the amenities and their locations, but their visualisation is analogous to a default excel chart, useful but so much utility is locked away. A little bit of work can provide a whole lot more value and I hope you find it useful. I sure did.

Time in the market vs Timing the market

Trying to time the perfect moment to buy and sell assets is difficult, most fund managers investing in a particular asset class don’t achieve the index of that class. The academic advice is to invest in a low fee fund that replicates the index, but it isn’t risk free, indexes can fall. Assume you went back in time, bought an asset for a fixed period of time, and then sold it once the time is expired, depending on what day you went back to you would have a different return.

This visualisation shows how changing the amount of time holding an asset changes the distribution of your returns.

How many weeks are you holding for?

- Data comes from Yahoo Finance(YF) which does not correctly report dividends.
 - Returns are based on close prices and assumes dividends are immediately reinvested. 
 - The average return and variation is the geometric mean and standard deviation of the returns.
 - Closing prices may sometimes be negative, it is capped at 1 cent to keep the results sensible
 - Return values are capped at the first percentile and ninety-ninth percentile to give reasonable results for highly volatile assets. 
 - Past performance doesn't guarantee future results.