Thursday, May 5, 2022

Global Aging & Africa's Divergence

I recently completed an analysis focused on population aging, population age categories in % (age pyramids), and overall population growth.  It looks at various geographic units (countries, continents, regions, World) from 1950 to the Present (2019 & 2020).  And, it looks at projections out to 2100.  

 

I used data sourced from the UN Population Division.   

 

The main takeaway is that Africa is an outlier to the overall global aging; its population growth (historical & projected) is far faster than for other major regions. 

 

You can read the complete study at the following link: 

Global Aging at Slideshare 

 

... or a slightly shorter version at the following link:

Global Aging at Slidesfinder 

 

The above study consists of a Powerpoint with close to 60 slides.  It is very visual, and easy to digest.  But, as an intro to the whole thing, I will share a few highlights below by illustrating some of the key slides.  


First, let's disclose the three types of age pyramids.  Age pyramids are an aesthetic way of visualizing the population age profile of a country.  

 

A young population has a sharp looking pyramid with a large foundation (large youth base associated with high fertility) and a very sharp top (few elderly, short life expectancy). 

We can articulate an explanatory model that describes the process of global aging.  As women get more educated, they participate in the labor force.  And, fertility drops, life expectancy increases, population growth slows down, and population ages.

Within the full presentation, I share a ton of visual data that supports many of the variables' relationships defined in the model. 

This model explains how a population pyramid evolves from looking like a pyramid (young) to a urn (old), as shown below. 

 

The graph below compares the age pyramid of Nigeria, Brazil, and Japan in 1950 and in 2019. 

 

Back in 1950, the three countries' respective age pyramids looked nearly identical.  But, in 2019 they look radically different.  Nigeria's age pyramid has not changed since 1950.  It is still depicting a very young population.  Meanwhile, in 2019 Brazil's population pyramid looks very mature; and, Japan's looks very old. 

 

The population of Nigeria has grown from 37.9 million in 1950 to 206.1 million in 2020; and is projected to reach 793.9 million by 2100!



This historical and projected explosive population growth is true not only for Nigeria but for the whole of Africa.  Africa's population has grown from 0.23 billion in 1950 to 1.34 billion in 2020; and is projected to reach 4.47 billion in 2100!

 

Africa's continued explosive population growth is truly divergent when compared with any other large region. 

 

By comparison, see how Europe's population has already peaked by 2020, and is projected to decline out to 2100.  This is a picture of ongoing population aging.   



Population aging is even more pronounced for China.  Its population is expected to peak before 2040, and decline rapidly out to 2100. 

 

The table below discloses the population growth (historical and projected) for Africa and a few other major regions with population of more than 1 billion in 2020.

 

 

Notice how all four regions have a fairly similar population size in 2020.  However, by 2100 Africa's population is projected to be 3 to 4 times larger than the other regions!

 

And, this is how these regions share of the World population will change over the reviewed time periods. 

 

Next, let's compare Africa vs. the remainder of the World, excluding Africa.  

 

The World's population is projected to increase from 7.79 billion in 2020 to 10.88 billion in 2100.  And, the entire growth in the World's population is due to Africa.  The remainder of the World's population is projected to remain perfectly flat at around 6.4 billion.

 

Friday, April 15, 2022

Cryptocurrencies as an asset class

We are going to analyze several of the major cryptocurrencies as an asset class.  And, we are going to address several related questions:

 

1) Do they provide diversification benefits relative to the stock market (S&P 500)?
 
2) How do their diversification benefits compare with Gold’s diversification benefit vs. the stock market? 
 
3) Do cryptocurrencies provide diversification benefits when you really need it… during market downturns?

 4) Are cryptocurrencies truly “digital Gold”?  Do they behave in a similar way given that their supply is constrained (supposedly in a similar way as Gold is)?

You can review the complete analysis at the following links:  

Crypto analysis at Slideshare

Crypto analysis at SlidesFinder 

Publicly available data on cryptocurrencies is fairly limited in terms of length of time series.  Also, many cryptocurrencies started in just the past few years.  Given that, I am focusing the first part of this analysis on monthly data from September 2015 to March 2022.  I also conducted fairly extensive analysis using daily data that you can review within the links disclosed above. 

When looking at correlations over the reviewed period as shown on the table below, we observe that both cryptocurrencies and gold have very low correlations with the stock market (S&P 500). 


 Thus, one could derive that cryptocurrencies do provide diversification benefit from equity market risk.  

