<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Philippe's Official Website</title>
    <subtitle>Personal website</subtitle>
    <link rel="alternate" href="http://www.de-brouwer.com/" />
    <link rel="self" href="http://www.de-brouwer.com/feed.xml" type="application/atom+xml" />
    <id>http://www.de-brouwer.com/</id>
    <updated>2026-03-02T11:44:50Z</updated>
    
    <author>
        <name>Philippe J.S. De Brouwer</name>
        <email>philippe@de-brouwer.com</email>
        <uri>http://www.de-brouwer.com/</uri>
    </author>
    
    
        <entry>
            <title>Future Skills in the AI and post-AI era</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2024/03/17/Future-Skills/" type="text/html" />
            <id>http://www.de-brouwer.com/2024/03/17/Future-Skills/</id>
            <updated>2024-03-17T17:55:00Z</updated>
            
            <summary type="html">Today, with Wikipedia and Google in our pockets, we no longer need to remember all historical details, but we need to have an opinion and the willingness to learn. Every movie-maker, every game designer, every author seems to have a political motivation and sitting back and enjoying is no longer an option. After watching a recent movie about Cleopatra, Napoleon, Vikings, or the Roman Emperors one should have the reflex to verify facts. For example, one will notice that each of those movies require a voluminous book to enumerate inaccuracies. Even more important is to understand why the movie-maker did history such injustice. The lesson is that humans are inferior to machines when it comes to remembering facts. This has been established a while ago, and education is already adapting to it. However, there is much more to come.</summary>
            <content type="html">&lt;p&gt;Today, with Wikipedia and Google in our pockets, we no longer need to remember all historical details, but we need to have an opinion and the willingness to learn. Every movie-maker, every game designer, every author seems to have a political motivation and sitting back and enjoying is no longer an option. After watching a recent movie about Cleopatra, Napoleon, Vikings, or the Roman Emperors one should have the reflex to verify facts. For example, one will notice that each of those movies require a voluminous book to enumerate inaccuracies. Even more important is to understand why the movie-maker did history such injustice. The lesson is that humans are inferior to machines when it comes to remembering facts. This has been established a while ago, and education is already adapting to it. However, there is much more to come.&lt;/p&gt;

&lt;p&gt;With the benefit of hindsight, all changes seem obvious. However, it is nearly impossible to predict inventions and changes that we yet have to see. For example, since the 1950s a career in IT and programming has been guaranteed to be a great choice. With the advent of AI software engineers (like Devin, last week) that will soon be over. Till 2 years ago, the best advice one could give a student was to study and be ambitious in the pursuit of the highest intellectual challenges. That is no longer a silver bullet. It appears that intellectual jobs are easier to be replaced by machines than jobs that require navigating the complexities of the physical world.&lt;/p&gt;

&lt;p&gt;We are at a turning point of history, and just as in the 1910s, we had no idea what the car or plane would do to our landscape, habits, health, cities, warfare, etc. Today we have only faint clues what AI could do to the fabric of our society, but we have no crystal ball that tells the future.&lt;/p&gt;

&lt;p&gt;While we believed that we would be superior in thinking, strategy (eg. chess and go), strategy with imperfect information (e.g Stratego), creativity, reading emotions, guessing intend, etc. All of this became history in the last decade. Robots are better in strategy games, are already fantastic artists, creators, and they are genuinely creative, etc. On top of this, machines are able to digest more information in minutes than any person could do in a whole life.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;People that will still be needed are:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;empathic leaders&lt;/strong&gt;: with the Doomsday Clock at 90 seconds before midnight the world needs more than ever people with an open mind, people who want to do good and make the ethical choices even when no-one is watching, people who want humanity to succeed, people who can bring diverse individuals together;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;physical workers&lt;/strong&gt;: people finishing the build of a house, working on high voltage cables, carers and nurses. These jobs are hard to replace by machines and humans will need to do them for a while.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;scientists&lt;/strong&gt; to prepare the next industrial revolution beyond AI. Periods of economic growth seem to be a good way to prevent destructive wars (e.g. both world wars happened in periods of economic depression). After AI, we will see the revolution of quantum computers, and after that I’m rooting for nanotechnology and biotechnology. While AI will help dramatically in those endeavors, the world needs scientists to prepare those future revolutions. The scientific and technological challenges have been increasing throughout human history, and we will need AI to help. However, only the scientific method has brought progress, and even if we could, we should not leave this up to AI alone;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;original thinkers&lt;/strong&gt; who value virtue, critical thinkers who can see through a world of deep fakes. In a world where everything could be fake, it becomes easy to be misled. The world needs more people who act intentionally virtuously, especially when no one is watching;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;people who value the physical world&lt;/strong&gt;, soon it will be a delightful alternative to hide in a fantasy world of virtual reality; it will most likely become an addiction similar to narcotics causing people to become dysfunctional citizens. This addiction seems much more dangerous than alcohol or narcotics. Indulging in excessive gaming, VR, or immersive movies is legal and easy to start and much more than narcotics one can exactly choose to be what one wants. On top of that, VR will soon be nearly indistinguishable from reality, and hence an excellent escape the complexity and frustration of their physical existence;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;people with professions that we don’t have now&lt;/strong&gt;. Till a few months ago, the job “prompt engineer” did not exist. Thousands of great professional choices that exist today didn’t exist 20 years ago or have been transformed dramatically. Since it is not possible today to predict what will be a good job in the next decade, it is essential to be flexible, open-minded, and continue to learn and adapt. What we need is lifelong learners.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Skills and professions that will disapear&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It would be equally valuable to think of &lt;strong&gt;professions that won’t be needed anymore&lt;/strong&gt; or will profoundly change due to the mass adoption of AI. Jobs such as medical doctors, judges, artists of all kinds, programmer, designer, architect, driver, food delivery, etc. will still be important, but AI will dramatically change how it will be done. The spectrum of change will be from total annihilation of the human in the role (soon to happen for e.g. food delivery, personal trainer, etc.) to AI assisted human. Even for those jobs where humans make the ultimate decisions, it is plausible to think that a model of mass solutions executed by robots and humans considering the outliers – think along the lines of the 80/20 rule. For example 80% of medical diagnoses can be done by a robot (e.g. diagnosis of a common cold), and only 20% of patients consult a doctor. While today, most people value the human touch (for a driver, personal trainer, or doctor for example) soon enough AI will outperform its human counterparts so much that the human alternative will be seen as inferior. No human doctor, for example, can keep pace with the vast amount of research being produced, monitor constantly parameters such as weight, and hundreds of molecules in urine and excrement as your personal medical assistant connected to sensors your toilet can do every day. Within decades humans will be far left behind in the precision of their diagnosis, quality of follow up, and personalization of the service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keeping this in mind, I would argue that the following skills will be a good investment:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Critical Thinking and Problem-Solving.&lt;/strong&gt; The ability to approach problems from different angles, think critically about possible solutions, and solve them effectively is crucial. Using the scientific method to distinguish fake from fact.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Digital Literacy and Coding.&lt;/strong&gt; While the number of programmers will be more limited, it will be critical to audit machine generated code, we need a lot more understanding to keep machines benevolent and transparent, and we need to keep making progress.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Science.&lt;/strong&gt; As AI and machine learning become more ubiquitous, understanding how to interpret and work with data remains a valuable skill. This also ties in with understanding what conclusions are true and which not. Furthermore, while bias in data and models can be addressed there is no silver bullet and ethical choices become more important (e.g. the famous question of who the AI driver should kill in case killing cannot be avoided, or should we –in order to avoid gender discrimination– not use gender for car insurance and hence increase prices for all? Or should ladies finance the damage done by men that driver more reckless?)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Emotional Intelligence and Communication.&lt;/strong&gt; The ability to understand and manage emotions, and communicate effectively will remain vital. AI can help here a lot, but it will remain important to be able to speak up in a meeting and formulate a coherent opinion. Sure, we can have AI that puts ideas in our mind or on our AI eye lenses, but that is unlikely to be our opinion&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resilience, Motivation, Leadership, Social Influence, and Technological Literacy.&lt;/strong&gt; While an AI manager will soon be possible, in inspiring leader is bound to be human for long decades.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Adaptability and Lifelong Learning:&lt;/strong&gt; The rapid pace of technological change has brought us to a volatile, uncertain, complex and ambiguous world (aka “VUCA world”), this means that adaptability and commitment to lifelong learning are essential.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integrity, self-awareness, courage, and a deep understanding of ethics.&lt;/strong&gt; To learn from mistakes and improve, people who own their mistakes, people who understand that their triggers and weaknesses are their responsibility, people who need no safe place to hide from facts and opinions, people who own their thoughts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;People who accept their fate and focus on what is within their control.&lt;/strong&gt; People who show resilience in the face of adversary, take responsibility over own thoughts and actions, don’t look for excuses or an easy way out, but have the courage to play the cards they have been dealt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, the AI and post-AI era will demand a diverse set of skills. As we navigate this rapidly evolving landscape, critical thinking and problem-solving will be paramount, enabling us to discern fact from fiction and approach challenges from various perspectives. Digital literacy and coding will remain important, not just for creating new technologies, but for understanding and auditing the ones that already exist. Data science skills will be invaluable as we strive to make sense of the vast amounts of information generated by AI systems. In order for humans to remain in the driving seat, school should focus on production passionate people that follow the ethos of a virtuous life and can defend an ethical stance.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Create Your First Covid-19 Related App with R and Shiny</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2021/05/14/Your-Own-Interactive-App/" type="text/html" />
            <id>http://www.de-brouwer.com/2021/05/14/Your-Own-Interactive-App/</id>
            <updated>2021-05-14T19:13:00Z</updated>
            
            <summary type="html">The library {shiny} provides the tools to build interactive html-apps from your data project. It is the ideal way for users to experiment with the data and gain deeper insights than what one can expect from a static report.</summary>
            <content type="html">&lt;p&gt;The library {shiny} provides the tools to build interactive html-apps from your data project. It is the ideal way for users to experiment with the data and gain deeper insights than what one can expect from a static report.&lt;/p&gt;

&lt;p&gt;You might know my &lt;a href=&#34;/about/covid.html&#34;&gt;Covid-19 Dashboard&lt;/a&gt;. It was one of the early dashboards build in March 2020 and remains one of the only dashboards that allows you to build your own models, visualise data in many ways, and draw your own conclusions. &lt;/p&gt;

&lt;p&gt;It is a little too ambitious to explain all details in this dahsboard in this tuturial, but we will get you started with the basics. &lt;/p&gt;

&lt;p&gt;While it is not strictly necessary to use &lt;a href=&#34;https://www.rstudio.com/products/rstudio/&#34;&gt;RStudio&lt;/a&gt;, it will soften the learning curve and make your more productive.&lt;/p&gt;

