Break Detection on Borussia Dortmund stock prices - an exhaustive quest for the optimal h-parameter of BFAST - Part I - The Data
Imagine we have the perfect time series. Daily values with 100% accuracy. And imagine we know the driving forces for the course of the time series. How beautiful would that be. Well, welcome to the world of finance & soccer.
The Objective
In this blog post I have a closer look at the stock prices of the sports club Borussia Dortmund GmbH & Co. KGaA. I use the BFAST
R package for detecting and characterizing abrupt changes within the trend component of the time series while searching for the optimal h-parameter. Furthermore, I point to possible reasons behind the abrupt changing prices by means of soccer game results (of the Ballspielverein Borussia 09 e.V. Dortmund, commonly known as Borussia Dortmund, BVB, or simply Dortmund), player transfers or outcome of FIFA Soccer World Cups.
1. Historical Stock Prices
The stock of Borussia Dortmund GmbH & Co. KGaA was floated on the stock market in October 2000 and is listed in the General Standard of Deutsche Börse AG (Wikipedia). I am using the daily stock closing prices from March 2001 until May 2018 (source: https://finance.yahoo.com - historical data - frequency:daily - BVB). Trading days are on working days from Monday until Friday. Currency is in Euro.
2. Borussia Dortmund Game Results
I scraped all Borussia Dortmund soccer match details from weltfussball.de starting with the 2000 / 2001 season until 2017 / 2018. The provided data contain the following information (tiny subset):
Round | Date | Time | Location | Competition | Opponent | Result |
---|---|---|---|---|---|---|
Gruppe H | 26.09.2017 | 20:45 | H | Champions League 2017/2018 | Real Madrid | 1:3 (0:1) |
Gruppe H | 17.10.2017 | 20:45 | A | Champions League 2017/2018 | APOEL Nikosia | 1:1 (0:0) |
32. Spieltag | 29.04.2018 | 18:00 | A | Bundesliga 2017/2018 | Werder Bremen | 1:1 (1:1) |
33. Spieltag | 05.05.2018 | 15:30 | H | Bundesliga 2017/2018 | 1. FSV Mainz 05 | 1:2 (1:2) |
1. Runde | 12.08.2017 | 15:30 | A | DFB-Pokal 2017/2018 | 1. FC Rielasingen-Arlen | 4:0 (2:0) |
Achtelfinale | 20.12.2017 | 20:45 | A | DFB-Pokal 2017/2018 | Bayern München | 1:2 (0:2) |
I filtered all game results for the most important competitions where Borussia Dortmund participated, which are the
- Bundeliga (National League),
- DFB-Pokal (National Cup)
- Champions League &
- Europa League.
Furthermore, results from the Ligapokal, Supercup, qualification games for the
Champions League and any friendly matches were excluded. I coloured all games according to the results ( Defeat, Draw and Win) and marked if the game was played at Home (the home from BVB is the Signal Iduna Park with a capacity of 80.720 spectators).When mouse is over point elements, tooltips will display additional infos in every graph.
3. Historical Stock Prices with BVB Game Results
Each dataset by itself doesn’t bring much of information, but if we combine the stock prices with games results we can see some patterns emerge. In this plot I also added the coach history.
Season 2001 - 2002 & 2002 - 2003
In 2002, Borussia Dortmund won their third Bundesliga title. Dortmund had a remarkable run at the end of the season to overtake Bayer Leverkusen, securing the title on the final day. Manager Matthias Sammer became the first person in Borussia Dortmund history to win the Bundesliga as both a player and manager. In the same season, Borussia lost the final of the 2001-02 UEFA Cup to Dutch side Feyenoord. (Wikipedia)
Season 2003 - 2004 & 2004 - 2005
Dortmund’s fortunes then steadily declined for a number of years. Poor financial management led to a heavy debt load and the sale of their Westfalenstadion grounds. The situation was compounded by failure to advance in the 2003-04 UEFA Champions League, when the team was eliminated on penalties in the qualifying rounds by Club Brugge. In 2003, Bayern Munich loaned 2 million Euro to Dortmund for several months to pay their payroll. Borussia was again driven to the brink of bankruptcy in 2005, the original 11 Euro value of its shares having plummeted by over 80% on the Frankfurter Wertpapierbörse (Frankfurt Stock Exchange). The response to the crisis included a 20% pay cut for all players. (Wikipedia)
Season 2005 - 2006 & 2006 - 2007
In 2006, in order to reduce debt, the Westfalenstadion was renamed “Signal Iduna Park” after a local insurance company. The naming rights agreement ran until 2016. The stadium is currently the largest football stadium in Germany with a capacity of 80,720 spectators, and hosted several matches in the 2006 World Cup, including a semi-final. Borussia Dortmund enjoys the highest average attendance of any football club in Europe, at 80,478 per match (2010-11).
Dortmund suffered a miserable start to the 2005-06 season, but rallied to finish seventh. The club failed to gain a place in the UEFA Cup via the Fair Play draw. The club’s management recently indicated that the club again showed a profit; this was largely related to the sale of David Odonkor to Real Betis and Tomás Rosický to Arsenal.
In the 2006-07 season, Dortmund unexpectedly faced serious relegation trouble for the first time in years. Dortmund went through three coaches and appointed Thomas Doll on 13 March 2007 after dropping to just one point above the relegation zone. Christoph Metzelder also left Borussia Dortmund on a free transfer. (Wikipedia)
Season 2007 - 2008 & 2008 - 2009
In the 2007-08 season, Dortmund lost to many smaller Bundesliga clubs. Despite finishing 13th in the Bundesliga table, Dortmund reached the DFB-Pokal Final against Bayern Munich, where they lost 2-1 in extra time. The final appearance qualified Dortmund for the UEFA Cup because Bayern already qualified for the Champions League. Thomas Doll resigned on 19 May 2008 and was replaced by Jürgen Klopp. (Wikipedia)
Season 2009 - 2010 & 2010 - 2011
In the 2009-10 season, Klopp’s Dortmund improved on the season before to finish fifth in the Bundesliga to qualify for the UEFA Europa League. The team missed an opportunity to qualify for the Champions League by failing to beat eighth-place VfL Wolfsburg and 14th-place SC Freiburg in the final two matches of the campaign.
Entering the 2010-11 season, Dortmund fielded a young and vibrant roster. On 4 December 2010, Borussia became Herbstmeister (“Autumn Champion”), an unofficial accolade going to the league leader at the winter break. They did this three matches before the break, sharing the record for having achieved this earliest with Eintracht Frankfurt (1993-94) and 1. FC Kaiserslautern (1997-98). On 30 April 2011, the club beat 1. FC Nürnberg 2-0 at home, while second-place Bayer Leverkusen lost, leaving Dortmund eight points clear with two games to play. This championship equaled the seven national titles held by rivals Schalke 04, and guaranteed a spot in the 2011-12 Champions League group stages. (Wikipedia)
Season 2011 - 2012 & 2012 - 2013
One year later, Dortmund made a successful defense of its Bundesliga title with a win over Borussia Mönchengladbach, again on the 32nd match day. By the 34th and final match day, Dortmund set a new record with the most points-81-ever gained by a club in one Bundesliga season. This was surpassed the following season by Bayern Munich’s 91 points. The club’s eighth championship places it third in total national titles, and players will now wear two stars over their uniform crest in recognition of the team’s five Bundesliga titles. Notable names from the winning roster include Lucas Barrios, Mario Götze, Neven Subotic, Mats Hummels, Robert Lewandowski, Shinji Kagawa, Lukasz Piszczek, Jakub Blaszczykowski, Kevin Großkreutz, Ivan Perisic and Ilkay Gündogan.
The club capped its successful 2011-12 season by winning the double for the first time by beating Bayern 5-2 in the final of the DFB-Pokal. Borussia Dortmund are one of four German clubs to win the Bundesliga and DFB-Pokal double, along with Bayern Munich, 1. FC Köln and Werder Bremen. The club was voted Team of the Year 2011 at the annual Sportler des Jahres (German Sports Personality of the Year) awards.
Borussia Dortmund ended the 2012-13 season in second place in the Bundesliga. Dortmund played in their second UEFA Champions League Final against Bayern Munich in the first ever all-German club final at Wembley Stadium on 25 May 2013, which they lost 2-1. (Wikipedia)
Season 2013 - 2014 & 2014 - 2015
The 2013-14 season started with a five-game winning streak for Dortmund, their best start to a season. Despite such a promising start, however, their season was hampered by injuries to several key players, seeing them stoop as low as fourth place in the table, and with a depleted squad could go only as far as the quarter-finals of the Champions League, losing 3-2 on aggregate to Real Madrid.
Nevertheless, Dortmund managed to end their season on a high note by finishing second in the Bundesliga and reaching the 2014 DFB-Pokal Final, losing 0-2 to Bayern in extra time.
They then began their 2014-15 season by defeating Bayern in the 2014 DFL-Supercup 2-0. However, this victory would not be enough to inspire the squad to a solid performance at the start of the ensuing season, with Dortmund recording various results such as a 0-1 loss to Hamburger SV and two 2-2 draws against VfB Stuttgart and Bundesliga newcomers Paderborn 07.
During the winter, Dortmund fell to the bottom of the table on multiple occasions, but managed to escape the relegation zone after four consecutive wins in February. On 15 April 2015, Jürgen Klopp announced that after seven years, he would be leaving Dortmund. Four days later, Dortmund announced that Thomas Tuchel would replace Klopp at the end of the season. Klopp’s final season, however, ended on high note, rising and finishing seventh after facing relegation, gaining a DFB-Pokal final with VfL Wolfsburg and qualifying for the 2015-16 Europa League. (Wikipedia)
Season 2015 - 2016 & 2016 - 2017
In the 2015-16 season, Dortmund started off on a high, winning 4-0 against Borussia Mönchengladbach on the opening day, followed by five-straight wins which took them to the top of the Bundesliga. After the eighth matchday, they were surpassed by Bayern Munich following an unlucky draw with 1899 Hoffenheim. Dortmund kept their performances up, winning 24 out of 34 league games and becoming the best Bundesliga runner-up team of all time. In the Europa League, they advanced to the quarter-finals, getting knocked out by a Jürgen Klopp-led Liverpool in a dramatic comeback at Anfield, where defender Dejan Lovren scored a late goal to make it 4-3 to the Reds and 5-4 on aggregate.
In the 2015-16 DFB-Pokal, for the third-straight year Dortmund made it to the competition final, but lost to Bayern Munich on penalties.
On 11 April 2017, three explosions occurred near the team’s bus on its way to a Champions League match against AS Monaco at the Signal Iduna Park. Defender Marc Bartra was injured, and taken to hospital. Dortmund went on to lose the game 2-3 to AS Monaco. Dortmund’s manager, Thomas Tuchel, blamed the loss as a result of an ignorant decision by UEFA. UEFA went on to say that the team made no objection to playing, and that the decision was made in compliance with the club and local law enforcement. In the second leg, Dortmund went on to lose 1-3, leaving the aggregate score at 3-6, and seeing them eliminated from that year’s UEFA Champions League. (Wikipedia)On 11 April 2017, three explosions occurred near the team's bus on its way to a Champions League match against AS Monaco at the Signal Iduna Park.
Season 2017 - 2018
Bottom line
This blog post showed you the data I am going to use for detecting and characterizing abrupt changes in a time series. Part II, is going to cover the BFAST
function and the search for its optimal h-parameter.
If you have any questions, suggestions or spotted a mistake, please use the comment function at the bottom of this page.
Previous blog posts are available within the blog archive. Feel free to connect or follow me on Twitter - @Mixed_Pixels.