However, during the one market correction (within this period), we observe that cryptocurrencies did not provide any diversification benefits.  While the S&P 500 contracted by close to - 30% between February 19 and March 16, 2020, the cryptocurrencies' respective values often contracted by more than - 50%. 

As shown earlier, cryptocurrencies have very low correlations with gold.  Thus, they can't be considered "digital gold", as they behave completely differently. 

The critical differentiating characteristic of cryptocurrencies is their volatility.  Their volatility is a high multiple higher than the stock market (S&P 500).  The graph below is focused on the volatility level-dimension that is specified as the annualized standard deviation using monthly % change.  And, the Y-axis as disclosed, when it shows a standard deviation of 7.5 ... it actually means a standard deviation of 750% (as a reference the S&P 500 annualized standard deviation over that period averaged about 14%).  Within the complete analysis, you can see details of the underlying calculations.     


As shown above, both XRP and Dodge experienced the highest volatility with both peaks for several months at or above 750%.  

When we focus our graph on the time dimension (see below), we observe that XRP experienced its peak volatility in 2018.  Meanwhile, Dodge experienced it 3 years later in 2021. 

Next, let's look at the cryptocurrencies volatility (as defined) as a multiple of the S&P 500 volatility.  As shown on the graph below, these multiples range from single digit multiple up to > 200 x.  That's pretty amazing.  It is actually hard to comprehend unless you look at the underlying data firsthand. 

As we speak, the cryptocurrencies are experiencing a severe correction (far worse than any stock market correction).  While the S&P 500 has corrected by about - 6% during this recent Winter, the cryptocurrencies have dropped between - 30% and - 80% since their most recent peak (some cryptocurrencies have been on a volatile slide since May of 2021).  This is a second instance when cryptocurrencies have provided no diversification from equity risk.


In view of the above, cryptocurrencies may be considered an asset class given that their behavior is very much different from other asset classes (at least the ones reviewed including equities and gold; and they certainly behave completely differently than bonds.  You don't need a study to assess that). 

However, as mentioned they do not provide so far any diversification benefit to protect against equities markets downturns.  And, their huge volatility renders them inappropriate for any conservative and/or long-term investor.
 

 

Monday, March 21, 2022

Can you Deep Learn the Stock Market?

You can read the complete study at the following links:  

 

DNN Stock Market Study at SlidesFinder 

DNN Stock Market Study at Slideshare 

 

 

Objectives:

We will test whether: 

 

a) Sequential Deep Neural Networks (DNNs) can predict the stock market better than OLS regression;

b) DNNs using smooth Rectified Linear Unit activation functions perform better than the ones using Sigmoid (Logit) activation functions. 
 

Data:

Quarterly data from 1959 Q2 to 2021 Q3.  All variables are fully detrended as quarterly % change or first differenced in % (for interest rate variables).  Models are using standardized variables.  Predictions are converted back into quarterly % change.  

 

Data sources are from FREDS for the economic variables, and the Federal Reserve H.15 for interest rates.

 

Software used for DNNs.

R neuralnet package.  Inserted a customized function to use a smooth ReLu (SoftPlus) activation function.   

 

The variables within the underlying OLS Regression models are shown within the table below: 

 


Consumer Sentiment is by far the most predominant variable.  This is supported by the behavioral finance (Richard Thaler) literature.  

 

Housing Start is supported by the research of Edward E. Leamer advancing that the housing sector is a leading indicator of overall economic activity, which in turn impacts the stock market. 

 

Next, the Yield Curve (5 Year Treasury minus FF), and economic activity (RGDP growth) are well established exogenous variables that influence the stock market.  Both are not quite statistically significant.  And, their influence is much smaller than for the first two variables.  Nevertheless, they add explanatory logic to our OLS regression fitting the S&P 500. 

 

The above were the best variables we could select out of a wide pool of variables including numerous other macroeconomic variables (CPI, PPI, Unemployment rate, etc.) interest rates, interest rate spreads, fiscal policy, and monetary policy (including QE) variables. 

 

Next, let's quickly discuss activation functions of hidden layers within sequential Deep Neural Networks (DNN) model.  Until 2017 or so, the preferred activation function was essentially a Logit regression called Sigmoid function.

 