&lt;p&gt;In RStudio, select:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;File New&lt;/code&gt; (or use the shortcut &lt;img src=&#34;/assets/img/post_shiny_rstudio-new.png&#34;&gt;)&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Shiny Web App ...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fill out the form: select a name for your app, leave the single file option and select a directory where to save the app.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Create&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is all: you are now presented with the code of the app in RStudio. You can execute it by clicking &lt;code&gt;runapp&lt;/code&gt;: &lt;img src=&#34;/assets/img/post_shiny_rstudio-runapp.png&#34;&gt;.
The application that we have now is fully functioning, but does not contain the content that we desire.&lt;/p&gt;

&lt;p&gt;The mains structure is as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
library(shiny)
ui &lt;- fluidPage(
   # The presentation (html) goes here and
   # input variables are created here.
)

server &lt;- function(input, output) {
    # Server logic: output variables are defined here
}

# This line runs the app, using the ui and the server
shinyApp(ui = ui, server = server)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In the user interface, it is the function &lt;code&gt;fluidPage()&lt;/code&gt; that sets the general presentation aspects. This particular function will use the &lt;code&gt;css&lt;/code&gt; from Twitter&amp;rsquo;s &lt;a href=&#34;https://getbootstrap.com/&#34;&gt;boostrap&lt;/a&gt; framework. 
The arguements passed to that function generate the &lt;code&gt;html&lt;/code&gt;. Usually the names of the functions are self explanatory (e.g. &lt;code&gt;titlePanel()&lt;/code&gt; generates a tittle panel with the string variable that it takes as argument).&lt;/p&gt;

&lt;p&gt;The function &lt;code&gt;sliderInput()&lt;/code&gt; will produce a slider that allows the user to choose a number. Its first argument is a string variable (in this case &amp;ldquo;bins&amp;rdquo;). This will make the variable &lt;code&gt;input$bins&lt;/code&gt; available in the server function, which allows us to access the number that is chosen by the user.&lt;/p&gt;

&lt;p&gt;The plot generated by the server function, can be accessed via special purpose functions. In our case the plot can be retrieved via the function &lt;code&gt;plotOutput()&lt;/code&gt;. That function takes one string argument that is the same name as the &lt;code&gt;output&lt;/code&gt; variable generated by the server function.&lt;/p&gt;

&lt;p&gt;In the server function, we use the input variables to generate the output variables (e.g. &lt;code&gt;output$distPlot&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Now that we understand the basics, we can start modifying the skeleton app to suit our needs. We will need&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;to connect to our data&lt;/li&gt;
&lt;li&gt;change the ui&lt;/li&gt;
&lt;li&gt;change the server function&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To connect to live (or at least last night&amp;rsquo;s update), we will connect to the data. In order to keep the code in the app clean and readable we will move the functions for this to a new file &lt;code&gt;global.R&lt;/code&gt;. This file is best placed in the same directory as the file &lt;code&gt;app.R&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will download a copy of the data that resides on [githubusercontent.com], immediately load all libraries that we need and add functionality to clean up the data.&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
library(tidyverse)
library(plotly)
library(lubridate)
library(flexdashboard)

get_data &lt;- function() {
  lnk_conf &lt;- &#39;https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv&#39;
  lnk_death &lt;- &#39;https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv&#39;
  lnk_rec &lt;- &#39;https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv&#39;

  copy_data &lt;- function (theLink, theLabel) {
    d1 &lt;- read_csv(theLink)
    d1 &lt;- d1 %&gt;% gather(key=`Date`,value=theLabel,-&#34;Province/State&#34;, -&#34;Country/Region&#34;, -&#34;Lat&#34;,  -&#34;Long&#34;)
    d1$Date &lt;- ymd(as.Date(d1$Date, format=&#34;%m/%d/%Y&#34;))
    d1$`Province/State` &lt;- ifelse(is.na(d1$`Province/State`), d1$`Country/Region`, d1$`Province/State`) # replace empty state names by country names
    d1[complete.cases(d1),]
    colnames(d1) &lt;- c(&#39;Province&#39;, &#39;Country&#39;, &#39;Lat&#39;, &#39;Long&#39;, &#39;Date&#39;, theLabel)
    d1
  }
  d_conf &lt;- copy_data(lnk_conf,  &#39;Confirmed&#39;)
  d_recv &lt;- copy_data(lnk_rec,   &#39;Recovered&#39;)
  d_deat &lt;- copy_data(lnk_death, &#39;Deaths&#39;)
  #max(d_conf$Date)

  d1 &lt;- left_join(d_conf, d_recv, by =  c(&#39;Province&#39;, &#39;Country&#39;, &#39;Lat&#39;, &#39;Long&#39;, &#39;Date&#39;))
  d1 &lt;- left_join(d1, d_deat, by =  c(&#39;Province&#39;, &#39;Country&#39;, &#39;Lat&#39;, &#39;Long&#39;, &#39;Date&#39;))
  d1 %&gt;% replace_na(list(Confirmed = 0, Recovered = 0, Deaths = 0))  %&gt;%
    mutate(Sick = Confirmed - Recovered - Deaths)
}

# takes the data from get_date() and eliminates the Province/State thing
get_dts_countries &lt;- function(d) {
  d1 &lt;- d %&gt;%
    group_by(Date,Country) %&gt;%
    summarise(sum(Confirmed), sum(Recovered),sum(Deaths), sum(Sick))
  colnames(d1) &lt;- c(&#39;Date&#39;, &#39;Country&#39;, &#39;Confirmed&#39;, &#39;Recovered&#39;, &#39;Deaths&#39;, &#39;Sick&#39;)
  as.data.frame(d1)  # to make the grouping permanent
}

# Get the data timeset for one country
get_dts_country &lt;- function(d, theCountry = &#39;ALL&#39;) {
  if (theCountry == &#39;ALL&#39;) {
    d1 &lt;- d %&gt;%
      group_by(Date) %&gt;%
      summarise(sum(Confirmed, na.rm = TRUE), sum(Recovered, na.rm = TRUE),sum(Deaths, na.rm = TRUE), sum(Sick, na.rm = TRUE))
    colnames(d1) &lt;- c(&#39;Date&#39;, &#39;Confirmed&#39;, &#39;Recovered&#39;, &#39;Deaths&#39;, &#39;Sick&#39;)
  } else {
    d1 &lt;- d %&gt;% filter(Country == theCountry)
  }
  as.data.frame(d1) # to make the grouping permanent
}

# get_last_numbers
# returns the last value of the time series
get_last_numbers &lt;- function(d, theCountry = &#39;ALL&#39;) {
  d1 &lt;- get_dts_country(d = d, theCountry = theCountry)
  # remove date and country name so we can use arithmemtic on the whole vector:
  if (theCountry != &#39;ALL&#39;) d1 &lt;- d1[,-2]
  as.vector(d1[d1$Date == max(d1$Date),])  # data at last mindnight
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Later, we will add more functionality in &lt;code&gt;global.R&lt;/code&gt;, but we will first make sure that it loads properly. To do that we simply place the line &lt;code&gt;source(&amp;quot;global.R&amp;quot;)&lt;/code&gt; somewhere in the beginning of &lt;code&gt;app.R&lt;/code&gt; (for example just after the line &lt;code&gt;library(shiny)&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;We can now run the app and it should load without errors. When we click &lt;code&gt;Run App&lt;/code&gt; (only visible when the file &lt;code&gt;app.R&lt;/code&gt; is selected &amp;ndash; this won&amp;rsquo;t be visible when the file &lt;code&gt;global.R&lt;/code&gt; is on the screen in RStudio).&lt;/p&gt;

&lt;p&gt;At this point, the app should load and look exactly the same as it did originally. &lt;/p&gt;

&lt;p&gt;If &lt;code&gt;Run App&lt;/code&gt; failed, then it is most probably due to the fact that R cannot find the file &lt;code&gt;global.R&lt;/code&gt; &amp;ndash; hence check if they both are in the same directory.&lt;/p&gt;

&lt;p&gt;The functions of &lt;code&gt;global.R&lt;/code&gt; are now loaded, but not yet executed. To get this done, we need to modify the file &lt;code&gt;app.R&lt;/code&gt;. We will load the data and immediately prepare some key data, such as the last date and numbers:
&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
gc_dts_countries &amp;lt;- get_data()
gc_countries     &amp;lt;- c(&amp;#39;ALL&amp;#39;, unique(gc_dts_countries$Country))
gc_last_date     &amp;lt;- max(gc_dts_countries$Date)
gc_first_date    &amp;lt;- min(gc_dts_countries$Date)
gc_impact_types  &amp;lt;- colnames(gc_dts_countries)[3:6]
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Again, we can run the app and check if all works fine. It should load slower and produce more output in the &lt;code&gt;Console&lt;/code&gt; (lower left workspace in RStudio), but still look as it did originally.&lt;/p&gt;

&lt;p&gt;We will now add a country selection and present some basic data related to that country. To get this done we need a few thing simulteneously in place: the user interface and the server functionality.&lt;/p&gt;

&lt;p&gt;We will now delete the functions of the skeleton app, add the functionality of selecting a country and show an elegant box with the latest number of infections in that country. When the app starts, the selection is &lt;code&gt;ALL&lt;/code&gt; (the sum of all countries).&lt;/p&gt;

&lt;p&gt;In the user interface, &lt;code&gt;ui&lt;/code&gt;, we replace the sliderbard with a selectInput
&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
selectInput(&amp;#39;sel_country&amp;#39;,
             &amp;quot;country:&amp;quot;,
             gc_countries,
             selected = NULL,
             multiple = FALSE,
             selectize = TRUE,
             width = &amp;quot;100%&amp;quot;,
             size = NULL)
      )
&lt;/code&gt;&lt;/pre&gt;
and in the body of the app we replace the &lt;code&gt;plotOutput()&lt;/code&gt; function with a &lt;code&gt;valueBoxOutput()&lt;/code&gt; as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
valueBoxOutput(&#34;infected_box&#34;,  width = 12)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In order to be able to output the value-box with the name &amp;ldquo;infected_box&amp;rdquo;, we need to create an output variable of the same name. So, we replace all the content of the server function with:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
    output$infected_box  &lt;- shiny::renderValueBox({
        last_nbrs &lt;- get_last_numbers(d = gc_dts_countries, 
                                    theCountry = input$sel_country)
        x_frm &lt;- last_nbrs$Confirmed,  big.mark = &#34; &#34;, scientific = FALSE)
        valueBox( x_frm, &#34;Confirmed&#34;, icon = icon(&#34;ambulance&#34;), color = &#34;purple&#34;)
    })
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The app will now look as follows:
&lt;div class=&#34;jumbotron jumbotron-fluid&#34;&gt;
  &lt;div class=&#34;container&#34;&gt;&lt;center&gt;
    &lt;img src=&#34;/assets/img/post_shiny_app1.png&#34;&gt;
    &lt;p class=&#34;lead&#34;&gt;&lt;i&gt;Figure 1:&lt;/i&gt; Our app is still very simple, but it does display the latest total number of Covid-19 infections.&lt;/p&gt;&lt;/center&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;First we will change the basic layout of the app from standard bootstrap to the elegant dashboard interface of &lt;code&gt;shinydashboard&lt;/code&gt;. This is done by loading the library &lt;code&gt;shinydashboard&lt;/code&gt; and replacing the main function in the user interface from &lt;code&gt;fluidPage()&lt;/code&gt; to &lt;code&gt;dashboardPage()&lt;/code&gt;. We also add a dashboard header and replace the sidebard with the &lt;code&gt;dashboardSidebar()&lt;/code&gt;, add a title, etc. The first lines of the &lt;code&gt;ui&lt;/code&gt; in the file &lt;code&gt;app.R&lt;/code&gt; look now as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
ui &lt;-  dashboardPage(
    skin = &#39;red&#39;,
    dashboardHeader(title = &#34;My Covid Dashboard&#34;),
    dashboardSidebar(
      sidebarMenu(# nice layout + indication which one is active
        # Header:
        h4(&#39;Selected Country&#39;),

        # selct the country input:
        selectInput(&#39;sel_country&#39;,
                        &#34;country:&#34;,
                        gc_countries,
                        selected = NULL,
                        multiple = FALSE,
                        selectize = TRUE,
                        width = &#34;100%&#34;,
                        size = NULL),

        # a separator:
        hr(),

        # the menu items:
        menuItem(&#34;Main Page&#34;, tabName = &#34;dashboard&#34;, icon = icon(&#34;th&#34;)),
        menuItem(&#34;Forecast&#34;,  tabName = &#34;forecast&#34;,  icon = icon(&#34;sun&#34;))

        ) #close sidebarmenu()
        ), # close DashboardSidebar
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The app will now look as follows:&lt;/p&gt;

&lt;div class=&#34;jumbotron jumbotron-fluid&#34;&gt;
  &lt;div class=&#34;container&#34;&gt;&lt;center&gt;
    &lt;img src=&#34;/assets/img/post_shiny_app2.png&#34;&gt;
    &lt;p class=&#34;lead&#34;&gt;&lt;i&gt;Figure 2:&lt;/i&gt;Now, the app looks like a real dashboard, but we only started to work on it.&lt;/p&gt;&lt;/center&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now, we have a fully functioning app that loads the latest covid data and displays just one number. We will now expand the app so that it beocomes more meaningful. Along the way we will also improve the code slightly.&lt;/p&gt;

&lt;p&gt;Wit the following code we prepare more pages, enrich the menu, and make it look nicer.&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
 dashboardSidebar(
      sidebarMenu(# nice layout + indication which one is active
        # Header:
        h4(&#39;Selected Country&#39;),

        # selct the country input:
        selectInput(&#39;sel_country&#39;,
                        &#34;country:&#34;,
                        gc_countries,
                        selected = NULL,
                        multiple = FALSE,
                        selectize = TRUE,
                        width = &#34;100%&#34;,
                        size = NULL),

        # a separator:
        hr(),

        # the menu items:
        menuItem(&#34;Dashboard&#34;, tabName = &#34;dashboard&#34;, icon = icon(&#34;th&#34;)),
        menuItem(&#34;Forecast&#34;,  tabName = &#34;forecast&#34;,  icon = icon(&#34;sun&#34;))

        ) #close sidebarmenu()
        ), # close DashboardSidebar
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We can test the code by clicking &lt;code&gt;Run App&lt;/code&gt;, however the new buttons won&amp;rsquo;t work yet (they do not generate an error message either).&lt;/p&gt;

&lt;p&gt;We need to connect each &lt;code&gt;tabName&lt;/code&gt; to the content in the &lt;code&gt;dashboardBody()&lt;/code&gt;. This can be done by adding a &lt;code&gt;tabItem&lt;/code&gt; with the corresponding name in the dashboard body (for example wrapped in the function &lt;code&gt;fluidRow()&lt;/code&gt; &amp;ndash; which produces a Bootstrap row of 12 unit lengths: this creates rows that turn into columns in narrower screens).&lt;/p&gt;

&lt;p&gt;Here is a minimal example:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
dashboardBody(
      fluidRow(style=&#39;padding:5px;&#39;,
        tabItems(
            tabItem(&#34;dashboard&#34;,
                    h1(&#39;The Dashboard&#39;),
                    valueBoxOutput(&#34;infected_box&#34;, width = 6)
                    ),
            tabItem(&#34;forecast&#34;,
                    h1(&#39;The Forecast&#39;),
                    HTML(&#39;&lt;h1&gt;TBA&lt;/h1&gt;&#39;) # we will add this later
                    ) # close tabItem
        ) # close tabItems
      ) # close fluidRow
    ) # close dashboardBody()
) # close dashboardPage
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Again we can test the app at this point, and now we can select other pages in the menu. For example, if we choose &lt;code&gt;Forecast&lt;/code&gt;, then we will see the message &amp;ldquo;TBA&amp;rdquo;. So, the layout framework is operational and we can focus on the content.&lt;/p&gt;

&lt;p&gt;Now, we need to develop the code (&lt;code&gt;server&lt;/code&gt; function) and html5 &lt;code&gt;ui&lt;/code&gt; for each &lt;code&gt;tabItem&lt;/code&gt;. First we focus on the main dashboard. Now it is the following block.&lt;/p&gt;

&lt;p&gt;We can now copy the following code in the beginning of the &lt;code&gt;dashboardBody()&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
    dashboardBody(
      div(style=&#39;padding:5px;&#39;,
        tabItems(

            tabItem(&#34;dashboard&#34;,
                    h1(&#39;The Dashboard&#39;),
                    column(6,
                      valueBoxOutput(&#34;infected_box&#34;,  width = 12),
                      valueBoxOutput(&#34;sick_box&#34;,      width = 12),
                      shinydashboard::box(
                        width = 12,
                        title = &#34;Sick as a percentage of Confirmed&#34;,
                        gaugeOutput(&#34;sick_gauge&#34;,  width = &#34;200px&#34;, height = &#34;200px&#34;)
                      )
                    ),
                    column(6,
                      valueBoxOutput(&#34;recovered_box&#34;, width = 12),
                      valueBoxOutput(&#34;death_box&#34;,     width = 12),
                      shinydashboard::box(
                        width = 12,
                        title = &#34;Deaths as a percentage of Confirmed&#34;,
                        gaugeOutput(&#34;death_gauge&#34;, width = &#34;200px&#34;, height = &#34;200px&#34;)
                      )
                    )
            ),

               tabItem(&#34;forecast&#34;,
                    h1(&#39;The Forecast&#39;),
                    HTML(&#39;&lt;h1&gt;TBA&lt;/h1&gt;&#39;) # we will add this later
                    ) # close tabItem

        ) # close tabItems
      ) # close fluidRow
    ) # close dashboardBody()
) # close dashboardPage
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;h1()&lt;/code&gt; generates a level 1 header (it is the heading of the first tabItem)&lt;/li&gt;
&lt;li&gt;We choose a layout in columns. Each function column, takes as first argument the width (e.g. &lt;code&gt;column(6, ...)&lt;/code&gt;). Rember that the total width at each level is 12. Even if within the column of width 6 we start a new column, then this will again get a maximal width of 12.&lt;/li&gt;
&lt;li&gt;Some items are wrapped in &lt;code&gt;shinydashboard&lt;/code&gt;&amp;rsquo;s function &lt;code&gt;box()&lt;/code&gt;. This draws a box around the items in it, but also allows to add a title to the items.&lt;/li&gt;
&lt;li&gt;Each column has two value-boxes and one gauge plot. These still need to be generated. The code will work, but the plots are not displayed till we add in the server function the corresponding output variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To create the dynamic output that for which we created the output framework, we need the following code. Note that we decided to lift the data genearation for one country out of the &lt;code&gt;renderValueBox()&lt;/code&gt; function, because we need it in every value box. &lt;/p&gt;

&lt;p&gt;To make this data respond to the user&amp;rsquo;s input, we need to wrap it in the function &lt;code&gt;reactive()&lt;/code&gt;. Later, we can refer to it as a function (&lt;code&gt;last_numbers()&lt;/code&gt;). Since it is a named vector of values, we can get the last number of confirmed infected people for example as &lt;code&gt;last_numbers()$Confirmed&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
    # We extract only once the last numbers of the selected country:
    last_numbers &amp;lt;- reactive(
        get_last_numbers(d = gc_dts_countries, theCountry = input$sel_country)
        )&lt;/p&gt;

&lt;p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;The app is no fully functional and the first page will look as follows:
&lt;div class=&#34;jumbotron jumbotron-fluid&#34;&gt;
  &lt;div class=&#34;container&#34;&gt;&lt;center&gt;
    &lt;img src=&#34;/assets/img/post_shiny_app3.png&#34;  width=&#34;100%&#34;&gt;
    &lt;p class=&#34;lead&#34;&gt;&lt;i&gt;Figure 3:&lt;/i&gt;The first page of the dashboard is finished.&lt;/p&gt;&lt;/center&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;All that rests to do now the second functionality: generate a forecast.&lt;/p&gt;

&lt;p&gt;For the forecast, we will start from the server function. This will make clear what we want to do and what is needed in the &lt;code&gt;ui&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
    # The data for the selected country:
    d &lt;- reactive(get_dts_country(gc_dts_countries, input$sel_country))

    # The forecast plot:
    dd &lt;- reactive(add_forecast(d(),    # timeseries for the given country
                       input$sel_data,  # e.g Sick, Confirmed, etc.
                       input$dte_start, # starting date for the data to use
                       input$f_nbrDays  # number of days to forecast
                   ))

    # Prepare the plot for output:
    output$plot_frct &lt;- renderPlotly(plot_forecast(dd(), input$sel_data))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This makes clear that in the input we will need the following input variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sel_country&lt;/code&gt;: which country is selected. We already have that one. This one is defined in the side-bar of the dashboard and is considered as an over-arching choice for the first &lt;code&gt;tabItem&lt;/code&gt; (&amp;ldquo;dashboard&amp;rdquo;) and the second (&amp;ldquo;forecast&amp;rdquo;))&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sel_data&lt;/code&gt;: the data to be used (confirmed, sick, deaths or recovered)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dte_start&lt;/code&gt;: the starting data. As the pandemic evolves, the dynamics evolve and we cannot expect that our simple forecast (based on an exponential model) will make sense on all data&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f_nbrDays&lt;/code&gt;: the number of days to forecast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we would like to compile the app, it will fail. Going through the error message, you might find that we miss the function &lt;code&gt;plot_forecast()&lt;/code&gt;. This function can be added in the server function or in &lt;code&gt;global.R&lt;/code&gt;
We decide to add it in the &lt;code&gt;global.R&lt;/code&gt; file, beasue it does not need reactive code and is rather lengthy.&lt;/p&gt;

&lt;p&gt;Add the following to the &lt;code&gt;global.R&lt;/code&gt; file:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
add_forecast &lt;- function(d,             # timeseries for the given country
                         theRow,        # e.g Sick, Confirmed, etc.
                         dte_start,     # starting date for the data to use
                         f_nbrDays = 14 # number of days to forecast
                         ) {

# prepare the data
dd &lt;- d %&gt;% filter(Date &gt; dte_start)
dd &lt;- dd[complete.cases(dd),]
x &lt;- dd$Date
y &lt;- dd[[theRow]]
n &lt;- 1:nrow(dd)
N &lt;- max(n)
dd &lt;- cbind(dd, n, y)  # we add a column y (universal name for the dependent variable)

# find good starting values
theta.0 &lt;- min(y) * 0.5
model.0 &lt;- lm (log(y - theta.0) ~ n)
alpha.0 &lt;- exp(coef(model.0)[1])
beta.0  &lt;- coef(model.0)[2]
starts  &lt;- list(alpha = alpha.0, beta = beta.0, theta = theta.0)

model &lt;- NULL
try({
  model &lt;- nls(y ~ alpha * exp(beta * n) + theta,
               data = dd, start = starts,
               #algorithm = &#39;port&#39;,
               nls.control(maxiter = 1000, minFactor = 0.000002, tol = 1e-03))
}) #try

if(f_nbrDays &gt; 0) {
  df_frcst &lt;- tibble(
    Date = as_date((max(dd$Date) + days(1)):(max(dd$Date) + days(f_nbrDays - 1))),
    y = NA,  #NOTE: we use y instead of Sick, Confirmed, etc.
    n = (N + 1):(N + f_nbrDays - 1)
  )
  dd &lt;- bind_rows(dd, df_frcst)
}
#df &lt;- df %&gt;%  dplyr::mutate(Forecast = predict(model, newdata = df)) ## fails ... Error: Column `Forecast` must be length 1 (the group size), not 74
dd$Forecast &lt;- predict(model, newdata = dd)
return(dd)
}


# ----- return the plotly plot
plot_forecast &lt;- function(dd, theRow) {
  plot_ly(dd, x = ~Date, y = ~y, type = &#39;scatter&#39;,  name = &#34;Daily people sick&#34;,
          mode = &#39;markers&#39;, marker = list(size=8)) %&gt;%
    add_trace(x = ~Date, y = ~Forecast,
              mode = &#39;lines&#39;, type = &#39;scatter&#39;, name =&#39;Model Estimate&#39;, line = list(width = 3), marker = list(size=1)) %&gt;%
    layout(
      title = paste(&#34;Forecast for:&#34;, theRow),
      xaxis = list(title = &#34;Date&#34;),
      yaxis = list(title = &#34;Number of People&#34;),
      #autosize = TRUE,
      showlegend = TRUE)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As one can see from the code, the functionality works in two steps. First, we define a function that fits the model, then we define a function that uses this model to visualise it.&lt;/p&gt;

&lt;p&gt;Again the app can be opened now, but the new tab will still not show up. To visualize the forecast, we need to build the &lt;code&gt;ui&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We will now need to replace our placeholder for the forecast output in our &lt;code&gt;ui&lt;/code&gt;. So, replace&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
            tabItem(&#34;forecast&#34;,
                    h1(&#39;The Forecast&#39;),
                    HTML(&#39;&lt;h1&gt;TBA&lt;/h1&gt;&#39;) # we will add this later
                    ) # close tabItem
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;with:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;R&#34;&gt;
            tabItem(&#34;forecast&#34;,
                h1(&#39;The Forecast&#39;),
                fluidRow(
                    shinydashboard::box( #input of extra variables
                        title = &#34;Make your choice&#34;,
                        selectInput(&#34;sel_data&#34;,
                                    &#34;Data:&#34;,
                                    gc_impact_types),
                        dateInput(&#39;dte_start&#39;, &#39;Use data from:&#39;,
                                  value = gc_last_date %m-% months(1),
                                  min = gc_first_date, max = gc_last_date,
                                  format = &#34;yyyy-mm-dd&#34;, startview = &#34;month&#34;,
                                  weekstart = 0, language = &#34;en&#34;                                                          ),
                        sliderInput(&#34;f_nbrDays&#34;, &#34;Number of days to forecast:&#34;,
                                    value = 14, #the default is
                                    min = 1, max = 90,
                                    step = 1, round = TRUE)

                       )
                    ),
                fluidRow(
                    shinydashboard::box( #input of extra variables
                        width = 12,  # default is 6
                        title = &#34;The forecast&#34;,
                        plotlyOutput(&#39;plot_frct&#39;,
                                     width = &#34;100%&#34;, height = &#34;350px&#34;, inline = FALSE
                                     )
                                    )
                    ),
                    ) # close tabItem
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, the app if finished and the forecast page will look as follows:
&lt;div class=&#34;jumbotron jumbotron-fluid&#34;&gt;
  &lt;div class=&#34;container&#34;&gt;&lt;center&gt;
    &lt;img src=&#34;/assets/img/post_shiny_app4.png&#34; width=&#34;100%&#34;&gt;
    &lt;p class=&#34;lead&#34;&gt;&lt;i&gt;Figure 4:&lt;/i&gt;The forecast page.&lt;/p&gt;&lt;/center&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;With little effort we created a fully functional app that interacts with the user and uses the user&amp;rsquo;s input to calculate and visualise things that the programmer might not have expected (e.g. special choices of dates), or that look different every day (since we pull in new data at the start). Obviously there is still a lot that can be improved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the mathematical model in the first place needs improvement &lt;/li&gt;
&lt;li&gt;a wider range of models would make sense (e.g. a logistic curve, and ARIMA model, etc.)&lt;/li&gt;
&lt;li&gt;and above all there is much, much more possible, but that dashboard is already available: &lt;a href=&#34;http://www.de-brouwer.com/about/covid.html&#34;&gt;see Philippe&amp;rsquo;s Covid19 dashboard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anyhow, I hope that this gets you started on sharing your data, analysis, and insights.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>How to become a data scientist</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2021/01/04/Become-a-Data-Scientist/" type="text/html" />
            <id>http://www.de-brouwer.com/2021/01/04/Become-a-Data-Scientist/</id>
            <updated>2021-01-04T21:49:00Z</updated>
            
            <summary type="html">Maybe you have read my latest &lt;a href=&#34;/publications/r-book/index.html&#34;&gt;book about data science&lt;/a&gt; or you have seen my courses about data science on my &lt;a href=&#34;http://www.youtube.com/user/philippedebrouwer&#34;&gt;YouTube Channel&lt;/a&gt;, and it appeals to you to become a data scientist yourself. Then this post is for you: I will share some ideas about what makes a good data scientist and how you can improve your qualities.</summary>
            <content type="html">&lt;p&gt;Maybe you have read my latest &lt;a href=&#34;/publications/r-book/index.html&#34;&gt;book about data science&lt;/a&gt; or you have seen my courses about data science on my &lt;a href=&#34;http://www.youtube.com/user/philippedebrouwer&#34;&gt;YouTube Channel&lt;/a&gt;, and it appeals to you to become a data scientist yourself. Then this post is for you: I will share some ideas about what makes a good data scientist and how you can improve your qualities.&lt;/p&gt;

&lt;p&gt;Data Scientists are in demand, much of the new jobs and much of the new economy seems to be related to data science. It seems as if data science and its various sub-fields such as deep learning, big data, statistics, modelling, etc. are supporting a new wave of development and wealth creation. &lt;/p&gt;

&lt;p&gt;Data science is a worthwhile pursuit, and is a road to a rich and interesting career with amazing growth opportunities. It is, however, not the most obvious thing to learn. That is because data science does not a narrow scientifc field. Data science is the art and science of making (business) decisions based on data, hence one need computer skills to access and manipulate the data, business insight to know what data and how to manipulate it as well as the insight what analytics make sense, mathematical knowledge to run the model, and communication skills to convince other people about the results.&lt;/p&gt;

&lt;p&gt;Once can say that data science as the art and science to use data to create actionable insights. As such, data science is the interdisciplinary scientific domain that lies at the intersection between mathematics/statistics, computer science, business management, and psychology &amp;hellip; all this within an ever changing landscape.&lt;sup id=&#34;fnref1&#34; class=&#34;footnotes-ref&#34;&gt;&lt;a href=&#34;#fn1&#34; rel=&#34;footnote&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;In order to be succesful in data science, you will need to have a basic understanding of all of the sub-domains, excel in a few and make this your personal trademark.
These sub-domains break down as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mathematics/statistics: a good understanding of basic notions is maybe more important than a superficial knowledge of more advanced techniques.&lt;sup id=&#34;fnref2&#34; class=&#34;footnotes-ref&#34;&gt;&lt;a href=&#34;#fn2&#34; rel=&#34;footnote&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; &amp;ndash; The best ways to build up this mathematical knowledge is via an academic training (STEM subjects are obvious candidates and are the ideal starting point &amp;ndash; it is rather hard to acquire this knowledge later if you don&amp;rsquo;t have a solid base).&lt;/li&gt;
&lt;li&gt;Computers science: understanding databases, software design, OO, and being able to write code in SQL, R and Python is essential and should be considered as minimal requirements.&lt;sup id=&#34;fnref3&#34; class=&#34;footnotes-ref&#34;&gt;&lt;a href=&#34;#fn3&#34; rel=&#34;footnote&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; Programming is best learned on-the-job: simply start a project, find solutions to all your problems and don&amp;rsquo;t give up. You might also find my &lt;a href=&#34;http://www.youtube.com/user/philippedebrouwer&#34;&gt;movies on YouTube&lt;/a&gt; useful.&lt;/li&gt;
&lt;li&gt;Business Management: understanding the business model in your sector is essential to produce analysis that make sense and can be used by the management. A data scientist has a purpose and a mission, you need to understand that mission and always keep an eye on the bigger picture. This business insights is something that can be acquired by reading about the subject, studying applied economics, but years of experience will always add value.&lt;/li&gt;
&lt;li&gt;Psychology, Game Theory and Decision Science: your job is not done by crunching numbers: you will need to present them, suggest solutions, etc. &amp;hellip; and most of that is only possible via solid teamwork. So, you have to be able to work as a team, and making sure that you produce the most impactful analysis possible that is digestable and actionable. Reading up about multi criteria decision analysis or game theory might tick certain boxes, but beging effective is something that you will need to work on permanently. For example getting and giving feedback will help you grow.&lt;/li&gt;
&lt;li&gt;An Open mind and willingness to learn: the domain of data science is an ever moving landscape, some skills that are explained above only help you to move towards the top, but being a data scientist means that you need to be willing to learn.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, you will want to start by studying something that is of interest and can be used as an angle of approach to data science. Any STEM subject will do, as well as econometrics, applied economy and business analytics. &lt;/p&gt;

&lt;p&gt;Then you need to read up about the fields that were less prominent in that study.
I have tried to find a book that could help you on that journey, but could not find one &amp;hellip; so I wrote it myself &lt;a href=&#34;http://www.de-brouwer.com/publications/r-book/index.html&#34;&gt;The Big R-Book: From Data Science to Learning Machines and Big Data&lt;/a&gt;.
The book is about data, and how to use it successfully in a private company. The book is not only a technical work, it aims at increasing your personal brand and value, as well as shareholder value.
You can learn about statistical models, muliti-criteria decision analysis, machine learning, artificial intelligence, big data, creating interactive websites, automated presentations, speed up code, program the GPU, etc. all while learning to code in R. The book takes a pragmatic stance and gets you started. It covers the whole dat cycle from data bases, importing data, wrangling data, to modelling, reporting and even elaborates on big data, interactive websites, etc.&lt;/p&gt;

&lt;p&gt;Whatever route you choose to start, I&amp;rsquo;m sure that you are in for a fantastic journey in a fast growing field. I wish you loads of success and a rewarding career!&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>The Start of My Youtube Channel</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2020/11/10/Youtub-Channel/" type="text/html" />
            <id>http://www.de-brouwer.com/2020/11/10/Youtub-Channel/</id>
            <updated>2020-11-10T13:26:00Z</updated>
            
            <summary type="html">Dear Reader,</summary>
            <content type="html">&lt;p&gt;Dear Reader,&lt;/p&gt;

&lt;p&gt;I started a Youtube channel, where I will post in the first place information about my newest book (eventually a series of trainings).&lt;/p&gt;

&lt;p&gt;Visit the channel &lt;a href=&#34;http://www.youtube.com/user/philippedebrouwer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy!
&lt;i&gt;Philippe&lt;/i&gt;&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Working from Home on Steroids</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2020/03/19/Working-from-Home/" type="text/html" />
            <id>http://www.de-brouwer.com/2020/03/19/Working-from-Home/</id>
            <updated>2020-03-19T08:26:00Z</updated>
            
            <summary type="html">Today we face a novel virus, SARS-COV-2, and the disease that it causes, Covid-19, spreads fast around the globe. Most countries decide prioritize people&amp;rsquo;s lives over economic welfare and decide to enforce some form of social distancing to slow down the spreading of the virus. This means that people work more from home. It is still possible to forge strong teams that hold together, but it requires good intend, respect and an effort from both team-leader and team-member.</summary>
            <content type="html">&lt;p&gt;Today we face a novel virus, SARS-COV-2, and the disease that it causes, Covid-19, spreads fast around the globe. Most countries decide prioritize people&amp;rsquo;s lives over economic welfare and decide to enforce some form of social distancing to slow down the spreading of the virus. This means that people work more from home. It is still possible to forge strong teams that hold together, but it requires good intend, respect and an effort from both team-leader and team-member.&lt;/p&gt;

&lt;p&gt;During the last decades, we gathered a lot of experience working while with virtual teams that span different countries and multiple time-zones. 
Here are a few hints that can make a big difference, and turn this period of hardship in a period of opportunity, self actualisation, productivity, and personal growth.&lt;/p&gt;

&lt;p&gt;Clarity is the quintessence of good management. Working from home is even more predicated on clarity from both team-leader and team-member. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Be clear&lt;/strong&gt; on what you can and cannot do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Be clear&lt;/strong&gt; on what you need in order to be successful.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Speak up&lt;/strong&gt; if you&amp;rsquo;re stuck, if you feel bad, even personal things matter, and yes: your team leader &lt;em&gt;does&lt;/em&gt; care.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Provide feedback&lt;/strong&gt; to everyone, and do not forget that your manager will need now feedback more than ever. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cornerstone of a good functioning team is trust, and we tend to trust people that we see in person and meet often. Working remotely, we cannot meet in person and hence need to make sure that team members have ample opportunity to see each other and communicate.&lt;/p&gt;

&lt;p&gt;Fortunately, technology helps us to stay connected, and offers us the next best thing to a meeting in person: the video conference. To get the best out of it, you will want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure that the &lt;strong&gt;camera is on&lt;/strong&gt;. This might be the only face that your lonely colleague will see for a while.&lt;/li&gt;
&lt;li&gt;Make time for &lt;strong&gt;small talk&lt;/strong&gt; and don&amp;rsquo;t be afraid to bring something personal to the meeting. Do not be ashamed that your pet or kid wants to be on the video conference, realize that you are doing an effort to get work done while they are around. You will be surprised how your team-members will be understanding.&lt;/li&gt;
&lt;li&gt;Organise virtual coffee breaks without specific agenda, but just allow people to talk. Why not spice up the virtual break with a fun contest (drawing, best dressed, a fitness challenge, etc.)&lt;/li&gt;
&lt;li&gt;Start from the assumption that team-mates are people worthy to be your friend. Start an online, informal discussion group and see what happens. Have fun, but keep it respectful.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is always important to deliver what you commit to do, but while working from home makes it becomes even more more important. Think about it this way: even in these days, there are managers that believe that productivity will go down when you work from home: prove them wrong! Prove them wrong and earn the right to work more from home.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure that you understand what needs to be done. Re-read the section on clarity and reflect on it regularly.&lt;/li&gt;
&lt;li&gt;Make sure that the task allotted to you is realistic (be clear and frank if you cannot do it).&lt;/li&gt;
&lt;li&gt;Even when the two previous point are satisfied, things can go wrong. Make sure to &lt;strong&gt;reach out for help or escalate early&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never, ever get stuck&lt;/strong&gt;. Be your own coach and reflect often, that will help you to recognise early when your task does not go as planned. &lt;/li&gt;
&lt;li&gt;Be a &lt;strong&gt;problem solver&lt;/strong&gt;, bring solutions to the meeting, not problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Accountability alone will not keep the productivity on a sufficient level, one must practice the fine art of being efficient and effective.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Avoid procrastination&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plan ahead, set objectives and measure outcomes&lt;/strong&gt;, hen celebrate successes.&lt;/li&gt;
&lt;li&gt;Reflect often if what you are doing will work, is there a more efficient way, is it effective, etc.&lt;/li&gt;
&lt;li&gt;Use team meetings and personal meetings with your manager to reflect on those issues. You will be surprised how effective it is to formulate the problem out loud.&lt;/li&gt;
&lt;li&gt;It is O.K. to meet more when working with a virtual team, but try to keep meetings short. &lt;/li&gt;
&lt;li&gt;Be &lt;strong&gt;efficient in meetings&lt;/strong&gt; (do not change the subject before the decision or action is clear, summarize actions and decisions at the end of the meeting, stick to the subject and avoid elaborating when the decision is already made, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Working extended periods from home might blur the boundaries between work and private live. This is bad news for your private life, work and overall well-being. In order to be able to relax, body and mind need to see and feel a difference between work and relax.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plan the week&lt;/strong&gt;: What are the key things that you want to achieve this week?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plan the day&lt;/strong&gt;: Given the weekly objective, what can you do today to achieve that weekly objective? &amp;hellip; and do not forget the coffee break&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dress for the occasion&lt;/strong&gt;: It is ok, to opt for a dress code that is less formal than in the office, but changing clothes when transiting between working and private life helps the mind to change to the other mode.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Master the space&lt;/strong&gt;: in the office you have a caring teams that make sure that workstations are ergonomic and functional. It is important to make sure that you can have an ergonomic setup of your work-station.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mark your space&lt;/strong&gt;: try to have your space to work. Even if your space is at the kitchen table, then it should be your workspace during the hours that you work. Ask family members to respect this, where possible, or integrate them in your work-experience. If that fails, discuss with your manager to adapt your workload.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An ergonomic workstation that allows you to switch between a sitting and standing position is not enough to stay healthy in long term. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take &lt;strong&gt;regular breaks&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Stay &lt;strong&gt;hydrated&lt;/strong&gt;, have a bottle of water next to you.&lt;/li&gt;
&lt;li&gt;Make sure that your &lt;strong&gt;workstation is properly installed&lt;/strong&gt; so that no joints would be strained much (straight wrists, straight angles in knees, screen high enough so that you do not have to bend your head, etc.). You know the drill of a healthy position after the computer. Now change it. Even the best position after a computer is not a position to use 8 hours straight. Move around, take some meetings on the phone and lay on your back or stand (decompress the spine), sit on a giant ball (not more than 15 minutes if you&amp;rsquo;re not used to it), walk with the phone, build a simple standing desk, &amp;hellip; do whatever works but &lt;em&gt;change position often&lt;/em&gt;.
Especially take care of the following:

&lt;ul&gt;
&lt;li&gt;I repeat: &lt;strong&gt;change position often&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Do not work the whole day in front of a laptop that is not raised; invest in a detached monitor, keyboard and mouse.&lt;/li&gt;
&lt;li&gt;Do simple and light (stretching) exercises in a 5 minutes break. Start a meeting saying that you will stop 5 minutes early and be efficient.&lt;/li&gt;
&lt;li&gt;Decompress the spine after sitting an hour or so (stand, stretch, lay down, etc.). &lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Get into a &lt;strong&gt;workout routine&lt;/strong&gt;: daily is best (every second day is nearly as good and even better when you&amp;rsquo;re over 50). Whatever you do, do not overdo it and seek advice.&lt;/li&gt;
&lt;li&gt;Indeed, &lt;strong&gt;be careful&lt;/strong&gt;: most exercises can be dangerous if not performed correctly or with too much weights. Ask the team, there must be someone that is happy to share information.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Set your goals&lt;/strong&gt;. What do you want to obtain during this quarantine? Improve stamina, loose weight, or build muscle? Define your goal, set a plan, and commit to it &amp;hellip; just as you would for work.&lt;/li&gt;
&lt;li&gt;Why not combine it with informal team-meetings? Stream workouts and do it together, set a challenge, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the things mentioned under the heading &amp;ldquo;get organised&amp;rdquo;, will help you to keep a healthy work-life balance. However, in these trying times we might want to pay extra attention to other people too and we should seek to fight burnout and social isolation long before it occurs.
Also the things in the last section might help. Additionally, you might consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Meditation, mindfulness, coaching and mentoring. Reach out to find a partner for whatever you choose.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start a project&lt;/strong&gt; to keep your mind busy (find a pen-pal, learn a new programming language, read a good book, pick up welding or knitting, etc.)&lt;/li&gt;
&lt;li&gt;Whatever project you choose, &lt;strong&gt;talk about it&lt;/strong&gt;, share your project with team members, find like-minded people and socialize. For example start a language-partner program in your company, a robotics club, &amp;hellip; even a cycling club will work (just keep a healthy distance or stream your cycling on video).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Work out&lt;/strong&gt; (see also the section on physical health) &amp;ndash; working out will help you to feel better, sleep better, and be a better version of yourself in general.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Generally, extroverts have an edge when it comes to making career, and functioning in an open floor system. Today, the extroverts will face a more challenging time. While the introvert welcomes the extra time that is not spend on commuting and will naturally fill it with introspection and interesting projects, the extrovert might lack energy due to thinner or more shallow social interactions.&lt;/p&gt;

&lt;p&gt;Social distancing, closing of pubs, movie theatres, and schools is bound to create problems for many people. Some people will have to cope with spending a lot of time with a small group of people and others will face the looming abyss of loneliness.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be perceptive for other&amp;rsquo;s people&amp;rsquo;s needs. &lt;strong&gt;Do not assume: ask&lt;/strong&gt;. Even when you&amp;rsquo;re not in doubt: ask, do not assume.&lt;/li&gt;
&lt;li&gt;Parents with small kids in a small apartment will have a hard time to focus on work, &lt;strong&gt;be mindful and check in&lt;/strong&gt; with them, offer to take over some work, etc.&lt;/li&gt;
&lt;li&gt;People that are lonely need friends now more than ever. &lt;strong&gt;Be that friend&lt;/strong&gt;, reach out to team-members and let them talk, share something of your own, be not afraid to share your emotions.  However, do &amp;ldquo;stay on the right side of creepy&amp;rdquo;, and respect each other&amp;rsquo;s privacy. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You made it this far. Great! That&amp;rsquo;s a first and important step. Now, the best way to go is to reflect on this article, make your personal top three of things that you did not do and would like to do. Then write them down as your personal goals. Keep the goals next to your working station and try to do it. Then regularly revisit this article, and update your top three: your route to continuous personal improvement is on a good track &amp;hellip; time to set more ambitious goals.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Philippe&lt;/i&gt;&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>How to create a static website with Mynt and Bootstrap?</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2015/10/24/Static-Website-with-Bootstrap-and-Mynt/" type="text/html" />
            <id>http://www.de-brouwer.com/2015/10/24/Static-Website-with-Bootstrap-and-Mynt/</id>
            <updated>2015-10-24T20:08:00Z</updated>
            
            <summary type="html">You are maintaining a website for your business or club? You need a little more than a simple html page but you don&amp;rsquo;t need all the functionalities of a CMS such as Drupal or Joomla? Or you&amp;rsquo;re fed up with the vulnerabilities of most CMSs? If your website does not require exensive user interaction for contribution to then a static one can be a simple and effective alternative. My personal website &lt;a href=&#34;http://www.de-brouwer.com&#34;&gt;de-brouwer.com&lt;/a&gt; is generated with the &lt;a href=&#34;http://mynt.uhnomoli.com/&#34;&gt;&amp;ldquo;Mynt&amp;rdquo;&lt;/a&gt; and to allow a responsive design I used Twitter&amp;rsquo;s &lt;a href=&#34;http://getbootstrap.com/&#34;&gt;Bootstrap&lt;/a&gt; framework.</summary>
            <content type="html">&lt;p&gt;You are maintaining a website for your business or club? You need a little more than a simple html page but you don&amp;rsquo;t need all the functionalities of a CMS such as Drupal or Joomla? Or you&amp;rsquo;re fed up with the vulnerabilities of most CMSs? If your website does not require exensive user interaction for contribution to then a static one can be a simple and effective alternative. My personal website &lt;a href=&#34;http://www.de-brouwer.com&#34;&gt;de-brouwer.com&lt;/a&gt; is generated with the &lt;a href=&#34;http://mynt.uhnomoli.com/&#34;&gt;&amp;ldquo;Mynt&amp;rdquo;&lt;/a&gt; and to allow a responsive design I used Twitter&amp;rsquo;s &lt;a href=&#34;http://getbootstrap.com/&#34;&gt;Bootstrap&lt;/a&gt; framework.&lt;/p&gt;

&lt;p&gt;This tutorial will help you getting started.&lt;/p&gt;

&lt;p&gt;Of course we assume that you&amp;rsquo;re using Linux, and for this tutorial we will use a Debian repositories to install the necessary software.&lt;/p&gt;

&lt;p&gt;The nice thing of working with Mynt is that you don&amp;rsquo;t have to install a webserver such as &lt;a href=&#34;&#34;&gt;Apache&lt;/a&gt; on your box in order to test the website, mynt will be able to show the webpage via the command &lt;code&gt;mynt serve DIR&lt;/code&gt;, but more about that later.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;first you will have to install mynt (which will will need &lt;a href=&#34;https://pip.pypa.io/en/latest/installing/&#34;&gt;pip&lt;/a&gt;)
&lt;pre&gt;&lt;code data-lang=&#34;bash&#34;&gt;sudo apt-get install python-pip
pip install mynt
mynt --version
&lt;/code&gt;&lt;/pre&gt;The last line should show output similar to &lt;code&gt;mynt v0.3.1&lt;/code&gt;. If you would not see this, then something went wrong and you will have to refer to the relevant websites mentioned above.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second you will need a copy of Boostrap. Simply go to the &lt;a href=&#34;http://getbootstrap.com/getting-started/#download&#34;&gt;download page&lt;/a&gt; and select the package that suits best your needs.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open a terminal and go to the location where you want to create the website. We assume that the website is called my-site.com and that the source code will reside in the sub-directory &lt;code&gt;src&lt;/code&gt; and the result (html) files will go in a directory &lt;code&gt;docroot&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;init&lt;/code&gt; command will generate the structure that you need to generate the website (with some simple content), the &lt;code&gt;gen&lt;/code&gt; command will generate that website.&lt;/p&gt;

&lt;p&gt;In order to see the result (ope a second terminal window by typing &lt;code&gt;&lt;Ctr&gt;+&lt;shift&gt;+&lt;t&gt;&lt;/code&gt;. In that second window we start the built-in webserver of Mynt.&lt;/p&gt;

&lt;p&gt;Then open any browser and go to &lt;code&gt;127.0.0.1:8080&lt;/code&gt; in order to see the result. It should look like this:&lt;br/&gt;
&lt;img src=/assets/img/201510_mynt01.jpg &gt;&lt;/p&gt;

&lt;p&gt;This terminal window (and browser window) can be left active and next time we simply update the code, run &lt;code&gt;gen&lt;/code&gt; and refresh the page in the browser to see the update&lt;/p&gt;

&lt;p&gt;Now, we can go back to the first terminal window and first explore what files were created there by the &lt;code&gt;init&lt;/code&gt; command:&lt;/p&gt;

&lt;p&gt;These files are the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;archives&lt;/b&gt;: this directory hols an template for the blog archives.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;_assets&lt;/b&gt;: this directory will hold all impages, and CSS files &amp;hellip; and hence also our bootstrap code. In this directory you can use any structure that you like (but note that this structure will be replicted in the docroot directory).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;config.yml&lt;/b&gt;: this file is in yaml-format and holds the configuration of the website.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;feed.xml&lt;/b&gt;: this xml template will generates an Atom feed for your site&amp;rsquo;s blogs.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;index.html&lt;/b&gt;: this is the home-page for your website&lt;/li&gt;
&lt;li&gt;&lt;b&gt;_posts&lt;/b&gt;: here you can put all the blogs that you want to publish in Markdown format.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;_templates&lt;/b&gt;: this directory holds all the layout templates are. All html pages will typically declare &amp;ldquo;extend layout.html&amp;rdquo;, this will ldoad the &amp;ldquo;layout.html&amp;rdquo; that sits in this directory. There are also templates for individual blog-posts (&amp;ldquo;post.html&amp;rdquo;) and an archive page (&amp;ldquo;archive.html&amp;rdquo;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you will have notice Mynt assumes that you create a website that is geared towards a blog-website. While this might seem a limitation, it is actually very flexible. The other &amp;ndash;static&amp;ndash; parts can be generated in a simple way, and the only part that needs to be updated frequently (with automatic generation of overview pages, pages per topic, tag-clouds, etc.) is the blog-section. Of coure the logic for blogs can be re-used to function with &amp;ldquo;news&amp;rdquo; for your website.&lt;/p&gt;

&lt;p&gt;You will also have seen that the content of the html files is in a specific format: those files are Jinja templates. Refer to the &lt;a href=&#34;http://jinja.pocoo.org/docs/dev/templates/&#34;&gt;Jinja Template Designer Documentation&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;Step one is of course to download Bootstrap.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href=&#34;download%20page%20of%20Twitter&amp;#x27;s%20Bootstrap&#34;&gt;http://getbootstrap.com/getting-started/#download&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You will get a zip-file that should be extracted in the &lt;code&gt;_assets&lt;/code&gt; directory (so that you have _assets/bootstrap/css, _assets/bootstrap/fonts and _assets/bootstrap/js)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next step is making sure that your website uses Bootstrap. Mynt provides a flexible framework that is easy to modify. Simply edit the file &lt;code&gt;_templates/page.header.html&lt;/code&gt; and replace the line refering to the css file with the two following lines:&lt;/p&gt;

&lt;p&gt;Now, your website should look like this:&lt;br/&gt;
&lt;img src=/assets/img/201510_mynt02.jpg &gt;&lt;/p&gt;

&lt;p&gt;You will notice that this is the same content as in previous section but that the layout is dramatically different. Already now you have a website that is using Bootstrap. Now you can start experimenting and changing the content of the pages, creating new blogs, etc. However if you like a website that is less oriented towards a blog, then it is probably worth reading on.&lt;/p&gt;

&lt;p&gt;If you indeed left the second console (with the &lt;code&gt;mynt serve docroot&lt;/code&gt; open, it is now sufficient to recompile the website (run the command &lt;code&gt;mynt -f gen src docroot&lt;/code&gt; in the first console) and go to the browser that has the page open and refresh the display (press F5) in order to see the results of your latest modifications.&lt;/p&gt;

&lt;p&gt;At this point we need to make a few design choices. If you want to make a blogging site, then you can start adding blogs to your site and all is ready to go. However if you make a more general site, there is still some work. For the rest of the tutorial we will assume that we make a more general website where we will keep the blogs to be a flexible section for &amp;ldquo;news&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;The root index.html will be a showcase for the blogs. This is probably not what you need, so we move this file to a subdirectory and create another intex.html file.&lt;/p&gt;

&lt;p&gt;Create now a new index.html file and add the following content&lt;/p&gt;

&lt;p&gt;The menu of the website that we will build now will be simple: only contain the following items:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Home&lt;/li&gt;
&lt;li&gt;News&lt;/li&gt;
&lt;li&gt;Value Offer&lt;/li&gt;
&lt;li&gt;Proof of Concept&lt;/li&gt;
&lt;li&gt;More&lt;/li&gt;
&lt;li&gt;Contact&lt;/li&gt;
&lt;li&gt;About Us&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For illustration purposes, we will have all of those items referring to the main page (index.html) except News, Proof of Concept and Press. Here the power of a tool such as Mynt becomes clear: in stead of copying the menu on all pages, we simply create it once and include it in other pages: when we then compile the website, Mynt will add it to all pages. To make it even easier to maintain, we will create a variable to store the menu and its URLs. Doing so, it will be easier to make changes.&lt;/p&gt;

&lt;p&gt;First, create a new file in &lt;code&gt;_templates&lt;/code&gt;, that you will call &lt;code&gt;nav.html&lt;/code&gt; and give it the following content:&lt;/p&gt;

&lt;p&gt;Now replace the content of the file &lt;code&gt;_templates/layout.html&lt;/code&gt; with the following content:&lt;/p&gt;

&lt;p&gt;Then add a new file &lt;code&gt;_templates/footer.html&lt;/code&gt; with the following content:&lt;/p&gt;

&lt;p&gt;This footer file can contain whatever you like (you can leave it blank if you wish). Note that this file will take the author form the src/config.yml file. So if you want to use it in this shape, you will need to update the config.yml file at this point.&lt;/p&gt;

&lt;p&gt;Of course you will have noticed that this footer contains buttons for some popular social media to share your web-page.&lt;/p&gt;

&lt;p&gt;Now create a few files:&lt;/p&gt;

&lt;p&gt;Of course, the precise content of these files will have to suit your own needs, but here is some inspiration.&lt;/p&gt;

&lt;p&gt;For the index.html file:&lt;/p&gt;

&lt;p&gt;Now, your website should look more or less like this:&lt;br/&gt;
&lt;img src=/assets/img/201510_mynt03.jpg &gt;&lt;/p&gt;

&lt;p&gt;Try to resize the browser window and you will see that the layout changes as the screen gets wider or narrower. For example a narrow screen will make the menu collapse in to the &amp;ldquo;hamburger&amp;rdquo; icon.&lt;/p&gt;

&lt;p&gt;The index files in &lt;code&gt;more&lt;/code&gt;,&lt;code&gt;about&lt;/code&gt; and &lt;code&gt;poc&lt;/code&gt; should have a similar setup as the index.html file in the root directory.&lt;/p&gt;

&lt;p&gt;The minimal setup would be (for the &lt;code&gt;src/about/index.html&lt;/code&gt;-file): &lt;/p&gt;

&lt;p&gt;Secondary files in those sub-directories should look almost the same (although you might want to adapt the breadcrumbs). For example the &lt;code&gt;src/about/philippe.html&lt;/code&gt; could look as follows:&lt;/p&gt;

&lt;p&gt;This is of course just the start, all the content and many other whistles and bells might be desired/needed.
You will want to add something like Google Analytics (to gain insight in how many people are reading your pages), a search functionality that is limited to your websites, a &lt;code&gt;favicon.ico&lt;/code&gt; file, etc. Naturally, you will want to use the power of Bootstrap in each and every page, but since that is the reason why you started reading this tutorial in the first place, I assume that you know where to find information about this.&lt;/p&gt;

&lt;p&gt;I hope that this is a good start!&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;&lt;em&gt;I hope that this tutorial is helpful.&lt;/em&gt; Please &lt;a href=&#34;/contact.html&#34;&gt;let me know&lt;/a&gt; if you find inaccuracies or if you think that it can be improved.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Trends in Asset Management in Europe via Five Questions</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2014/05/18/Trends-in-Asset-Management/" type="text/html" />
            <id>http://www.de-brouwer.com/2014/05/18/Trends-in-Asset-Management/</id>
            <updated>2014-05-18T22:02:00Z</updated>
            
            <summary type="html">Before answering that question it is probably wise to draw the attention to two little known facts that will help to understand what we&amp;rsquo;re actually talking about:</summary>
            <content type="html">&lt;p&gt;Before answering that question it is probably wise to draw the attention to two little known facts that will help to understand what we&amp;rsquo;re actually talking about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The European asset management market is dominated by institutional investors: roughly 75% of all assets are controlled by institutional investors. Insurers and pension funds and together control 42% and 33% is owned by other institutions. In order to win an institutional mandate one does not necessarily have to open another branch in another country, in any case institutional assets are stable and follow a strict governance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The European asset management market is mainly a market of UK (36%), France (20%) and Germany (10%). All the rest is much smaller: the three followers up are: The Netherlands, Italy and Belgium with resp. 4, 4 and 2% of the assets. There are of course historic reasons that go back to the industrial revolution that started in the UK and conquered Europe via France, The Netherlands and Belgium. These early adapters had an important early starter advantage in cumulating wealth and are roughly 200 years later still among those nations that accumulated the most wealth. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These two facts combined means that the large players cover easily 90% of the market with 5 to ten locations (which they already have most probably). The new investments are only marginally contributing to the bottom line and are mainly investing in the future growth of certain regions. What one sees is that there is more and more competition of the large USA houses (the Blackrocks and State Streets of this world).&lt;/p&gt;

&lt;p&gt;As argued before, distribution is key and the highest entry barrier. The cost of creating an asset manager is a containable cost, distribution might not at all be possible. The following approaches are used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Creating an asset manger&lt;/em&gt; and its processes as well as hiring some key people is not so difficult: it&amp;rsquo;s a process that is containable and will typically cost you 10 country-average year salaries. Expect to need a team of 3 to 4 very experienced people to set up the thing and get the licence in Europe. Then you need of course to step up. These costs are containable and &lt;em&gt;if&lt;/em&gt; distribution is working out then it is easily and fast earned back. The key in this approach is to set up a viable distribution. Therefore this approach is typically used if one owns distribution (insurance network, bank, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Buy an existing company&lt;/em&gt;. This is an attractive approach as it will ensure that you [a] ave a licence, [b] have some good people with local knowledge on board and [c] that there is some distribution in place. Also you can expect to have some assets and in many cases they appear to be rather sticky. In any case you will buy only if you believe that you have something to offer to the investors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More and more since UCITS IV it becomes realistic to &lt;em&gt;distribute products without having an asset manager in place&lt;/em&gt;. In most cases the local distributor will expect a local contact person or organization, but this can be your (small) sales wrap. This is more and more an attractive approach if you don&amp;rsquo;t want to become the unique choice of the mass market. Indeed in most countries becoming the choice of reference will require to have products that offer a local bias.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The answer to that question seems surprisingly stable. UK managers for the last decades tend to indicate that they pefer more exposure to hedge funds. Of course the reason is the search for alpha and diversification, both rational arguments to look at hedge funds. &lt;/p&gt;

&lt;p&gt;However there are loads of &amp;ldquo;irrational arguments&amp;rdquo; that make people afraid. Many have tried to blame hedge funds for the crisis but all those attempts have failed. For some it would have been convenient if an industry that is weakly or not organized could be blamed so the attention on them would fade, and for others it was their insatiable hunger for controlling all into the greatest detail that drove them to try to blame hedge funds. Despite the fact that no evidence was found that hedge funds could be to blame, they got more than a fair share of regulation. This of course fuelled the anti-hedge fund climate and slowed down plans of institutional investors. &lt;/p&gt;

&lt;p&gt;Another equally true explanation is that it is not so easy to invest in hedge funds. It takes a decade of errors and dedication to build up the capacity to invest in hedge funds. That&amp;rsquo;s the price that the Instutional Investors of the UK ar paying because of their choice to avoid funds of hedge funds and invest directly. One can therefore expect that investing more into hedge funds will remain high on the agenda of institutional investors for the next years to come. &lt;/p&gt;

&lt;p&gt;If an asset manger wants to be successful, then there are three crucial things: distribution, distribution and distribution. Asset management products are sold based on confidence. Confidence is not something that can be gained via computers and electronic media. People need to &amp;ldquo;look someone in the eyes&amp;rdquo; to know if he/she is reliable. Further confidence is not build up fast: it takes time. This means that the local branch of a bank that served your father and that financed your baptising party has an enormous advantage over other channels. People tend to trust advisers when deciding about investment products. This is not only true for the the small investor who gathers 20K over his/her lifetime, this also holds for private banking. The private banking client might be much more knowledgeable about investments and money, still trust will be the basis and cornerstone of the relation.&lt;/p&gt;

&lt;p&gt;So, if you don&amp;rsquo;t have your own distribution channel you&amp;rsquo;re simply one of the sharks in the &amp;ldquo;Red Sea&amp;rdquo;: you have a product that has no real differentiators, you cannot guarantee anything (not even that you can replicate past performance), &amp;hellip; and to make things even worse statistically you&amp;rsquo;re bound to destroy value for your customer.&lt;/p&gt;

&lt;p&gt;If you want to break through without a distribution channel then you must have an extraordinary product. However typically these extraordinary products are simply one bet on one trend. For example the fastest growing asset manger in Poland &amp;ndash;Arka&amp;ndash; in the period 2000 till 2007 had one strong focus: small cap companies. Every year they had the best performance of the whole market and his sales was the best &amp;hellip; till the crash of the small cap companies when they showed a more than fifty percent loss to many customers. For half a decade they have set the trend and were the top-selling asset manager, all based on one lucky bet.&lt;/p&gt;

&lt;p&gt;In summary, asset management is a business with seemingly low entry barriers, low capital requirements and can be set up with reasonable investment costs and lead time. However, it is very hard to create strong and sustainable distribution.&lt;/p&gt;

&lt;p&gt;Part of this question could refer to companies and the other part to products. First the companies: it has simply been a dull place in Europe without major changes.&lt;/p&gt;

&lt;p&gt;However, the asset management market is a very lively place and there are always companies doing good. For example we have a few strong hedge funds doing good business and for example Jabre Capital (Swiss based) is world leader in contingent Convertible Bonds (CoCo Bonds).&lt;/p&gt;

&lt;p&gt;Coco bonds are a relatively new and exciting asset class. They are supposed to be part of a bank&amp;rsquo;s contingency plan. The idea is that these bonds would be a buffer between equity and capital. The idea is that if a bank gets liquidity problems that then those bonds are automatically (at least not at the decision of the investor) converted to equity or even considered as lost. That could be enough so that that bank should not rely on the state for a bailout. The legislation is still in its infancy as is the product itself. That means that there is a wide variety of different terms and conditions. &lt;/p&gt;

&lt;p&gt;My personal guess would be that this asset class would grow fast and steadily. The logic behind is solid and the benefits are huge: a state would be able to ensure basic banking service without having to risk taxpayers money by investing into banks or granting them loans while no-one else does provide liquidity any more. The deeper &amp;ndash;and more important&amp;ndash; potential of this approach is that in the long run one can hope that this will spark a wave of de-regulation. That in its turn should &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;reduce the operational costs for banks and hence spark their role in re-allocating liquidity;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;re-educate banks in the sense that they take their responsibility serious and not just depend on states to help them if anything goes wrong (one of those things to do is to use coherent risk measures and stop using the flawed Value-at-Risk that accompanied banks to their graves only a few years ago;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;re-educate investors in thinking where to allocate money (ie. demand a higher risk premium from banks with worse numbers). This is essential in creating a healthy free-market climate. This disease &amp;ndash;in its non-cured form&amp;ndash; is the same bacteria that pushed countries like Greece, Spain, Portugal and Ireland towards taking more risk on board without significant interest rate hikes to compensate those risks (and warn the governments of the risks associated to their policies).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of course in these times where the call for more government intervention is out of control and where law-makers and controlling authorities compete for journalists and public favour by adding truck-loads of detailed laws and rules it will take a while before the bank system will be allowed to cure after its grave illness. First we will have to see trough a period of ill advised over-regulation that both slows down economy and make the banks even more sick.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Tutorial to create a Fully Automated Open-Source Work-flow for Statistics and Data Mining</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2014/03/30/Workflow-for-Statistics/" type="text/html" />
            <id>http://www.de-brouwer.com/2014/03/30/Workflow-for-Statistics/</id>
            <updated>2014-03-30T20:32:00Z</updated>
            
            <summary type="html">It is said that the typical person of our times consumes in one day as much information as a typical person in the Middle Ages would digest in his/her whole life. And this is only the visible top of the iceberg: the information that we see and get. But beneath the surface of these calm waters lays an ever growing ocean of information: the information gathered by electronic machines. From the app in our mobile phone counting your steps and pulling your position from the GPS to the transactional system your bank collecting your payment behaviour: every second loads of data are generated. Each person generates daily multiple mega- or even gigabytes of new and unique information. In order to make sense out of this we need to understand the underlying trends and concepts that are concealed in vast amounts of date: in other words we “need to run some statistics”, or do some “data crunching”.</summary>
            <content type="html">&lt;p&gt;It is said that the typical person of our times consumes in one day as much information as a typical person in the Middle Ages would digest in his/her whole life. And this is only the visible top of the iceberg: the information that we see and get. But beneath the surface of these calm waters lays an ever growing ocean of information: the information gathered by electronic machines. From the app in our mobile phone counting your steps and pulling your position from the GPS to the transactional system your bank collecting your payment behaviour: every second loads of data are generated. Each person generates daily multiple mega- or even gigabytes of new and unique information. In order to make sense out of this we need to understand the underlying trends and concepts that are concealed in vast amounts of date: in other words we “need to run some statistics”, or do some “data crunching”.&lt;/p&gt;

&lt;p&gt;There are very good commercial systems available that will do exactly this. Probably the best known is the information age pioneer and industry standard: Statistical Analysis System (better known as SAS). It will make your wallet a few million Dollars lighter and you get an interface that is an interesting mix of programming languages that in the 1980s were already outdated (as in “not even Object Oriented”) and the most modern, intelligent interfaces. It will come with loads of support and it will allow you to have a dynamical view, or a pre-generated set of reports at your fingertips in your favourite browser. SAS can run on a portable computer, a server or a super-computer; it is powerful and reliable. And above all it is the industry’s standard: so one can safely think: “no one ever gets fired for buying SAS”.&lt;/p&gt;

&lt;p&gt;Of course there are alternatives, like Sephen Wolfram’s “Mathematica”. This is a more modern tool that actually does statistics and reporting as something additional on top of its real calling: mathematical (symbolic) analysis. It will cost ten to hundred times less than SAS (typically under the $100’000), but you might want to combine it with a database system. Oh, and if you want to get a flavour: it comes free with the &lt;a href=&#34;http://www.raspberrypi.org/&#34;&gt;Raspberry Pi&lt;/a&gt;! So it will cost you less than your next lunch to get started.&lt;/p&gt;

&lt;p&gt;And of course there is an Open Source alternative (or as is so typical for open source: there is a multitude of possible combinations and configurations that can suit your needs). I will not give an overview of possibilities or combinations (although that cannot be avoided to mention a few), but in this tutorial I will try to give you one working solution. &lt;/p&gt;

&lt;p&gt;The idea is more or less as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Collect data in a database (we’ll use &lt;a href=&#34;http://www.mysql.com&#34;&gt;MySQL&lt;/a&gt; as example, but eg. &lt;a href=&#34;http://www.postgresql.org/%E2%80%8E&#34;&gt;PostgreSQL&lt;/a&gt; is also great (and it is &lt;a href=&#34;http://en.wikipedia.org/wiki/ACID&#34;&gt;ACID&lt;/a&gt; compliant! &amp;ndash; The relevance of this is that you will never need a function such as the &lt;tt&gt;sql.reset.query.cache()&lt;/tt&gt; as mentioned in our R-code)))&lt;/li&gt;
&lt;li&gt;Build a &lt;a href=&#34;http://en.wikipedia.org/wiki/Data_mart&#34;&gt;Data Mart&lt;/a&gt; data with &lt;a href=&#34;http://en.wikipedia.org/wiki/SQL&#34;&gt;SQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Build our model (or perform statistical analysis) with &lt;a href=&#34;http://www.r-project.org/&#34;&gt;R&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Present data in &lt;a href=&#34;http://en.wikipedia.org/wiki/Portable_Document_Format&#34;&gt;PDF&lt;/a&gt; via &lt;a href=&#34;http://www.latex-project.org/&#34;&gt;LaTeX&lt;/a&gt; (or &lt;a href=&#34;http://en.wikipedia.org/wiki/HTML&#34;&gt;HTML&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This stack has a few nice aspects and advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It &lt;strong&gt;can be fully automated&lt;/strong&gt; (every day your company’s website can reflect the latest result without human interference!)&lt;/li&gt;
&lt;li&gt;It is &lt;strong&gt;completely free (gratis)&lt;/strong&gt; and open source (so you can be sure that there are no backdoors as you can download code, check and compile yourself)&lt;/li&gt;
&lt;li&gt;From the start to the end we use tools that are quire ubiquitous and for each of them there is an &lt;strong&gt;active community to support you&lt;/strong&gt; … also for free. That is of course only relevant if your Google cannot help you.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step-by-step guide to install the open stack.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first thing that you will need is &lt;strong&gt;a working computer with a good operating system&lt;/strong&gt;. Everything below should work on a Windows, OS X or &lt;a href=&#34;https://www.freebsd.org/&#34;&gt;FreeBSD&lt;/a&gt; machine, but our guidance is for Linux. We assume that you have a working distribution on your PC, that it is booted up and that you know how to install packages (we assume a Debian where necessary to make the example concrete)&lt;/li&gt;
&lt;li&gt;Next we need to &lt;strong&gt;install the specific softwares&lt;/strong&gt; that we will use. If you installed for example Ubuntu Server Edition, then you will not have to install anything, however, if you started from the bare necessities, you might need the following.
&lt;pre&gt;&lt;code data-lang=&#34;bash&#34;&gt;# to be executed as root or insert &amp;quot;sudo&amp;quot; before each line
#-- MySQL, the database
apt-get install mysql-server -y 
apt-get install mysql-client -y 
apt-get install phpmyadmin -y 
apt-get install mysql-workbench -y  # if you prefer a GUI for manipulation for writing queries
# -- R:
apt-get install r-base -y
apt-get install r-base-dev -y
apt-get install r-cran-xtable -y
apt-get install r-cran-msm -y
apt-get install libmysqlclient-dev -y # this is needed for RMySQL !!
# -- LaTeX:
apt-get install texlive-latex-base -y 
apt-get install latex2rtf -y 
apt-get install latex2html -y 
apt-get install biblatex -y 
apt-get install texlive-lang-polish -y
# -- eventually the text-editor of your choice
apt-get install kdevelop, kate -y
# -- and also we want to use pdfcrop, and something to visualize our PDF output so we need also 
apt-get install pdftk   # needed for pdfcrop (and other goodies) but does not include pdfcrop itself
apt-get install okular  # the PDF viewer
&lt;/code&gt;&lt;/pre&gt; Now you still have to download the &lt;a href=&#34;http://www.perl.org/&#34;&gt;Perl&lt;/a&gt; script &amp;ldquo;pdfcrop&amp;rdquo;&amp;ldquo; from &lt;a href=&#34;http://sourceforge.net/projects/pdfcrop/files/pdfcrop/PDFCrop%20v0.4b/pdfcrop_v0.4b.tar.gz/download&#34;&gt;sourceforge&lt;/a&gt;, make it executable and copy it for example in /usr/local/bin:
&lt;pre&gt;&lt;code data-lang=&#34;bash&#34;&gt;cp pdfcrop /usr/local/bin/
chmod 755 /usr/local/bin/pdfcrop&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;By now you should have a working environment with all necessary software installed. The next step is to &lt;strong&gt;set up a database&lt;/strong&gt;, get your data and import it in the database. One caveat is that MySQL needs to be able to find your file to upload and it should be allowed to read your files. For me the following worked:
&lt;pre&gt;&lt;code data-lang=&#34;bash&#34;&gt;echo &amp;quot;Please enter your sudo password&amp;quot;
sudo cp MY_DATA.csv /tmp
sudo chown mysql:mysql /tmp/*csv&lt;/code&gt;&lt;/pre&gt;
&lt;code&gt;Note 1&lt;/code&gt;: Sure, for smaller datasets you can use &lt;code&gt;phpmyadmin&lt;/code&gt; to upload the data. For larger data-sets only the MySQL terminal will work reliably &amp;hellip; and of course only the terminal can be be fully automated (see below how).
&lt;code&gt;Note 2&lt;/code&gt;: If you are working on a machine that has only a command line interface, then you might want to use vi as a text editor and of course you won&amp;rsquo;t visualize the PDF files &amp;hellip; but apart from that everything below should work on terminal (you can do without a &lt;a href=&#34;http://en.wikipedia.org/wiki/Operating_system#Graphical_user_interfaces&#34;&gt;GUI&lt;/a&gt;!). Actually during development a GUI is most useful, but once you want to automate the flow nothing can compete with the CLI. You will have the comfort that the work-flow described here can be copied to a headless server for example that has no GUI.&lt;/li&gt;
&lt;li&gt;Now, &lt;strong&gt;upload the data in the database&lt;/strong&gt;. Of course the code snippet below is just a canvas. You will have to replace not only MY_DATABASE, tbl_TEST, etc. with your names, but also fieldnames, filenames, termination fields, etc.
&lt;pre&gt;&lt;code data-lang=&#34;sql&#34;&gt;USE MY_DATABASE;
DROP TABLE IF EXISTS tbl_TEST;
CREATE TABLE tbl_TEST
(
account_number CHAR(12) NOT NULL, PRIMARY KEY (account_number), total_balance_01 DECIMAL(12,2)
) ENGINE INNODB
COLLATE &amp;#39;utf8_general_ci&amp;#39;;
LOAD DATA INFILE &amp;#39;/tmp/data.csv&amp;#39; INTO TABLE tbl_TEST
FIELDS TERMINATED BY &amp;#39;;&amp;#39;
ENCLOSED BY &amp;#39;&amp;quot;&amp;#39;
LINES TERMINATED BY &amp;#39;\n&amp;#39;
IGNORE 1 LINES;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Typically you will want to &lt;strong&gt;prepare the data&lt;/strong&gt; and create some fields that contain aggregated information, or otherwise logically deduced information (for example if you try to model a lending portfolio, you will want to create fields indicating if an account &amp;ndash;at a certain month&amp;ndash; was ever in a delinquent state). This is handy as it will reduce compute time further down the road.
Another handy hint is that you can simply write all your SQL code in a text file (call it &lt;tt&gt;data/build_balance.sql&lt;/tt&gt; for example) and you can from the MySQL console invoke it by typing
&lt;pre&gt;&lt;code data-lang=&#34;sql&#34;&gt;source data/build_balance.sql&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And we&amp;rsquo;re ready to &lt;strong&gt;link our database to R&lt;/strong&gt;, or otherwise stated access our database from within R. To achieve this, do the following.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get the necessary packages and load them: &lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;install.packages(&amp;#39;RMySQL&amp;#39;)
library(RMySQL)&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Then, I would advice to create a text file and store the following functions:
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;# -------------------------------------------
# -- function to open the data base
sql.login &amp;lt;- function(theUser = &amp;quot;root&amp;quot;, thePwd = &amp;quot;&amp;quot;, theDB = &amp;quot;MY_DATABASE&amp;quot;, theHost = &amp;quot;localhost&amp;quot;)
{
if (thePwd == &amp;quot;&amp;quot;) {
cat(&amp;quot;Enter MySQL root Password: &amp;quot;)
thePwd &amp;lt;- readline()}
con &amp;lt;- dbConnect(MySQL(), user=theUser, password=thePwd, dbname=theDB, host=theHost)
con
}
# -------------------------------------------
# -- close the database-connection
sql.close &amp;lt;- function(con) {dbDisconnect(con)}
# -- get the sql data 
sql.get &amp;lt;-function(ssql,NBR=500000)
{
rs &amp;lt;- dbSendQuery(con, ssql)
data &amp;lt;- fetch(rs, n=NBR)
huh &amp;lt;- dbHasCompleted(rs)
dbClearResult(rs)
data
}
# -------------------------------------------
# -- execute a query that does not return anything (used for UPDATE, CREATE, etc.)
sql.run &amp;lt;-function(sSQL)
{
rs &amp;lt;- dbSendQuery(con,sSQL)
}
# -------------------------------------------
# -- reset query cache 
sql.reset.query.cache &amp;lt;- function ()
{
system(&amp;quot;sync &amp;amp;&amp;amp; echo 3 | sudo tee /proc/sys/vm/drop_caches&amp;quot;)
rc &amp;lt;- dbSendQuery(con, &amp;quot;RESET QUERY CACHE;&amp;quot;)
system(&amp;quot;sync &amp;amp;&amp;amp; echo 3 | sudo tee /proc/sys/vm/drop_caches&amp;quot;)
}&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;If you call this file for example &lt;code&gt;functions_sql.R&lt;/code&gt;, then you can load this functionality in R with the command     2. &lt;em&gt;Formatted tables&lt;/em&gt;. For example use the print function for the xtable object:
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;source(&amp;#39;functions_sql.R&amp;#39;)&lt;/code&gt;&lt;/pre&gt; That allows you to re-use code in more than one project. So, what you probably will want to do is build a file that loads all your packages, loads &lt;code&gt;functions_sql.R&lt;/code&gt; and then runs all your analysis. We&amp;rsquo;ll refer to this file as &lt;code&gt;calc_Balance.R&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Now the database can be used from within R.
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;con &amp;lt;- sql.login(thePwd = &amp;quot;XXXXXX&amp;quot;,theDB=&amp;quot;MY_DATABASE&amp;quot;)
bal &amp;lt;- sql.get(&amp;quot;SELECT total_balance_01 from tbl_TEST WHERE 1;&amp;quot;)
summary(bal)
plot(quantile(bal))
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This allows us to use the strengths of R combined with the strengths of our data mart to do our analysis, build our model or whatever we&amp;rsquo;re interested in or paid for. The trick is now to make sure that the &lt;strong&gt;output is generated in a format that can be picked up by LaTeX&lt;/strong&gt;. There are at least three simple possibilities.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Pre-formatted text&lt;/em&gt;. This might not be very elegant, but it is fast and it &amp;quot;just works&amp;rdquo;. This consists of transferring how something looks in the R-console to our report. For example
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;sink(&amp;quot;./tex/inc/summary.tex&amp;quot;)
summary(bal)
sink()
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Formatted tables&lt;/em&gt;. For example use the print function for the xtable object:
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;install.packages(&amp;#39;xtable&amp;#39;)
library(xtable)
M &amp;lt;- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol=3, byrow=TRUE, dimnames = list(c(&amp;quot;row1&amp;quot;, &amp;quot;row2&amp;quot;),c(&amp;quot;col1&amp;quot;, &amp;quot;col2&amp;quot;, &amp;quot;col3&amp;quot;)))
sink(&amp;quot;tex/inc/matrix.tex&amp;quot;)
x&amp;lt;-xtable(M,align=&amp;quot;|lrrr|&amp;quot;,digits=2, caption = &amp;quot;my caption.&amp;quot;) 
print(x)
sink()&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Graphs&lt;/em&gt;. Also here it is sufficient to print the plot to a file that can be loaded by LaTeX. For example:
&lt;pre&gt;&lt;code data-lang=&#34;r&#34;&gt;install.packages(&amp;#39;ggplot2&amp;#39;)  # this has to be done only once!
library(ggplot2) # this should move to the headers of calc_Balance (or better in a headers.R that is called from there)
d &amp;lt;- data.frame(bal)
p &amp;lt;- ggplot(d, aes(x=bal)) + geom_histogram()
ggsave(&amp;quot;tex/img/graph.pdf&amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now these elements can be added to you LaTeX (or HTML) report. Note that we assume that the calculations are done in a certain directory and that in that directory we have a subdirectory &lt;em&gt;tex&lt;/em&gt; in which we have &lt;em&gt;img&lt;/em&gt; and &lt;em&gt;inc&lt;/em&gt;. A minimal skeleton could look as follows:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And name this file for example model_doc_Balance.tex&lt;/p&gt;

&lt;p&gt;Typically one will want to re-run a model and its validation information (statistics such as Smirnov-Kolmogorov test, etc.) on a regular base when new data comes available.&lt;/p&gt;

&lt;p&gt;Now that we have the work-flow in place it can be automated end-to-end and even starting the workflow can be automated. To complete this it is sufficient to create one bash file that will do all previous steps sequentially. Assuming that we would for each of the previous steps the following files,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;data/prepare_Balance.sh&lt;/code&gt;  (to do the initial cleanup of the data via sed and awk for example &amp;ndash; eg. insert comma&amp;rsquo;s in a fixed width file, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;data/import_Balance.sql&lt;/code&gt; to prepare the data fields that we want to use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;calc_Balance.R&lt;/code&gt; to do all the statistical analysis (eventually using a header file to load packages and our &lt;code&gt;functions_sql.R&lt;/code&gt; file, a configuration file to define the specific parameters and names) and spitting out the text and graphs in the &lt;code&gt;tex/img&lt;/code&gt; and &lt;code&gt;tex/inc&lt;/code&gt; subdirectories.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tex/model_doc_Balance&lt;/code&gt; is your model documentation booklet in LaTeX&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tex/pres_Balance&lt;/code&gt; is the presentation about the model (slides in the &amp;ldquo;Beamer&amp;rdquo; class of LaTeX for example)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and assuming that you use Okular to visualize the PDF files in the last lines, then this &amp;ldquo;do-everything-file&amp;rdquo; could look as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Note&lt;/code&gt;: The first part in this file prepares the compilation of the LaTeX markup files. This is a little more complex than simply &amp;ldquo;latex myfile&amp;rdquo;, because it is prepared to allow you to use the package nomenclature, build an index, build a table of contents and have a reference system in place. The idea about the multiple runs is that we want to be sure that one call to our code gets all page references right (maybe I make a separate tutorial about this one).&lt;/p&gt;

&lt;p&gt;Assuming that the shell file from previous point is called &amp;ldquo;calc.sh&amp;rdquo;, we could run then our project with the following command:&lt;/p&gt;

&lt;p&gt;Linux is not only market leader on the small computers (routers, storage arrays, phones (via Android)  and leader among the biggest computers on this planet, it is also a versatile environment that allows you to control your system the way you want. It is for example very simple to fully automate the initiation of all calculations. &lt;/p&gt;

&lt;p&gt;Typically it is sufficient to add it to your relevant crontab file (eg. &lt;code&gt;/etc/cron.monthly&lt;/code&gt;) or refer to the documentation of your distro to fine tune cron (for example &lt;a href=&#34;http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job&#34;&gt;askbutu&lt;/a&gt; for the Ubuntu distribution.&lt;/p&gt;

&lt;p&gt;Free and Open Source Software (FOSS) is for people who value freedom, and this workflow can be moulded to suit your specific needs to any extend. For example&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can include the downloading of new data when it should be available.&lt;/li&gt;
&lt;li&gt;You can email a report by using the &lt;tt&gt;mail&lt;/tt&gt; command (on Ubuntu that might require to install first mailutils: &lt;tt&gt;sudo apt-get install mailutils&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;You can replace LaTeX markup with Markdown and automatically create a website using Jinja2 and Mynt for example (those are also the systems that helped creating this website). In that case you can even add to your automation file some checks if it worked fine and then us &lt;tt&gt;rsync&lt;/tt&gt; to upload the new html files to your webserver.&lt;/li&gt;
&lt;li&gt;Of course you can replace MySQL with PostgreSQL, R with Octave, kate by vi, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr&gt;

&lt;p&gt;&lt;em&gt;I hope that this tutorial is helpful.&lt;/em&gt; Please &lt;a href=&#34;/contact.html&#34;&gt;let me know&lt;/a&gt; if you find inaccuracies or if you think that it can be improved.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Workshop on Teamwork and Leadership</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2013/09/15/Workshop-on-Teamwork-and-Leadership/" type="text/html" />
            <id>http://www.de-brouwer.com/2013/09/15/Workshop-on-Teamwork-and-Leadership/</id>
            <updated>2013-09-15T18:27:00Z</updated>
            
            <summary type="html">Recently I did for my employer a workshop on Teamwork and Leadership. I loved every second of it and so did the participants. The feedback was very encouraging.</summary>
            <content type="html">&lt;p&gt;Recently I did for my employer a workshop on Teamwork and Leadership. I loved every second of it and so did the participants. The feedback was very encouraging.&lt;/p&gt;

&lt;p&gt;Druring my carreer I&amp;rsquo;m in a people managers role for about 20 years now with many C-level function in different countries, on different levels and in different companies. I made a lot of mistakes! But I also did some things that really worked out and recently my boss gave me the works of Patrick Lencioni and a whole new world opened for me. &lt;/p&gt;

&lt;p&gt;I started to realize why certain things worked out well and why certain things did not work. It became a passion &amp;hellip; that I love to share of course and recently it culminated in this workshop. The workshop does two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;building understanding and trust with the MBTI personality indicators as a guide and&lt;/li&gt;
&lt;li&gt;building on that trust to lay the foundations of a performing team.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Such workshops become very personal (and sometimes very emotional too), and to make it fit my own personality I decided to package it as &amp;ldquo;executive training&amp;rdquo;. With that I mean that it was highly personlizized and it is designed to be done with the group that should function as a team. The training is actually moulded in function of the personalities of the people present, also the materials that afterwards everyone gets are highly personlizized to support that particular team.&lt;/p&gt;

&lt;div class=&#34;btn-group btn-group-sm&#34;&gt;&lt;div class=&#34;btn btn-default&#34;&gt;&lt;a href=&#34;/assets/papers/Teamwork_workshop_flyer.pdf&#34; target=&#34;_blank&#34;&gt;Download Flyer&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
</content>
        </entry>
    
        <entry>
            <title>Maslowian Portfolio Theory</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2012/02/18/Maslowian-Portfolio-Theory/" type="text/html" />
            <id>http://www.de-brouwer.com/2012/02/18/Maslowian-Portfolio-Theory/</id>
            <updated>2012-02-18T11:49:00Z</updated>
            
            <summary type="html">Finally, I finished my PhD. While it was an enjoyable process and I really learned a lot on the way, it felt like ages. I wanted so much to finish the Ph.D. before my second child was born. Now he is almost a year old. A big thank you to my wife, Joanna, for all the support and my gratitude to my promotor, Freddy Van den Spiegel.</summary>
            <content type="html">&lt;p&gt;Finally, I finished my PhD. While it was an enjoyable process and I really learned a lot on the way, it felt like ages. I wanted so much to finish the Ph.D. before my second child was born. Now he is almost a year old. A big thank you to my wife, Joanna, for all the support and my gratitude to my promotor, Freddy Van den Spiegel.&lt;/p&gt;

&lt;p&gt;Of course, making a Ph.D. is a rewarding experience and it really teached me a lot about scientific work, the scholastic method, coherent investments, etc. &amp;hellip; but above all: I&amp;rsquo;m on a mission.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m on a mission to improve advise about investments. I truly and honestly believe that almost all banks, robo-advisers and agents do not a good job. &lt;/p&gt;

&lt;p&gt;FINRA in the USA and MiFID in Europe require investment advisers to make clear if they give advice or not and if they give advice they must take into account the educational background and investment goals of the investor. This makes a lot of sense, but at best they do an awkward effort to fit liquidity into an old concept that is void of investment goals.&lt;/p&gt;

&lt;p&gt;The main thinking about investment advice goes back to utility functions, and Markowitz&amp;#39; mean variance portfolio theory. This approach has the following issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It requires to consider all investments in one portfolio and optimize this. This implies that the house, the shares, the savings account and the cash to buy a sandwich need to be optimized in one bucket. This makes &amp;ndash;for humans&amp;ndash; no sense. Humans have needs that need to be addressed separately, they need clarity on what is achievable for what goal.&lt;/li&gt;
&lt;li&gt;There is only one investment horizon in that optimization. What horizon makes most sense when we put a house that we plan to keep forever together in one bucket with cash we need tomorrow? There is no answer. Typically bankers assume that nor the cash of the house is part of the equation (is not considered as part of the investment portfolio), the apply an arbitrary horizon of 5 years &amp;hellip; probably because they see five fingers on one hand.&lt;/li&gt;
&lt;li&gt;There is no way to connect this result to reality and investment products in an objective way. In fact, we need the &amp;ndash;not so intuitive&amp;ndash; concept of &amp;ldquo;volatility&amp;rdquo; to make the link. This results in arbitrary matching of a an arbitrary safe portfolio to an arbitrary level of volatility, an arbitrary matching of an arbitrary level of high volatility to a dynamic portfolio and some kind of arbitrary scaling in between.&lt;/li&gt;
&lt;li&gt;Most bankers optimize with a forced percentage of risky assets (shares), instead of cash a would be required by the CAPM theory. So, the optimization is arbitrary and subjective.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary &lt;b&gt;this is a disaster for a generation&lt;/b&gt;. Markowitz&amp;#39; theory works fine when the investor is just gambling with money that he or she does not need (read: &amp;ldquo;is so rich that he or she never need to worry about subsistence&amp;rdquo;). This made sense in 1952, when Markowitz wrote his insights down and it was indeed as step in the right dthat irection. &lt;/p&gt;

&lt;p&gt;However, today the world is a different place and we are all part of a generation that unlike any before us:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Will see that states will be unable to provide subsistence out of their balance sheets, because of increasing medical costs, increased longevity and decreased natality.&lt;/li&gt;
&lt;li&gt;Hence, you will &lt;b&gt;have to&lt;/b&gt; invest for your own retirement &amp;mdash; this is no longer a choice.&lt;/li&gt;
&lt;li&gt;Therefore, millions of people that will invest will not be so rich that they never have to worry about subsistence and they will have to worry about what to spend for what goal. They will have concrete questions like &amp;ldquo;How much can I spend on this dream holiday and still send my daughter to a good university in 5 years?&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The traditional theories have no answer and the states will have no cash. That&amp;rsquo;s why I think the sacrifices were worth it. And I apologise to my family, for it is not over, it is merely a start.&lt;/p&gt;

&lt;p&gt;Well, we have on the one hand Markowitz&amp;#39; theory that tells to put all assets in one bucket and on the other hand the reality that no-one does so (eg. we haveseparate the descriptive theory, &amp;ldquo;Behavioural Portfolio Theory&amp;rdquo; that describes well how people invest: separate buckets for retirement, projects and playing on the stock exchange). As long as this cognitive dissonance exists, bankers and investors alike will be confused.&lt;/p&gt;

&lt;p&gt;Maslowian Portfolio Theory (henceforth MaPT)provides a compelling answer: &amp;ldquo;people are right: one needs different buckets for separate investment goals&amp;rdquo;. MaPT starts from the the paradigm that investment are not necessarily a goal in themselves, they rather serve to support other goals: the real life-goals such as retiring, send your kid to school, leave a donation to a shelter.&lt;/p&gt;

&lt;p&gt;That is the only tricky part. Once we agree with that, the rest is easy. Human needs are already described by Maslow in 1942. While some amendements are proposed to that theory the main point that &amp;ldquo;needs are separate in nature and that when one of the needs is not addressed it will get mental priority and will make us feel bad&amp;rdquo; still stands strong. From this automatically follows that the only safe wayt to help people achieve a satisfiable life is to make safe buckets for each and every big life-goal.&lt;/p&gt;

&lt;p&gt;As a bonus we get that each and every of those goals sets concrete parameters that can be used to optimize the investment portfolio (eg. we need a sum of X in Y years). This takes the large amount af fiddling out of the equation too!&lt;/p&gt;

&lt;p&gt;Well, it makes life a little more complicated for an investment advisor.
focussed 
1. Today they are all product-focussed. They need tfocussed o start speaking the language of the customer.
2. Today they are focussed on transaction stories like &amp;ldquo;invest in USA debt&amp;rdquo; and then a few months later have another story, inciting the investor to switch assets and so they can earn a transaction fee. So, advisors rather should take and advice fee. That is a little more complicated to explain.
3. They need a way to follow up these investments. That is not available yet.&lt;/p&gt;

&lt;p&gt;MaPT makes things more difficult and almost postulates a complex and personalised follow up of the investment portfolio. So, it will be necessary to build such a software.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Maslowian Portfolio Theory in de Tijd</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2012/02/15/Maslowian-Portfolio-Theory-in-De-Tijd/" type="text/html" />
            <id>http://www.de-brouwer.com/2012/02/15/Maslowian-Portfolio-Theory-in-De-Tijd/</id>
            <updated>2012-02-15T14:55:00Z</updated>
            
            <summary type="html">&lt;a target=&#34;_blank&#34; href=&#34;/assets/img/20120202_tijd_p16.pdf&#34;&gt;&lt;img align=&#34;right&#34; src=&#34;/assets/img/20120202_tijd_p16.png&#34; /&gt;&lt;/a&gt;
&lt;p&gt;The Belgian national financial newspaper, &lt;a target=&#34;_blank&#34; href=&#34;http://www.tijd.be&#34;&gt;De Tijd&lt;/a&gt;, published on 3 Feb 2012 an interview with me in which the essence of Maslowian Portfolio Theory are explained.</summary>
            <content type="html">&lt;p&gt;&lt;a target=&#34;_blank&#34; href=&#34;/assets/img/20120202_tijd_p16.pdf&#34;&gt;&lt;img align=&#34;right&#34; src=&#34;/assets/img/20120202_tijd_p16.png&#34; /&gt;&lt;/a&gt;
&lt;p&gt;The Belgian national financial newspaper, &lt;a target=&#34;_blank&#34; href=&#34;http://www.tijd.be&#34;&gt;De Tijd&lt;/a&gt;, published on 3 Feb 2012 an interview with me in which the essence of Maslowian Portfolio Theory are explained.&lt;/p&gt;
&lt;p&gt;The interview is by Pierre Huylebroek and is in Flemish only.
&lt;/p&gt;&lt;/p&gt;

&lt;div class=&#34;btn-group btn-group-sm&#34;&gt;&lt;div class=&#34;btn btn-default&#34;&gt;&lt;a href=&#34;/assets/img/20120202_tijd_p16.pdf&#34; target=&#34;_blank&#34;&gt;Donwload the page in PDF format&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
</content>
        </entry>
    
        <entry>
            <title>Thinking Coherently for Everyone</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2012/02/14/Thinking-Coherently/" type="text/html" />
            <id>http://www.de-brouwer.com/2012/02/14/Thinking-Coherently/</id>
            <updated>2012-02-14T15:09:00Z</updated>
            
            <summary type="html">The core idea of Maslowian Portfolio Theory explained very short and simple.</summary>
            <content type="html">&lt;p&gt;The core idea of Maslowian Portfolio Theory explained very short and simple.&lt;/p&gt;

&lt;p&gt;Much research has been devoted to a better understanding of financial markets. Much less studies are available about how to adapt an investment portfolio to the needs of a person.&lt;/p&gt;

&lt;p&gt;Actually, Markovitz&amp;#39; mean-variance criterion (formulated in 1952) is still the dominant line of thinking. This paradigm where each investor has one investment portfolio that should cater for all investment goals, was also the base of recent legislation such as MiFID, FINRA and to some extend UCITS IV.&lt;/p&gt;

&lt;p&gt;All those regulations use the concept that one investor has one risk profile and that volatility captures the concept “risk”. Doing so, they mostly ignore the different time horizons, importance and relevance of different investment goals. But worse, they have to rely on magical thinking and rule of thumb to match this mysterious risk profile to investments. When using a target-based approach it becomes possible to make reasonable assumptions about the different sub-portfolios and this should lead to more robust results.&lt;/p&gt;

&lt;p&gt;This PhD puts financial investment into perspective: the investor&amp;rsquo;s perspective. The result is a new normative portfolio theory which confirms Behavioural Portfolio Theory, draws attention to the importance of asset-liability matching, and offers a natural framework for investor-adviser dialogue and mathematical portfolio optimization.&lt;/p&gt;

&lt;p&gt;In this system investment goals, not investor psychology, drive investment advice; &amp;ldquo;risk&amp;rdquo; depends on the goal (often inflation-linked), and may be different in each sub-portfolio. Hence the ruling paradigm in which each investor has a single risk profile can be a misleading and dangerous simplification.&lt;/p&gt;

&lt;p&gt;(Yes it took me more than 500 pages in the book with the same name)&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Thinking Coherently for Everyone</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/10/28/Thinking-Coherently-4-Everyone/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/10/28/Thinking-Coherently-4-Everyone/</id>
            <updated>2011-10-28T22:56:00Z</updated>
            
            <summary type="html">In this very short paper, I try to summarize the importance of coherent risk measures using clear examples.</summary>
            <content type="html">&lt;p&gt;In this very short paper, I try to summarize the importance of coherent risk measures using clear examples.&lt;/p&gt;

&lt;p&gt;The paper should be readable for everyone, and more in particular should be a pleasure to read for people who do not like mathematics that much &amp;hellip; and btw, it is only four pages long!&lt;/p&gt;

&lt;div class=&#34;btn-group btn-group-sm&#34;&gt;&lt;div class=&#34;btn btn-default&#34;&gt;&lt;a href=&#34;/assets/papers/thinking_coherently_4_everyone.pdf&#34; target=&#34;_blank&#34;&gt;Download&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
</content>
        </entry>
    
        <entry>
            <title>Thinking Coherently</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/10/26/Thinking-Coherently/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/10/26/Thinking-Coherently/</id>
            <updated>2011-10-26T12:39:00Z</updated>
            
            <summary type="html">Niels Bohr once said that if all humanity would be lost and we were to pass only one sentence to the next generation that we should pass the information that matter is composed of atoms. Now humanity has built up almost hundred years more history, and with that hindsight I would prefer another sentence to be passed on. I would say &amp;ldquo;When thinking about risk, do it in a mathematically coherent way, that is only use convex risk measures that are related to the downside of the profit distribution&amp;rdquo;. I believe that our ability to start thinking coherently about risk will determine whether or not the capitalist system will survive and whether or not we leave a free world to our children or not.</summary>
            <content type="html">&lt;p&gt;Niels Bohr once said that if all humanity would be lost and we were to pass only one sentence to the next generation that we should pass the information that matter is composed of atoms. Now humanity has built up almost hundred years more history, and with that hindsight I would prefer another sentence to be passed on. I would say &amp;ldquo;When thinking about risk, do it in a mathematically coherent way, that is only use convex risk measures that are related to the downside of the profit distribution&amp;rdquo;. I believe that our ability to start thinking coherently about risk will determine whether or not the capitalist system will survive and whether or not we leave a free world to our children or not.&lt;/p&gt;

&lt;p&gt;Since 1638 expected value is was used as a measure for risk, during last century utility has been linked to risk and various risk measure have been proposed such as volatility. Back in 1997, Philippe Artzner and Freddy Delbaen and Jean-Marc Eber and David Heath, published a paper &amp;lsquo;Thinking Coherently&amp;rsquo;. With financial risks in mind, but with a deep and universal approach, they proposed four axioms that risk measures should satisfy in order to be &amp;ldquo;coherent&amp;rdquo;. To be honest, there might be more coherent sets of axioms, just as there are many coherent alternatives for Euclid&amp;rsquo;s axioms.  Just as these alternatives describe another reality than the geometry on the plane (for example geometry on a sphere), it is also in finance possible to find other sets of axioms that are coherent. What is coherence in finance?&lt;/p&gt;

&lt;p&gt;Different people might define coherence different, but few people would disagree that a coherent risk measure should satisfy the following conditions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;is an investment X has always worse outcomes than Y (in every observation), then X is more risky&amp;mdash;in other words, a risk measure should be related to the downside of the investments (or the left tail of the return distribution).&lt;/li&gt;
&lt;li&gt;If we invest more, our risk increases&amp;mdash;Artzner asks a direct connection: twice the investment, then twice the risk.&lt;/li&gt;
&lt;li&gt;If we diversify, the risk must decrease.&lt;/li&gt;
&lt;li&gt;If we hedge our position, then the risk decreases with that amount&amp;mdash;Artzner asks that if we add an amount of cash, that the risk should be decrease with the same amount.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The above statements seem to be acceptable, but are by far not the only possible way to define coherence. This definition of coherence seems to be fine for the investor that cannot influence prices, is not allowed to think in terms such as &amp;ldquo;once I default it does not matter any  more&amp;rdquo;. The investor in Artzner&amp;rsquo;s approach cannot influence price and while an individual would not care if he has twice or ten times a debt that he can never repay, for the society it does matter. For example, once a bank defaults its shareholders lost their investment, and that&amp;rsquo;s it. They might not care if the bank defaulted with a net liability of one dollar or one billion dollar. The society that has to cope with the fallout (maybe a bailout) should care.&lt;/p&gt;

&lt;p&gt;The most prominent issue for internal coherence might be the fact that a risk measure has only one minimum. Otherwise behaviour is erratic and has nothing to do with risk. For example, we would expect that if a portfolio is diversified more and more that the risk decreases more and more. Mathematicians would say that the risk measure needs to be &amp;ldquo;coherent&amp;rdquo;. This property ensures that
We should only find one optimum, when we find local optima this means that our risk measure is internally incoherent and cannot be used to optimize portfolios.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Replace Text in Multiple Files</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/09/01/Replace-text-in-multiple-files/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/09/01/Replace-text-in-multiple-files/</id>
            <updated>2011-09-01T22:27:00Z</updated>
            
            <summary type="html">Did you ever change your mind and want to change the name of one variable in your complete code base? Or change a name in all documents? You want to change one string with another in all files in a certain directory.</summary>
            <content type="html">&lt;p&gt;Did you ever change your mind and want to change the name of one variable in your complete code base? Or change a name in all documents? You want to change one string with another in all files in a certain directory.&lt;/p&gt;

&lt;p&gt;Linux gives you the right tools. There are multiple options.&lt;/p&gt;

&lt;p&gt;Assume that in all files with the extention &lt;tt&gt;cpp&lt;/tt&gt; (that are in the directory &lt;tt&gt;PATH/TO/DIRECTORY&lt;/tt&gt;) we want to change the string &lt;tt&gt;OLDSTRING&lt;/tt&gt; with &lt;tt&gt;NEWSTRING&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Pipeing from find to perl&lt;/p&gt;

&lt;p&gt;or if you want to make a backup before changing the files (and starting from Perl):&lt;/p&gt;

&lt;p&gt;or (without making a backup and starting from Perl)&lt;/p&gt;

&lt;p&gt;Example (exchange in all files):&lt;/p&gt;

&lt;p&gt;While Perl would be in most repositories and is most probably installed, some machines with minimal installations (such as servers) might not have Perl and it might not be advisable to tinker with them. One fall-back solution would be to use the good old &lt;code data-lang=&#34;bash&#34;&gt;sed&lt;/code&gt;;&lt;/p&gt;

&lt;p&gt;Probably it is the easiest to create a small file (eg. &lt;code data-lang=&#34;bash&#34;&gt;ch_all.sh&lt;/code&gt;) with the following content:&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&#34;bash&#34;&gt;\#!/bin/bash
     for fl in *.cpp; do  #comment
     mv $fl $fl.old
     sed &#39;s/OLDSTRING/NEWSTRING/g&#39; $fl.old &gt; $fl
     rm -f $fl.old
     done&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course you should not forget to make the file executable and execute it:&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Pensions Systems in Ireland and Poland, a quick comparison</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/07/14/Pension-Systems-of-Ireland-and-Poland/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/07/14/Pension-Systems-of-Ireland-and-Poland/</id>
            <updated>2011-07-14T21:06:00Z</updated>
            
            <summary type="html">When Poland in 1999 reformed its pension system it displayed &amp;ndash;despite some important mistakes that we will elaborate further&amp;ndash; not only a courageous vision, but created a system that is inherently healthy and was an important investment in all the future generations. Pensions were to be taken from the current balance of the country and to be held on private accounts. That would free the state from an impossible situation at periods when the relative income for the state would be weak, providing critical strength in such difficult moments.</summary>
            <content type="html">&lt;p&gt;When Poland in 1999 reformed its pension system it displayed &amp;ndash;despite some important mistakes that we will elaborate further&amp;ndash; not only a courageous vision, but created a system that is inherently healthy and was an important investment in all the future generations. Pensions were to be taken from the current balance of the country and to be held on private accounts. That would free the state from an impossible situation at periods when the relative income for the state would be weak, providing critical strength in such difficult moments.&lt;/p&gt;

&lt;p&gt;There is one generation that pays the cost. The generation that is working now funds the state pension system that is financing pensions not from its savings but from the current income. That generation will not only fund the old system but also save for its own pension. On top of that, this generation, should not expect anything from the old pension system when they retire. I believe that we all can be proud to pay this cost and free future generations from this burden. Besides &amp;ndash;as Mr. Rostkowski rightfully notes&amp;ndash; that will provide Poland a competitive advantage in the decades to come when other countries &amp;ndash;such as the Czech Republic&amp;ndash; fill face the bankruptcy of their state pension system and will have to make the switch in a later generation.&lt;/p&gt;

&lt;p&gt;Unfortunately the difficult moments &amp;ndash;that the new system would protect us from&amp;ndash; came before the change was completed. The so needed reform of Polish public finance that made such a good start came to a grinding halt under the PIS rule and the economic boom of 2003&amp;ndash;2007 was not used to make these important changes. Despite this Poland did well during the Global Meltdown and is still &amp;ldquo;first in class&amp;rdquo; in Europe. But during the crisis the public debt rose to almost the critical limit of 55% of GDP. Above that limit, Poland will face serious austerity measures from Europe, that seeks above all financial stability.&lt;/p&gt;

&lt;p&gt;The government needed to act fast and strong at the eve of 2010. The state pensions system was a big chunk of the budget and that was an easy target: in one move the public debt could be reduced to a safe 47% of GDP. They decided to reduce the contribution to the private OFEs from 7.3% to 2.3%, and use the difference &amp;ndash;5%&amp;ndash; to fund the bankrupt state system. Unfortunately, the government made one important mistake. In stead of explaining that this is evil and that it is temporarily it decided to lie and pretend that the move was good and make the move permanent. The day that it was announced &amp;ndash;December 2010&amp;ndash;, Mr. Rostkowski explained that it would not change anything: &amp;ldquo;If we would give the money to the OFE, then they would buy bonds and so finance the public debt to pay for the state pension system. This is just a short-cut.&amp;rdquo; Once can of course ask why a government would introduce such change if it would not change anything. In any case, Mr Rostkowski is right from the point of view of the balance of the state, and yes, it has the advantage that Poland will not show 55% of debt, but 47% or so and hence pay millions less on interests (not only a lower outstanding amount to pay on but also a lower interest rate because a debt/GDP ratio of 47% looks better than 55%!). Unfortunately nothing can be further removed from the truth than this statement when your point of view is taken! From your point of view what happens is that the monies that were destined to be invested on your behalf on your account in order to contribute to your pension &amp;hellip; well, they are now used to pay the pensions of the people that are now living from the state pensions system. The cash is gone, and there is nothing real &amp;ndash;only virtual money, similar to Monopoly money&amp;ndash; it leaves us with nothing more than a claim to the generation of your children and hope that they do display the same generosity as we do now.&lt;/p&gt;

&lt;p&gt;It is sad that a system that proved not to function is allowed &amp;ndash;as a vampire&amp;ndash; to suck the blood of an inherently healthy system and by doing so crippling that healthy system. But this might be just what we need for a while (it could be the least of two evils!). However it has to be noted that the fact that this is hidden in a mist of half-truths does not help anyone.&lt;/p&gt;

&lt;p&gt;Most reactions in Poland focussed on the risk that this Rostkowksi-reform would dry up capital acquisition of private companies (OFEs invest roughly 40% in equities) and hence hinder economic growth seems to me a true but very limited problem. Poland is one of the stronger economies and it has a great future. The fact that the economic growth will continue to be strong should support the stock exchange and while the growth might be slower, I believe that companies will still be able to find funding and support economic growth. The main problem is the one described above: presenting the vampire as the good one and crippling the inherently healthy pension system on the long run.&lt;/p&gt;

&lt;p&gt;But when I speak of the reform of 1999 as an &amp;ldquo;inherently healthy system&amp;rdquo;, then I refer strictly to the essence of it as described above: funding of a private account and paying pensions from savings (not from current income). Many things &amp;ndash;while historically forgivable to a limited extend&amp;ndash; are an outright crime to the taxpayer. Let&amp;rsquo;s run through a few examples.&lt;/p&gt;

&lt;p&gt;There are two major problems: the system feeds on a distorted view on how free market competition can be healthy (and thereby limit the potential to tailor investments to the investor&amp;rsquo;s need) and second it is expensive &amp;hellip; very expensive, because it is designed in mistrust of the efficient asset management industry.&lt;/p&gt;

&lt;p&gt;To illustrate these problems, we will use a hypothetical example of Mr Berczyk K., who earns 1000 PLN a month and we assume an allocation of 7.3% on top of that to the private pension fund. So, if you earn for example 4500 PLN just multiply all the numbers by 4.5 to find your figures.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s start by choosing a reference. I work in Ireland now and co-run a very small pension fund of only 20 (twenty!) employees. The pensions fund is a simple securities account with a large provider and all costs are paid by the employer (so separate from the pensioner&amp;rsquo;s savings). This small fund gives me enough purchasing power to bargain a 0% entrance fee and a 0.5% management fee on a global equity fund (while of course having a wide range of &amp;ndash;free to choose!!&amp;ndash; funds for all employees in the system! Let&amp;rsquo;s name the Irish investor Paddy and let&amp;rsquo;s make abstraction of the huge differences in salaries between Ireland and Poland and hence assume that he earns exactly the same as Berczyk. The polish investor will not even get the benefits of global diversification and &amp;ndash;what is infinitely worse&amp;ndash; not the benefit of free choice of strategic asset allocation (but more about that later), on top of that he pays 3.5% entrance fee and an average management fee of 1.38% (2009 figures, the 2010 numbers should be lower).&lt;/p&gt;

&lt;p&gt;We further assume simply a stable risk premium of 3% above 3% long term interest rate and assume that both Mr Berczyk K. and Mr. Paddy O. (from my small pension fund) are 20 years old and retire at 65 years old. If we only look at the difference in costs and assume an average return of 5% per month for both of them, then Mr Paddy will retire with 164 thousand euro and Mr Berczyk with 138 thousand, a dazzling 20% difference! But, Mr Paddy is free to choose his own strategic asset allocation. Assume now that he simply chooses for equities till he&amp;rsquo;s 55 years old and the last ten years uses fixed income investments, while Mr Berczyk will always have a 50/50 investment over bonds and equities. In that case we expect Paddy to retire with 121 thousand euro in his pocket and Berczyk with 90 thousand, a difference of almost 35%. But that is not the most important here. Paddy can as he get closer to retirement change to a safer strategic asset allocation and completely eliminate the risk of a large market drop-off in the last years (when there is no chance that his investments will recover till retirement, because the time is too short), while Berczyk cannot. If the markets drop off a cliff the month before Berczyk&amp;#39; retirement (assume 30%), then Berczyk will have to live with about 50% of Paddy!&lt;/p&gt;

&lt;p&gt;Sure, a 30% drop-off is extreme on a diversified portfolio, but of you have been working 45 years for those savings even a 5% drop-off will not make Berczyk smile. It is not too difficult to eliminate most of the cost inefficiencies, but the worst of all inefficiencies is the fact that Berczyk cannot change his strategic asset allocation. And that can be changed without any effort at all: simply delete the ridiculous law that forces OFEs to copy each other or face penalties and rather encourage that they offer a 3 or 4 different risk profiles for the investor to choose from. The actual system where a pension fund that differs in performance risks to have to pay into the fund is a very costly one (the owners of the pension funds are very cautious after the many mood changes of many governments, but especially the last will make a PTE their worst investment &amp;hellip; that is probably the most important reason of the high management fee). That system is of a demagogic importance, but intelligent people as Mr Rostkowski and Mr Tusk should be able to look through that and do what is best for the Polish Citizens: change those rules and explain why.&lt;/p&gt;

&lt;p&gt;On top of that, if we assume &amp;ndash;in the worst scenario&amp;ndash; the reduced payments of to the private system, Berczyk will have only 20K, that is six time less than his twin brother in Ireland. For the rest he would have to rely on the charity of the working generation in the future to continue to add something to his pension from the running balance. That new generation could then well be in an impossible situation because of the extra pressure that Mr Roskowski added to the current national balance (combined with some future problems).&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Complicated Investment Products</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/06/22/Complicated-Products/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/06/22/Complicated-Products/</id>
            <updated>2011-06-22T10:19:00Z</updated>
            
            <summary type="html">I believe that by now I have accumulated some experience after 15 building business and recently finishing my PhD. However some things continue to surprise me. The recent crackdown on so called complicated products&amp;mdash;on both sides of the Atlantic Ocean. I still have difficulties to understand what it is about?</summary>
            <content type="html">&lt;p&gt;I believe that by now I have accumulated some experience after 15 building business and recently finishing my PhD. However some things continue to surprise me. The recent crackdown on so called complicated products&amp;mdash;on both sides of the Atlantic Ocean. I still have difficulties to understand what it is about?&lt;/p&gt;

&lt;p&gt;Would you refuse laser-therapy to a patient because he or she is not able to understand the laws of quantum optics? Would you refuse someone to buy a care with an airbag because he or she is unable to understand its IC circuits? Wouldn&amp;rsquo;t that be extremely unfair? &lt;/p&gt;

&lt;p&gt;So would it be fair to refuse to someone the best fitted investment strategy because &amp;ldquo;it is complicted&amp;rdquo;?&lt;/p&gt;

&lt;p&gt;What would have happened to the car industry if hundred years ago a law would forbit to make &amp;ldquo;complicated cars&amp;rdquo;? What would have happened to life expectation if regulaters would crack down on complicated medical treatments? Why would anyone do that?&lt;/p&gt;

&lt;p&gt;But in the investments industry it is something that seems to be loved by the media &amp;hellip; or that is at least the only reasonable explanation that I can think of. Why else would regulators do so? For the sake of control? The fun of discriminating the &amp;ldquo;stupid masses&amp;rdquo;?&lt;/p&gt;

&lt;p&gt;It gets even more surrealistic when the regulators get down to details. For example the Belgian regulator published on June 20th a press release calling for a voluntary stop on &amp;ldquo;unnecessary complicated products&amp;rdquo;. They even have the wishdom to define what is unnecssary complicated. Any investment product that does not satisfy all of the four following conditions is considered to be &amp;ldquo;unnecessary complicated&amp;rdquo;. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The underlying value is sufficiently accessible &amp;mdash; This is stangily formulated it can mean that it is liquid, available for sale for everyone (but then &amp;hellip; why would you need an investment fund), or it could refer to the existance of a market price. In all of the three possibilities this seems absurd to me. In each of the possible interpretations I would argue that if such investment is usefull that then one exactly needs an investment fund to make it safely accessible for investorsl&lt;/li&gt;
&lt;li&gt;The investment stategy is not too complicated &amp;mdash; This is so vague that I cannot comment. But &amp;mdash;see further&amp;mdash; this does not withold the FSMA to list financial institutions that will not abide by these rules.&lt;/li&gt;
&lt;li&gt;The retun is not determined by more than three mechanisms. &amp;mdash; Again vagueness and unclarity reigns. Would an bond portfolio qualify for example? Well the return is determined by at least the following mechanisms: (1) the mechanism determining the price of each bond in function of the interest rate curve, (2) the mechanism that make the interest rate curve move in function of utterly complicated interactions in international financial markets, (3) the mechanism that the portfolio manager uses in order to select the bonds, (4) the mechanism links the return of the bonds to the creditworthiness of the emittent &amp;hellip; Well, the limit is exceeded: a bond portfolio is &amp;ldquo;unnecessary complicated&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;there is complete transparancy about all costs, credit risk and market value &amp;mdash; This seems on the first sight to make sense, isn&amp;rsquo;t it? But let&amp;rsquo;s have a look at a simple structured product that offers capital protection and increase in function of an index. This is done by buying a long call one the account of the fund. How much cost is in that long call? The fund cannot know this, actually even the counterparty who is selling the call cannot know the actual cost in advance. The seller has mathematical models that make many assumptions (and when reality will be different than the assumptions it will make more or less profit or evel loss) and it adds to that an error margin and a profit margin. These margins re of course unknown by the fund, and each option seller has other models, parameters and margins. It is clearly impossible to know &amp;ldquo;all costs&amp;rdquo;. Even a simple bond or equity fund can never predict the exact amount of transactions and hence the transaction costs, even the transaction costs per 
transaction cannot be predicted exactly. This statement is hence misleading, and an oversimplifiaction. As if someone really would believe that &amp;ldquo;all costs&amp;rdquo; can be known in advance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do you see any logic behind these regulations, are taxpayers and investors paying regulators &amp;hellip; to get discriminated and get worse investment products?
Would we not be better of to focus on what really matters? A coherent downside risk measure?&lt;/p&gt;

&lt;p&gt;Sure, an understanding of coherent risk measures among law makers and regulators would be a leap ahead, but honestly &amp;hellip; there is another story too. From marketing we know that in absence of a clear reason to connect to a brand customers are not that loyal and can be &amp;ldquo;manipulated&amp;rdquo; by price, peer pressure, &amp;hellip; and novelty. This search for novelty is out of control among producers of shampoo, toothpaste &amp;hellip; and investment product providers. This indeed resulted in pruducts that are &amp;ldquo;unnecessary&amp;rdquo; complex. We&amp;rsquo;re talking now about the products where an investor buys basically an OTC option that is highly tailor made for the intermediar. These products would indeed sport things like a bespoke selection of stocks, with special features such as some dropping out or entering depending on this going up or that going down, etc. etc. Indeed for me these products are complicated to understand &amp;hellip; even more so because typically sales people &amp;ndash;who have little experience with pricing of options&amp;ndash; do not really understand 
them. &lt;/p&gt;

&lt;p&gt;It is not the first time that a private banker contacts me with an exclusive product offer &amp;ldquo;full upside potential AND capital protection&amp;rdquo;. Investments should in the first place encourage people to save in long term. To get it right it has to be simple enough so that something sensible can be said about the evolution of the return distribution over time so that one can link it with his/her own portfolio and link it to personal goals (and typically one would expect a monotonous link with GDP).&lt;/p&gt;

&lt;p&gt;A set of 5 to 10 building blocks are largely sufficient to cater for all needs, fears, wishes and plans in each individual&amp;rsquo;s portfolio.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Target Oriented Investment Advice</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/03/19/Target-Oriented-Investment-Advice/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/03/19/Target-Oriented-Investment-Advice/</id>
            <updated>2011-03-19T20:36:00Z</updated>
            
            <summary type="html">This paper aims to present concrete recommendations to individual investors and in- vestment advisers about what portfolios should be held by private persons and how to construct these portfolios. Starting from the theoretical foundations that are based on the “Hierarchy of Human Needs” (as proposed by A.H. Maslow in 1943), this paper suggests to segregate portfolios into multiple sub-portfolios that each cater for a specific need. This postulation is then integrated with other key observations into a comprehensive, positive and normative portfolio theory. The result is a complete framework for personal financial decision making that is natural and helpful for both advisers and investors, while it integrates financial investments in an optimization of overall well being. </summary>
            <content type="html">&lt;p&gt;This paper aims to present concrete recommendations to individual investors and in- vestment advisers about what portfolios should be held by private persons and how to construct these portfolios. Starting from the theoretical foundations that are based on the “Hierarchy of Human Needs” (as proposed by A.H. Maslow in 1943), this paper suggests to segregate portfolios into multiple sub-portfolios that each cater for a specific need. This postulation is then integrated with other key observations into a comprehensive, positive and normative portfolio theory. The result is a complete framework for personal financial decision making that is natural and helpful for both advisers and investors, while it integrates financial investments in an optimization of overall well being. &lt;/p&gt;

&lt;div class=&#34;btn-group btn-group-sm&#34;&gt;&lt;div class=&#34;btn btn-default&#34;&gt;&lt;a href=&#34;/assets/papers/20110319_target_oriented_invesmtent_advice.pdf&#34; target=&#34;_blank&#34;&gt;Download Flyer&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
</content>
        </entry>
    
        <entry>
            <title>Polish Politics</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/03/06/Polish-Politics/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/03/06/Polish-Politics/</id>
            <updated>2011-03-06T10:19:00Z</updated>
            
            <summary type="html">I spent almost a decade in Poland, and live the last two years in Dublin, one of Europe&amp;rsquo;s financial centres. This allows me almost the viewpoint from an outsider on Poland. Poland is both a cherished example in Europe and an economy that worries its European partners.&lt;br/&gt;
Poland was the only European country that did not have recession, and the growth in 2010 is estimated at 3.5% and this year it should be higher (3.7%). Poland can expect to earn well from privatisations and money from the private pension system is diverted to reduce costs for the state, the football games of 2012 will fuel investments and lead to improved infrastructure. And as the icing on the cake, there are of course the European Subsidies. Also the political situation is perceived generally well. The leading party has still a majority of about 10% in all polls, indicating a stable situation around a government that is considered as responsible and not totally populist and reasonable. The improved relations with Germany and Russia were a welcome success for the government and it strengthens their reputation when they take the leadership of the European Presidency later this year.
</summary>
            <content type="html">&lt;p&gt;I spent almost a decade in Poland, and live the last two years in Dublin, one of Europe&amp;rsquo;s financial centres. This allows me almost the viewpoint from an outsider on Poland. Poland is both a cherished example in Europe and an economy that worries its European partners.&lt;br/&gt;
Poland was the only European country that did not have recession, and the growth in 2010 is estimated at 3.5% and this year it should be higher (3.7%). Poland can expect to earn well from privatisations and money from the private pension system is diverted to reduce costs for the state, the football games of 2012 will fuel investments and lead to improved infrastructure. And as the icing on the cake, there are of course the European Subsidies. Also the political situation is perceived generally well. The leading party has still a majority of about 10% in all polls, indicating a stable situation around a government that is considered as responsible and not totally populist and reasonable. The improved relations with Germany and Russia were a welcome success for the government and it strengthens their reputation when they take the leadership of the European Presidency later this year.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;But also beyond this success story there are many aspects that make this success a rather weak wrapping. The successes in international politics are overshadowed with the problems in Belarus for example. The government seems to be easily distracted in the populist game making big fuss about a public holiday or about semi-legal drugs. Such displays can be successful in the bidding for a certain group of voters but don&amp;rsquo;t make a good impression in international financiers that are lending money to us (and their appetite for buying the debt sets the interest rate and hence the cost for the country). Indeed where the Tusk government could hide after the veto fever of the previous president it doesn&amp;rsquo;t seem to be able to get the focus right there where it should be speeding up the needed reforms in public finances, administration and even the labour market.
&lt;/p&gt;

&lt;p&gt;For example, we all know that our police and farmers are not the big earners, but their privileges such as tax exemptions and early retirement draw attention. It&amp;rsquo;s just a matter of bad public marketing: increase the salaries for police and withdraw their privileges and we avoid the bad press. I know it&amp;rsquo;s unfair, but we are still an &amp;ldquo;ex communist country&amp;rdquo;, and such privileges are seen as &amp;ldquo;communist era privileges&amp;rdquo;. And that is not the label that you want when you want to lend money.
&lt;/p&gt;

&lt;p&gt;Some reforms such as the pension system where the money of working people is diverted to the state (the OFE of the private pension would only get 2.5% in stead of 7.3%) and the difference goes to the state. Sure, we know it goes actually to ZUS, but their the money will be consumed in stead of invested, and that will create disastrous consequences at the long run. This move makes the outlook on the long run rather grim. This is a move in the wrong direction, but personally I believe that on the short term it can be the worst of two evils.&lt;br/&gt;
Indeed the alternative was to present an even bigger public debt (also this is not advantageous for the tax payer), but more importantly Poland is struggling to keep the public debt below the 50% of GDP level. Above that level, Poland would have to face harsh austerity measures. But in international financial circles it tastes bitter to hear that the so necessary reform of the pension system is put a step back only a few weeks after Poland got an agreement to keep the cost of the pension reform out of the definition of public debt even till the end of the reform in 2060.
&lt;/p&gt;

&lt;p&gt;Besides, the deficit is now 7.9% and that is four times higher since Mr. Tusk took office. Sure, we know that that this can be attributed to the lack of reforms during the boom period under the previous government. Now that the global economy pulls us down, it is a lot more difficult. This is one of the many reasons why the pension reform on the long run should continue and why it is dangerous for taxpayers and pensioners to keep it in the balance of the state
&lt;/p&gt;

&lt;p&gt;Also the Polish infrastructure, mainly highways and and rail-roads don&amp;rsquo;t have the best reputations. Announcing delays has to be avoided. The energy production also needs serious plans to get rid of the polluting fossil fuel
&lt;/p&gt;

&lt;p&gt;Finally, it might be advisable to keep the elections away from the European Presidency, because that is a unique and important opportunity to show Poland to the rest of the world as modern nation that is on a right course to the future&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>No More Bailouts</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2011/03/01/No-More-Bailouts/" type="text/html" />
            <id>http://www.de-brouwer.com/2011/03/01/No-More-Bailouts/</id>
            <updated>2011-03-01T11:06:00Z</updated>
            
            <summary type="html">“The tax payer has been funding the banks more than enough! No more money for banks! Make the rich pay!” It’s en euphemism to state that similar points of view are the common denominator in the press that reports on the dramas since the Global Meltdown in 2008.&lt;br/&gt;
There are a few problems with these popular statements though. There is a misconception and there is a complicated truth about complex, interdependent economic dynamics.&lt;br/&gt;
</summary>
            <content type="html">&lt;p&gt;“The tax payer has been funding the banks more than enough! No more money for banks! Make the rich pay!” It’s en euphemism to state that similar points of view are the common denominator in the press that reports on the dramas since the Global Meltdown in 2008.&lt;br/&gt;
There are a few problems with these popular statements though. There is a misconception and there is a complicated truth about complex, interdependent economic dynamics.&lt;br/&gt;
&lt;/p&gt;

&lt;h1&gt;First, the simple misconception.&lt;/h1&gt;

&lt;p&gt;After a month of intensive reporting about the bailout in Ireland, I read in a newspaper “How could Lenihan [finance minister and official laughing stock of Ireland] take money from the Pension Reserve Fund? No money can be withdrawn now”. When reading the press reporting about the media about the “bailouts”, it is easy to understand where this misconception comes from. Media reported about the bailouts as if it was a donation (and continue to do so). In reality the bailouts are loans and/or share purchases.&lt;br/&gt;
Loans that have to be paid back or shares that can be sold later.&lt;br/&gt;
The Troubled Assets Relief Program (TARP - that was installed in the USA in October 2008 for example has for 2/3rd been paid back and on those assets paid back there is a 15% profit for the taxpayer (or almost 10% profit on the whole portfolio; while still about 100 billion has to be paid back). This is to date a profit of almost 30 billion USD for the USA taxpayer.&lt;br/&gt;
Of course the outstanding 100 bln is still at risk (if it will be paid back there is more profit, but the involved companies can still go bust and not pay back).&lt;br/&gt;
&lt;/p&gt;

&lt;h1&gt;Second, the complex economic dynamics.&lt;/h1&gt;

&lt;p&gt;This subject is so complicated that I hardly can blame the press to do an effort to explain this. True, it is more the subject for a PhD than a one-pager blog, but if one sticks to the basics it is not too complicated.&lt;br/&gt;
First we have to distinguish the bailouts for countries and those for specific companies (such as banks).&lt;br/&gt;
A bank operates to some extend similar to a hedge fund in that sense that it leverages many times its assets and by that leveraging it creates cash that is used by other industries. This is essential for economic growth. In the wake of 2008 we have seen that the major problem for everyone was to get loans (because the banks had problems). This has lead to economic depression (except for Poland that is) and made other markets tumble. We have to underline that in 2008 there was only one bank that went belly up, without the TARP it could have been much worse. The major problem of a bank going bankrupt is the domino effect that it creates: it will pull other banks down and all banks will have to be more restrictive and so they impede the economy.&lt;br/&gt;
The story for countries is also complex, but also here the alternative to a bailout is bankruptcy. When a country defaults on its debt it can as a sovereign choose how to get out of the situation. The biggest problem is to gain confidence of the investors in order to be able to emit new bonds. So the state will typically devaluate its currency and then pay back a part of the value of the bonds in that devaluated currency (for example pay only the face value and no interest). The years to follow the state will pay very high interest rates because of the weakened confidence, the interest rates in the country will be high (impeding the economic growth), inflation will be high, etc.&lt;br/&gt;
The main problem is that after a default a state will not have easy access to funding. It will have to cut on many expenses, probably more so than in a bailout scenario! So people that are protesting against the bailouts should realize that the alternatives are not necessarily better. Indeed the cost cuttings that accompany a bailout (because remember, it’s no charity it’s a loan that has to be paid back – so the ones that provide the money (not “give”) want the country to improve its finances in order to be able to pay back the investors)&lt;br/&gt;
&lt;/p&gt;

&lt;p&gt;By allowing one country to default on its debt, Europe creates a precedent and as that will trigger a loss of confidence in Europe, the cost of funding will dramatically increase for every taxpayer in Europe.&lt;br/&gt;
&lt;/p&gt;

&lt;p&gt;&lt;p&gt;All that is true, but it does not exclude that a bailout is socially a  reasonable solution. The alternatives are also harsh for all layers of the society.&lt;br/&gt;
The only good solution for the future is to avoid such situations. This is not something that a invisible hand can do: real regulation of the banking system (that goes beyond demagogic rhetoric) is a first step. Guidelines of tax structuring, leveraging, balance, debt ratios, debt structuring, debt currency, with real risk parameters such as CVaR to be used (not flawed –but popular&amp;ndash; measures such as volatility or VaR!&lt;br/&gt;&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Lessons from 2009 for Poland</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2010/12/30/Lessons-From-2009-for-Poland/" type="text/html" />
            <id>http://www.de-brouwer.com/2010/12/30/Lessons-From-2009-for-Poland/</id>
            <updated>2010-12-30T20:02:00Z</updated>
            
            <summary type="html">Poland was the ONLY country in the EU to avoid recession in 2009. In 2010 we expect again the record level in Europe (around 2% GDP growth). How was such an economic top performance possible?</summary>
            <content type="html">&lt;p&gt;Poland was the ONLY country in the EU to avoid recession in 2009. In 2010 we expect again the record level in Europe (around 2% GDP growth). How was such an economic top performance possible?&lt;/p&gt;

&lt;p&gt;Probably the most important aspect was that Poland had a relative low debt ratio (about 50% of GDP) and that this debt was mainly in the home currency. With hindsight one might say that the lack of economic stimulating initiatives and the resulting slow growth and low debt under the reign of the Kaczynski-brothers wasn&amp;rsquo;t the worst option.&lt;/p&gt;

&lt;p&gt;The truth is more complex. In fact the country was well prepared in the nineties by people such as Leszek Balcerowicz (by building up important foreign reserves, removing price controls, eliminating many subsidies, imposing a strict monetary and budgetary regime, etc.). The economic expansion of 2003-08 gave PIS an easy ride and the fact that this growth was not used to create a healthier budget balance is a unique lost opportunity. Improving that balance becomes now in the economic downturn very important and it is of course much harder to do it now. Many more issues were not addressed by the PIS rulers.&lt;/p&gt;

&lt;p&gt;The credit line of the IMF that was allocated in May 2009 (20.6Bln USD) did not only provide added creditworthiness but it was also seen as a confirmation of the IMF&amp;rsquo;s belief in the countries ability to address the crisis and respond appropriately.&lt;/p&gt;

&lt;p&gt;Other important factors were the relatively strong internal market, the low level of debt of individuals (that avoided a real estate crash for example), the responsiveness of the the zloty (sharp depreciation, but then again a steady climb indicates that the possibility for the PLN to float did not have much real value but psychologically it helped), the external imbalance was modest to ok, the dynamic job market allowed salaries to react, and of course the enormous EU cohesion funds.&lt;/p&gt;

&lt;p&gt;Poland became the largest recipient in absolute numbers: about 3.3% of the GDP for the years to come. We must use these funds to create structural economic independence for the country, create a climate of competence and competitiveness, and attract more structural Foreign Direct Investments (FDIs). To achieve that, there are a few areas in which we will have to improve.&lt;/p&gt;

&lt;p&gt;Corporate taxes are too high in order to compete with the Czech Republic, Bulgaria or Ireland. Although just decreasing taxes is not a good idea, because this becomes pro-cyclical. This means that lower taxes will lower the income of the government in an economic downturn, exactly when it needs as stable base. This means that the government should seek to shift income base from companies to private persons (why keep the special advantages for farmers?), real estate, certain forms of ownership, alcohol and cigarettes, natural resources, emissions, etc. To keep the internal market strong, a low VAT policy would be beneficial. Trustworthiness. A government should strive to continuity in economical and fiscal policies. An investor does not choose Poland because one government lowers taxes. Only when he believes that for the decades to come this policy will be sustained he will consider Poland. Simplify and modernize laws. Why would each district be allowed to have a different interpretation of the utterly 
complicated tax laws? What a waste of resources in both public and private sector, what a wrong focus for the investor! Would it not make sense to strive for transparent legislation where no interpretation is possible. Improve our infrastructure such as roads (and maybe consider something stronger than asphalt), fast trains and especially environmental friendly and efficient public transport such as trams. Introduce the Euro fast. Insecurity about the exchange rate is a big damper on FDIs.&lt;/p&gt;

&lt;p&gt;In short, we should now start to prepare for the day that the money flow to Poland will stop! We should remain modest and don&amp;rsquo;t spend more than that we have (i.e. keep the government debt low). And of course keep the associated risks low, so have it in PLN or have it hedged to PLN).&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>The Seven Myths of Investing</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2010/12/01/The-Seven-Myths-of-Investing/" type="text/html" />
            <id>http://www.de-brouwer.com/2010/12/01/The-Seven-Myths-of-Investing/</id>
            <updated>2010-12-01T21:14:00Z</updated>
            
            <summary type="html">In our economic system it is essential to take responsibility for your own financial well being. Where under certain protective economic systems the state will care for the individual to a large extend, these systems tend to come with loads of disadvantages. We&amp;rsquo;re all happy to live in a free world &amp;hellip; but this freedom also includes the freedom to die poor.</summary>
            <content type="html">&lt;p&gt;In our economic system it is essential to take responsibility for your own financial well being. Where under certain protective economic systems the state will care for the individual to a large extend, these systems tend to come with loads of disadvantages. We&amp;rsquo;re all happy to live in a free world &amp;hellip; but this freedom also includes the freedom to die poor.&lt;/p&gt;

&lt;p&gt;The answer is to use investments. After 2008 we all know that this is not so easy, many people are still recovering form serious losses and feel uncomfortable to any risk. Only the safest thing such as the savings account or term deposit can be considered. But by doing so unintentionally one risks to earn less interest than the inflation &amp;hellip; and therefore erode one&amp;rsquo;s capital.&lt;/p&gt;

&lt;p&gt;While this might be a good prospect compared to incurring huge losses on the stock exchange this strategy is bound to be suboptimal if your time horizon is longer than a few years. The only answer for a happy and sorrow-free retirement is investing.&lt;/p&gt;

&lt;p&gt;Investing is for the novice and experienced person full of myths and mysteries. We&amp;rsquo;ll look at some of those myths now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I need to be fast, the slow are lunch for the fast. That&amp;rsquo;s what online broker platforms would like you to believe, but nothing is less true. Research (e.g. Terrance Odean and others) persistently finds the opposite: trading more erodes your investments (even without taking the trading costs into account). There is something with high frequency trading, but then we&amp;rsquo;re talking about sub-millisecond trading. Lesson: think about the investment goal and select an investment profile that suits the investment horizon and only look at your portfolio every year or so.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;My banker knows! How many times did you raise the questions “What should I invest in now?” That&amp;rsquo;s not an investor&amp;rsquo;s question it&amp;rsquo;s a gambler&amp;rsquo;s question. And what are the odds that your advisor would keep his old job if he would really be able to tell? Lesson: Ask the right questions! An investor starts from a goal and investment horizon, then selects a strategic portfolio composition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Investing is only for the smart. Financial press would love you to believe that, but see point 1: generally people that believe themselves to be smart are overconfident and trade too much and hence have poor performance. You need a basic knowledge about investments and their risks, but don&amp;rsquo;t need to read every day the financial newspaper. Lesson: don&amp;rsquo;t get lost in short term news overload, but focus on the long term goals and fundamental risks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I&amp;rsquo;m too unique, I need a special (expensive) structured thing. We&amp;rsquo;re indeed quite unique in many aspects. But investing should be the answer for a real need, and those needs tend to be less unique as you would believe. Harry Maslow groups all human needs in a handful of layers. Investments are a tool to cater for those needs. Lesson: you need a few portfolios with each a clear goal (retirement, schooling children, and special projects).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I need a lot of money to start investing. While it is true that the best way to collect a small capital on the stock exchange is to start with a large one, there do exist efficient structures that allow one to invest for very small amounts. Investment funds, Exchange Trades Funds, and some index notes will provide a well diversified portfolio for amounts starting as small as a 100 Zl. Lesson: use simple structures and make sure you get the diversification that you need. Consider a systematic savings program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I&amp;rsquo;m too young to think about my retirement, I still have time left. Consider this: when you save every month from your 20th till your 60th year of life 100 Zl a month and assuming an interest rate of 5% per year this will yield 148&amp;#39;956Zl at retirement. If you only start at your 40th, you will not have to invest 100, but 392 Zl per month in order to get the same result. Lesson: the early bird gets the worm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I need specialized press. Not any more! I plan to bring more concrete advice, look for the the next Blogs in this section! &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
</content>
        </entry>
    
        <entry>
            <title>High Frequency Trading</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2010/10/23/High-Frequency-Trading/" type="text/html" />
            <id>http://www.de-brouwer.com/2010/10/23/High-Frequency-Trading/</id>
            <updated>2010-10-23T20:35:00Z</updated>
            
            <summary type="html">In the wake of their public face off in 2008 where during 6 hours and 45 minutes they were unable to consolidate any trades, the London Stock Exchange (LSE) announced that will upgrade it&amp;rsquo;s .NET TradeElect (Windows based) systems to the (MilleniumIT Linux) based platform. Following hereby the New York Sock Exchange that made this move in 2007.</summary>
            <content type="html">&lt;p&gt;In the wake of their public face off in 2008 where during 6 hours and 45 minutes they were unable to consolidate any trades, the London Stock Exchange (LSE) announced that will upgrade it&amp;rsquo;s .NET TradeElect (Windows based) systems to the (MilleniumIT Linux) based platform. Following hereby the New York Sock Exchange that made this move in 2007.&lt;/p&gt;

&lt;p&gt;By doing so the LSE, one of the few world-top stock exchanges, hopes to reduce their transaction speed to 0.4 milliseconds. This is more than 6 times better than the (in fact rarely observed) speed of 2.7 millisecond in their Windows based solution.&lt;/p&gt; 

&lt;p&gt;This should not surprise us: Linux gained a market share of 91% in the top-500 supercomputers (up from about 0% in 1998), it powers the top 15 without exception. It is just part of the success story of Free and Open Source Software (FOSS), where propriety systems lost the battle long ago in embeded systems, mobile devices (although the Redmond based company fights back with an OS and &amp;hellip; of course legal claims)&lt;/p&gt;

&lt;p&gt;I might not just have been speed that drove LSE to Linux, Linux is also a lot cheaper than Windows on such systems. Probably the most important argument is that now LSE is in the driving seat and that it is not held hostage by a network of monopolies.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href=&#34;http://www.ibsintelligence.com/index.php?option=com_content&amp;view=article&amp;id=13438:lse-buys-millenniumit&amp;catid=2:news&amp;Itemid=12&#34;&gt;IBS Journal&lt;/a&gt;  David Lester, Chief Information and Technology Officer at LSE, said that compared to the annual cost of $65 million for TradElect, MillenniumIT was a bargain at a purchase price of $30 million. Sure that is not the whole picture, but thehe LSE predicts that using Linux will give them an annual cost saving of at least £10 million (EUR 11.2 million). He adds: &amp;ldquo;The new technology is a lot lighter, nimbler and easier to install&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;But is that the whole story?&lt;/p&gt;

&lt;p&gt;On the other hand we have fore example the May 6 Flash-Crash, this aberration in stock behaviour has cost some investors many millions, whereas for others it might have been the best day of the year. As a matter of fact, in my time zone it was about 8:30 pm and I was where I should be at such moments in front of my Bloomberg terminal ready to pull the trigger and make or loose a many many millions. Fortunately my blood was chilled enough and helped by the approach of my employer I avoided slipping our short (hedging) traders in the black hole created for a few seconds.&lt;/p&gt;

&lt;p&gt;Even with hindsight one can only see that the markets on May 6&lt;sup&gt;th&lt;/sup&gt; 2010 were very nervous about the possibility of Greece defaulting on its outstanding 210 billion euro debt, and over hours after closure in Europe markets declined a few percent, but then suddenly the debt dived 600 points in a matter of minutes. The stock exchanges followed that dive-boom scenario, with of course the U.S. Stock exchange being open the most visibly impacted. The dive erased about $862 billion from U.S. Equities alone! It was the largest intraday drop ever.&lt;/p&gt;

&lt;p&gt;Regulators in the U.S. anounced weeks later that they wer investigating 6 possible areas, but it seems that HFTs have during the build up of the crash put thousands of trades per second in the stock exchange, only to cancel them within milliseconds.&lt;/p&gt;

&lt;p&gt;Hedge Funds and day trading are indeed so passe, it&amp;rsquo;s high frequency traders that are the new rebels of Wall Street. High Frequency traders are not interested in the fundamental value of a stock, but use mathematical algorithms to profit from other players&amp;rsquo;s actions. Some of them employ hundreds PhDs and use computers to generate thousands of trades per second, these trades are based on the trends of the last milliseconds and have a millisecond delay and are more often cancelled after a few microseconds than they are really executed.&lt;/p&gt;

&lt;p&gt;There are basically two (known to me) ways of operating for high frequency traders. A first model is operating as market maker, such companies have permanently buy and sell trades in the market and take no directional bet. Another model is looking for local and temporally mis-pricings in stocks or &amp;hellip; even inefficiencies in the systems of the stock exchange or between the different exchanges. But in all cases the High Frequency Trader is only interested in making a quick kill and moving on.&lt;/p&gt;

&lt;p&gt;A simple expample would be a pairs-trade, where for example bad news pushes a whole sector down. HFTs will capture the first movers and then take positions of on the others in order to profit from those comming down also. Or a step further one could try to forecast a certain companies short term moves by monitoring a sector index, it&amp;rsquo;s raw materials, interest rates, etc. A second example is simply monitoring the bid and ask spreads and acting then they come too high and profit from conversion. But, do not try this at home! The active HFTs do not simply employ computers to look for patterns, basically they are doing what Keynes in in beauty contest parable stiplated. They employ computers to look for other computers that look for patterns.&lt;/p&gt;

&lt;p&gt;Some researchers have found many cases of thousands of trades that were put into the stock exchange but were cancelled within milliseconds. This raises the suspicion of intentionally influencing the stock exchange&amp;rsquo;s systems. This is referred to as &amp;ldquo;quote stuffing&amp;quote; and is obviously on the limit of what is legally possible. Or is it just past that fine line? In any case regulators are investigating and considering what to do? &lt;/p&gt;

&lt;p&gt;A simple model would be to watch for such large orders (eventually on an aggregated base) and when spotted take the same direction very fast and before the order is fully through the market reverse your position completely and therefore buying low and selling high in the case of one large buy order. But the true algorithms are known by only a handful company owners and CIOs (chief investment officers, not chief information officers!), most people will only know their part of the patchwork that is the web spun by their company around the stock exchanges.&lt;/p&gt; 

&lt;p&gt;If the asset managers who build up for you a retirement capital are the farmers raising livestock for you, then the High Frequency Traders are the hunters that lay in ambush to kill one of those cows when it comes too close to their trap (or at least take today&amp;rsquo;s milk).&lt;/p&gt;

&lt;p&gt;But we should ask ourselves is that the stock exchange that we want for our children? Is that the stock exchange that will play its role as a catalyst for the economy and provide oxygen to growing companies that produce and create welfare?&lt;/p&gt;

&lt;p&gt;Clearly there is an issue here and the U.S. Securities and Exchanges Commission (SEC) is considering if and what action to take. They consider for example imposing a minimum period of time that trades have to remain active (probably something in the order of 20 to 100 milliseconds). The SEC is further considering to monitor more closely firm that trade more than 2 million trades a day, and to force HFTs to stay in the markets when the going gets rough.&lt;/p&gt;

&lt;p&gt;Institutional investors are already spotted the problems and try to put up an armour against what must feel like parasites. One technique is breaking up large orders in small pieces so that you show to the HFTs only the top of the iceberg. But as long as the regulator do not interfere it&amp;rsquo;s the same exhausing battle as between anti-virus software maintainers and Botnet Masters.&lt;/p&gt;

&lt;p&gt;Institutional players such as investment funds cannot longer simply use block trades and they have to use the same techniques as the HFTs in order to defend themselves. Also hedge funds that work to find patterns and trade on them have to watch for HFTs to jump before them when taking action (triggered by themselves showing their intentions), and probably shorten their holding periods as market anomalies that a few years ago would have lasted for days now will disapear in minutes.&lt;/p&gt;

&lt;p&gt;But as long as there are no regulations about the minimal lifetime of quotes or simply minimal processing windows (for example the exchange will only process and match trades every 100 milliseconds) then the stock exchanges, being private companies, will continue to compete with each other in price and speed &amp;quote; paving the way for their own problems. Just as banks did in the run up to the Global Meltdown in the lack of serious regulation! This is one of those examples where the regulators can and should play an important role and where they can do more than window dressing and finger pointing.&lt;/p&gt;

&lt;p&gt;Regulators have to rethink their strategy of the last decade where since the introduction of the ECNs in 1998 and the decimalisation in 2000, and the best-and-fastest execution rule in 2007 (all USA) they have been striving in making markets more efficient on a micro level.&lt;/p&gt;

&lt;p&gt;And You? Do you still believe that you need on-line information and daily newspapers to manage your broker account?&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>How Safe Is Government Debt?</title>
            <link rel="alternate" href="http://www.de-brouwer.com/2010/10/04/How-Safe-is-Goverment-Debt/" type="text/html" />
            <id>http://www.de-brouwer.com/2010/10/04/How-Safe-is-Goverment-Debt/</id>
            <updated>2010-10-04T21:08:00Z</updated>
            
            <summary type="html">Looking for safe investments? Government bonds!</summary>
            <content type="html">&lt;p&gt;Looking for safe investments? Government bonds!&lt;/p&gt;

&lt;p&gt;But is that really so? And if not, what tools do we have to assess and compare the risks? Is there an issue with Greece, Ireland, Italy, Portugal and Spain (the “GIIPS countries”)?&lt;/p&gt;

&lt;p&gt;First of all there are the rating agencies. They assign classifications represented by letters to all debtors. For example Standard and Poor&amp;rsquo;s uses letters A, B, C and D. AAA is the best, then AA+, AA, AA-, BBB+ etc. all the way down to D for companies that have defaulted. Anything from and above BBB- is called “Investment grade” and anything below BB+ is a “Junk bond”. Each rating agency uses different symbols and has its own methodology. There are two ratings per debtor: one on short term and one on long term. The rules to assign the letters are different for countries and companies and even depend on the sector in which the company is active. The rating gives a good indication of the probability of default.&lt;/p&gt;

&lt;p&gt;Looking at the ratings we see that Greece is in troubles, but that most probably the rest of the GIIPS countries will be fine. So no reason to panic it seems.&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;Entity&lt;/td&gt;
&lt;td&gt;Standard &amp; Poors&lt;/td&gt;
&lt;td&gt;Spread (in %)&lt;/td&gt;
&lt;td&gt;CDS (in %)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Greece &lt;/td&gt;
&lt;td&gt;BB+&lt;/td&gt;
&lt;td&gt;7.93 &lt;/td&gt;
&lt;td&gt;6.84 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ireland &lt;/td&gt;
&lt;td&gt;AA-&lt;/td&gt;
&lt;td&gt;3.30 &lt;/td&gt;
&lt;td&gt;4.21 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Italy &lt;/td&gt;
&lt;td&gt;A+&lt;/td&gt;
&lt;td&gt;1.06 &lt;/td&gt;
&lt;td&gt;1.73 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Portugal&lt;/td&gt;
&lt;td&gt;A-&lt;/td&gt;
&lt;td&gt;2.74 &lt;/td&gt;
&lt;td&gt;3.46 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Spain &lt;/td&gt;
&lt;td&gt;AA&lt;/td&gt;
&lt;td&gt;1.30 &lt;/td&gt;
&lt;td&gt;2.05 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Poland &lt;/td&gt;
&lt;td&gt;A-&lt;/td&gt;
&lt;td&gt;3.56 &lt;/td&gt;
&lt;td&gt;1.19 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Germany &lt;/td&gt;
&lt;td&gt;AAA&lt;/td&gt;
&lt;td&gt;0.00 &lt;/td&gt;
&lt;td&gt;0.32 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;USA &lt;/td&gt;
&lt;td&gt;AAA&lt;/td&gt;
&lt;td&gt;-0.53 &lt;/td&gt;
&lt;td&gt;0.38 &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;Indonesia &lt;/td&gt;
&lt;td&gt;BB+&lt;/td&gt;
&lt;td&gt;4.76 &lt;/td&gt;
&lt;td&gt;1.29 &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Another way to judge the risk of a certain country is to study the “Spread”, the difference in interest rate that the debtor has to pay compared to a chosen reference. For European countries one generally compares to Germany, one of the world&amp;rsquo;s most creditworthy countries and a dominant debtor in Europe. The spread is hence a measure for the risk premium that investors demand in order to buy certain bonds.&lt;/p&gt;

&lt;p&gt;Therefore the spread reflects the common opinion of all investors; it is a consequence of the trading going on between all players. Where rating agencies very seldom adapt their views, the spread changes intraday just as interest rates or stock prices.&lt;/p&gt;

&lt;p&gt;In order to asses the risk of a bond it makes more sense to study the spread than the interest rate itself in order to eliminate the overall interest climate.&lt;/p&gt;

&lt;p&gt;The spreads in the table already give us more reason to worry. Greece has a higher spread than Indonesia that defaulted a few years ago. Further we see that actually Ireland is assessed to be more risky than Italy and Portugal, whereas the Ratings gave us the opposite image. This can still be consistent, because a buyer of a bond will not only be interested in the probability of default, he will also be interested in how much he still can recuperate in case of default.&lt;/p&gt;

&lt;p&gt;Also a Credit Default Swap (CDS) is an ideal instrument to assess the credit risk of a certain bond. If you have a bond, you can cover its default risk by buying a CDS, the seller will then pay you the face value of the bond in case it defaults (and you give him the paper, so he can recuperate whatever is left). The joint probability of default and amount to recuperate is most explicitly present. But there is another aspect that plays a key role.&lt;/p&gt;

&lt;p&gt;You have your bond and CDS, but you still have a credit risk on the seller of the CDS. So, this operation only makes sense if the creditworthiness of the seller is better than that of your bond. In other words, the market of CDS providers is small. And those who do will have a portfolio of contracts. Hence a third element of the risk of the bond comes to the foreground: the systemic risk: when it goes wrong, how strong are the bonds correlated?&lt;/p&gt;

&lt;p&gt;The CDS values in the table learn us that there is more matter of concern for Greece, Ireland, Portugal, and Spain than there is for Indonesia for example. And that is a reason to take precautions!&lt;/p&gt;

&lt;p&gt;Indeed things can go wrong: companies can default, even Lehman Brothers or Enron were not immune. Also governments can stop paying or pay only part. Take for example Argentina. After the two wars the country could not gain the confidence of investors and it ended up paying high interest rates and had hyperinflation. The situation exploded in December 2001: the country had its currency devaluated and paid back partly in the devaluated currency.&lt;/p&gt;

&lt;p&gt;None of the Euro countries has the option to devaluate its currency, so the income from taxes minus current expenses determine the limits.&lt;/p&gt;

&lt;p&gt;That reflection allows us to look via a different frame at the same reality. Greece has a debt of 116% of its GDP, but we must not forget that this is only 118% of its annual revenue (total income from tax). If we compare that to the USA who has 53% debt-to-GDP but a stunning 358% debt-to-revenue ratio, we must conclude that all is still relatively under control.&lt;/p&gt;

&lt;p&gt;Buying GIIPS debt is like jumping into a driving train: hopefully it works out, but when it goes wrong then it really hurts. The first default will trigger panic among inventors and the IIPS countries will see their cost of funding soar. One domino will make the others tumble. In other words let’s hope for the best, but when it goes wrong it won’t be easy to hide.&lt;/p&gt;

&lt;p&gt;NOTE: Another interesting observation while comparing CDS and spread is that the EU countries have an interest rate advantage compared to Poland for example, but more about this in another paper about the advantages of the Euro.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Investment Risk and Risk Classes</title>
            <link rel="alternate" href="http://www.de-brouwer.com/1998/10/01/Investment-Risk-and-Risk-Classes/" type="text/html" />
            <id>http://www.de-brouwer.com/1998/10/01/Investment-Risk-and-Risk-Classes/</id>
            <updated>1998-10-01T20:26:00Z</updated>
            
            <summary type="html">This paper aims to present a risk classification that can be used for all investment funds and that is close to what the investor perceives as &amp;ldquo;risk&amp;rdquo;. The method further tries to use as few arbitrary parameters as possible and the assumptions are limit to the maximal extend.
We present one graphical method that could be used in a discussion with the investor, and a risk classification that is so simple that it can be used on written communication. Ideally the risk class should be printed on each fund information sheet, so that investors can compare all investments over all different distributors.&lt;br/&gt;
&lt;i&gt;1998-10-01&lt;/i&gt;</summary>
            <content type="html">&lt;p&gt;This paper aims to present a risk classification that can be used for all investment funds and that is close to what the investor perceives as &amp;ldquo;risk&amp;rdquo;. The method further tries to use as few arbitrary parameters as possible and the assumptions are limit to the maximal extend.
We present one graphical method that could be used in a discussion with the investor, and a risk classification that is so simple that it can be used on written communication. Ideally the risk class should be printed on each fund information sheet, so that investors can compare all investments over all different distributors.&lt;br/&gt;
&lt;i&gt;1998-10-01&lt;/i&gt;&lt;/p&gt;

&lt;div class=&#34;alert alert-error&#34;&gt;
NOTE: this is an old paper, though this paper is still interesting reading, please take the following into account:

- Recent research points rather in the direction that a risk scale at the level of the investment itself might not make much sense. An investment is risky or not depending on the details of the investment goal!

- That paper misses an extremely important link to other papers from that time and more concretely to the paper &amp;ldquo;Thinking Coherently&amp;rdquo; (Artzner, Delbaen, Eber and Heath &amp;mdash; 1997). This paper erroneously selects Value at Risk (VaR) as a risk measure. VaR is not a coherent risk measure and should not be used (certainly not at the level of individual investments).
&lt;/div&gt;

&lt;div class=&#34;btn-group btn-group-sm&#34;&gt;&lt;div class=&#34;btn btn-default&#34;&gt;&lt;a href=&#34;/assets/papers/19981001_riskclass.pdf&#34; target=&#34;_blank&#34;&gt;Donwload the paper in PDF format&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
</content>
        </entry>
    
</feed>