There is nothing wrong with the Sigmoid function per se.  The problem occurs when you take the first derivative of this function.  And, it compresses the range of values by 50% (from 0 to 1, to 0 to 0.5 for the first iteration).  In iterative DNN models, the output of one hidden layer becomes the input for the sequential layer.  And, this 50% compression from one layer to the next can generate values that converge close to zero.  This problem is called the “vanishing gradient descent.”  

 

Over the past few years, the Rectified Linear function, called ReLu, has become the most prevalent activation function for hidden layers.  We will advance that the smooth ReLu, also called SoftPlus is actually much superior to ReLu. 

 

 

SoftPlus appears superior to ReLu because it captures the weights of many more neurons’ features, as it does not zero out any such features with input values < 0.  Also, it generates a continuous set of derivatives values ranging from 0 to 1.  Instead, ReLu derivatives values are limited to a binomial outcome (0, 1). 

 

Here is a picture of our DNN structure. 

 

One input layer with 4 independent variables: Consumer Sentiment, Housing Start, Yield Curve, and RGDP. 
 
Two hidden layers.  The first one with 3 nodes, and the second one with 2 nodes.  Activation function for the two hidden layers are SoftPlus for the 1st DNN model, and Sigmoid for the second one.
 
One output variable, with one node, the dependent variable, the S&P 500 quarterly % change.  The output layer has a linear activation function. 
 
The DNN loss function is minimizing the sum of the square errors (SSE).  Same as for OLS.  
 

The balance of the DNN structure is appropriate.  It is recommended that the hidden layers have fewer 

nodes than the input one; and, that they have more nodes than the output layer.  Given that, the choice of 

nodes at each layer is just about predetermined.  More extensive DNNs would not have worked anyway.   

This is because the DNNs, as structured, already had trouble converging towards a solution given an 

acceptable error threshold. 

 

As expected the DNN models have much better fit with the complete historical data than the OLS 

Regression. 

 

 

As seen above, despite the mentioned limitation of the Sigmoid function, the two DNN models (SoftPlus 

vs. Sigmoid) relative performances are indistinguishable.  And, they are both better than OLS Regression.

 

But, fitting historical data and predicting or forecasting on an out-of-sample or Hold Out test basis are two 

completely different hurdles.  Fitting historical data is a lot easier than forecasting.

 

We will use three different Test periods as shown in the table below:

 

 

Each testing period is 12 quarters long.  And, it is a true Hold Out or out-of-sample test.  The training data 

consists of all the earlier data from 1959 Q2 up to the onset of the Hold Out period.  Thus, for the 

Dot.com period, the training data runs from 1959 Q2 to 2000 Q1.

 
The quarters highlighted in orange denote recessions.  We call the three periods, Dot.com, Great 
Recession, and COVID periods as each respective period covers the mentioned events.
 
To visualize the models' respective prediction performance, we will use "skylines."  The column graph 
below looks like a set of skylines with vertical buildings for positive values and reflection in water for 
negative values.  Within the complete linked study, we show several other ways to convey the forecasting 
performance that you may prefer.  
 
 
As shown above, all the models predictions are really pretty dismal.  None of the models predicted the 
protracted 3-year Bear market associated with the Dot.com bubble.  At the margin, the OLS model
actually performed a bit better than the DNN models.  

Now, let's look at the Great Recession period.  In this situation, the models did better.  However, their 
overall predicting performance was nothing to write home about.  All models completely missed the 
severe market correction in the third year of the Great Recession period.  And, again the DNN models did 
not perform any better than the OLS Regression.

 
When focusing on the COVID period, the ongoing mediocrity (at best) of the models' prediction 
performance is readily apparent.  All models completely missed the robust Bull market in the third year of 
the COVID period (as defined).  Again, the DNN models did not fare any better than the simpler OLS 
Regression.  
 
If we look at average predictions for all three models for all three testing periods, we can get a quick 
snapshot of the competitiveness of the models. 
 

Without getting bogged down into attempting to fine tune model rankings between these three models, we can still derive two takeaways.  

The first one is that the Sigmoid issue with the "vanishing gradient descent" did not materialize.  As shown, the Sigmoid DNN model actually was associated with greater volatility in average S&P 500 quarterly % change than for the SoftPlus DNN model.   

The second one is that the DNN models did not provide any prediction incremental benefits over the simpler OLS Regression.  

So, why did all the models, regardless of their sophistication, pretty much fail in their respective predictions? 

It is for a very simple reason.  All the relationships between the Xs and Y variables are very unstable.  The table below shows the correlations between such variables during the Training and Testing periods.  As shown, many of the correlations are very different between the two (Training and Testing).  At times, those correlations even flip signs (check out the correlations with the Yield Curve (t5_ff)).  


The models' predictions failing is especially humbling when you consider that the mentioned 3-year Hold Out tests still presumed you had perfect information over the next 3 years regarding the four X variables.  As we know, this is not a realistic assumption.  


 
 
 

 

 

Thursday, March 3, 2022

Can Treasury Inflation Protected Securities (TIPS) predict Inflation?

 Treasury Yield - TIPS Yield = Inflation Expectation

The above basic equation allows to derive long term Inflation Expectation from the bond market.  By looking at the spread between Treasuries and TIPS of identical maturities, we can derive inflation expectation over a 5 year, 7 year, and 10 year horizon. 

The TIPS data is unfortunately very limited and starts only in 2003.  However, given that we deal with monthly observations the data is still associated with numerous data points. 

So back in 2003, we could derive annualized 5 year, 7 year, and 10 year inflation expectations by looking at the spread between the matching Treasuries and TIPS. 

In 2003, we derived annualized 5 year expectation over the 2003- 2008 period.  And, we compare this inflation expectation with the actual annualized 5 year inflation rate over this same 2003 - 2008 period observed in 2008.  So, when we graph this data, the first observation will start in 2008.  

When looking at the 7 year expectation, the framework is the same as the above.  And, when we graph this data, the first observation will start in 2010.  For 10 year inflation expectation, the first observation will be in 2013.

The complete study can be found at the following link: 

TIPS study at Slideshare  

TIPS study at SlidesFinder 

None of the TIPS derived inflation expectations turned out into effective predictions as shown on the scatter plots below. 


The scatter plots are more readily visible within the complete study.  Nevertheless, at a high level these three scatter plots disclose images of near randomness.  This is true whether you look at 5 year, 7 year, or 10 year horizons.  In all three cases, the underlying linear regressions have a slope and an R Square close to Zero denoting near randomness and absence of any material relationship between inflation expectation and actual inflation years later.

Here is looking at the 5 year horizon.

 

Here is looking at the 7 year horizon.

Here is looking at the 10 year horizon. 


All three graphs have a similar pattern with little relationship between inflation expectation and actual inflation.  This absence of relationship was precisely diagnosed using the scatter plots and underlying linear regressions above.  

When we combine the 3 sets of inflation predictions on the same graph, we can observe how bond investors reacted to the onset of the Great Recession back in 2008. 

 


The graph above discloses that back in 2008, the spread between Treasuries and TIPS over the 5 year, 7 year, and 10 year maturities resulted in inflation prediction associated with a deep deflationary environment.  We can observe that with the 3 deep negative spikes denoting negative inflation expectation over long periods of time starting back in 2008.  

Back in 2008, the negative inflation expectation over the 5 year horizon kicked in 2013 (blue line); 

Over the 7 year horizon it kicked in 2015 (red line); and 

Over the 10 year horizon it kicked in 2018 (gray line).  

Next, let's compare the combined inflation expectations as presented above vs. what happened: the actual inflation over those respective periods. 


As shown above, the actual annualized inflation rates look completely different from the matching annualized inflation expectations.  Within the actual data, there are no downward spike associated with a deflationary environment over several years (each monthly data point covers several years of data associated with the various maturities of the bonds: 5 year, 7 year, and 10 year).

There are considerations that the Federal Reserve (Fed) is a dominant investor in TIPS.  And, therefore the Fed may have distorted the resulting inflation expectation measure.  If that is the case, TIPS yields would be lower than otherwise.  And, the resulting inflation expectations would be higher than otherwise.  This is counter to the objective of the Fed.  But, this may be an unintended consequence that the Fed has not resolved.  

Looking at the data is rather ambivalent. 


The 7 year and 10 year maturities are supportive of the hypothesis that the Fed may have influenced the TIPS yields downward and indirectly the inflation expectations upward.  For both maturities, the inflation expectations are in average statistically significantly higher than actual inflation.  However, when looking the 5 year maturity, this is not the case; as actual inflation in average has been a bit higher than inflation expectation.  


Compact Letter Display (CLD) to improve transparency of multiple hypothesis testing

Multiple hypothesis testing is most commonly undertaken using ANOVA.  But, ANOVA is an incomplete test because it only tells you ...