Skip to main content

Asset Pricing

 We would like to use Bayesian modeling to gain insights about the risk of a given portfolio. Before we can model this problem, we have to develop some foundations in financial modeling. A strong foundation in financial modeling will help us represent variables like a portfolio in our probabilistic graph. In this installment, we develop the asset pricing model.

Goal is Utility

An investor is interested in optimizing his wealth through the creation and liquidation of his portfolio. An investor must make a purchase decision when considering adding an asset to his portfolio. In this section, we develop the model that drives these decisions.


Investors are interested in wealth not because they are interested in dollars but rather with what they can do with said dollars, which is dependent on the time period**. Thus wealth is better measured in utility rather than dollars.


**Because a dollar is still a useful valuation metric for an asset within a time slice, we will still use this metric in intermediate values, using care to always denote the dollar with the time index as to not mix dollars from different time periods. We will use the notation Dt to refer to “dollar value at time t”. 


Definition: Utility Function

A utility function maps consumption to satisfaction. We can measure the instantaneous utility and the total utility. The instantaneous utility function, denoted u, measures the satisfaction of consuming N units at time t. The total utility function, denoted U, measures the satisfaction of consuming a chain of units over T time steps. Let Ct be a random variable defined as the number of units consumed at time t. Then we define our utility functions as follows:


Instantaneous Utility Function.


u : ℕ → R

Ct Ct1-𝛾/(1 - 𝛾)


Where 𝛾 measures how averse the investor is to fluctuations in consumption. Higher 𝛾 is more risk averse while a low 𝛾 indicates a higher risk tolerance.


Below is a plot of the instantaneous utility function for three different risk tolerances. All variations are steeper for small values of Ct and gradual for larger values of Ct, reflecting the fact that “the first bite always tastes better than the last! [Cochrane]”. 


Note that for higher values of gamma the curve is more concave, indicating that risk tolerant investors are not only less satisfied by more consumption, consuming more has less impact at an earlier threshold relative to risk averse investors, who value consumption more.


Total Utility Function:


U : ℕT → R

{Ct}t=0T E[ SUMt=1..T 𝛽t u(Ct)]


where 𝛽 t in (0,1) is the subjective discount factor which models impatience. A high 𝛽 indicates more patience while a low 𝛽 indicates less patience. Below is a plot of a total utility function over 10 steps with different values for 𝛽 . Note that for small values of 𝛽 the satisfaction over time is stagnant, representing the need to consume more now and not later while the patient investor is more satisfied after more time has passed.

Solving for Portfolio Given Our Utility Goals

The investor wants to choose assets that maximize wealth which means he wants to maximize utility. Suppose there are M assets to choose from with infinite units of each asset available. Then we can derive an expression for choosing the set of holdings that maximizes the utility:


Definitions and Notations:

      Let M be the number of assets available. 

Let Q be the set of all possible holdings. We define Q := {P | P := {n1, …, nM} where ni is the number of units held of asset i.} 

q[i] in denotes the number of units of asset i in portfolio q in Q

pi,t denotes the price of asset i at time t

xi,t denotes the payout of asset i at time t. It is always in Dt units

et denotes consumption in Dt 

Then our optimization problem becomes:

P = max q in Q { today’s utility  + expected future utility } 

  = max q in Q { u(ct)  + Et[ 𝛽 u(ct+1)] }                                   [1]

such that

ct = et - SUMi=1..M pi,tq[i]

ct+1 = et+1 + SUMi=1..M xi,t+1q[i]


Think of the e value as the amount we planned to consume today on both investments and consumables. The reason we subtract our investment from this value is because every dollar we choose to invest is a dollar we choose not to spend on consuming goods today. The added amount is the amount due to consumption after liquidating the investment from the previous time step. The c value is strictly the amount of consumed units, not including investments. 


Optimization problems are solved by finding the maxima or minima of the objective function. Maxima or minima of a function are the points in the function where the rate of change becomes zero. Thus to find these locations we take the derivative of the objective function with respect to the portfolio choices and solve for 0. Note that we cannot take the derivative with respect to the portfolio because the portfolio has M variables: one for each asset. Thus we take the derivative with respect to each one and combine them later.


Find the Q = {q1, …, qM} such that the following holds:


∂/∂q[i] (u(ct)  + Et[ 𝛽 u(ct+1)]) = ∂u(ct)/∂q[i] + Et[ 𝛽 ∂u(ct+1)/∂q[i]] = 0


Compute each term and use chain rule to deduce that:


∂ ct/∂q[i] = - pi,t => ∂u(ct)/∂q[i] = - pi,t u’(ct)

∂ ct+1/∂q[i] = xi,t+1 => Et[ 𝛽 ∂u(ct+1)/∂q[i]] = Et[ 𝛽 u’(ct+1) xi,t+1]


Thus


∂/∂q[i] (u(ct)  + Et[ 𝛽 u(ct+1)]) = - pi,t u’(ct) + Et[ 𝛽 u’(ct+1) xi,t+1] = 0       [2]


Note that on the RHS of [2] we have a term that includes price (marginal cost of buying a single unit) and a term that includes the payout (the expected discounted future payout). The goal was to solve for the quantity of units of each asset to buy, but there is no term that represents this! What do we do?


There is no reason to fret because although ultimately the portfolio contents are defined by quantities of each asset, the information we need to make this decision is the value of tomorrow’s payout in today's dollars relative to the price of the asset. Allocations can then be decided based on the delta of the valuation and the price and budget constraints. Using that logic then the information we need is the value of the asset, which we can get by solving [2] for pi,t


To isolate pi,t then we rearrange the terms:


pi,t  = Et[ 𝛽 u’(ct+1) xj,t+1]/u’(ct) = Et[ 𝛽 u’(ct+1)/u’(ct)  xi,t+1]


This gives us a stochastic discount factor:


Mt+T, t = 𝛽 u’(ct+1)/u’(ct)


And a pricing model:


pi,t  = Et[ Mt+T, t xi,t+1]         [3]



Deep Dive 1: Stochastic Discount Factor (SDF)

The stochastic discount factor is an important value in considering the price of an asset. Although the stochastic discount factor is independent of the asset prices both the asset prices and the stochastic discount factor are dependent on the economic states (for example, whether we are in booming times, a recession, or neither) so they are correlated through those variables.


Let’s build some intuition behind the stochastic discount factor by visualizing the value under different economic conditions. The economic conditions are controlled by changing the parameters of the marginal utility function (the first order derivative of the instantaneous utility function). During recessive times the change in satisfaction under a change in consumption is high because money is scarce while in booming times money is plentiful so satisfaction changes less under a change in consumption. Modeling out the stochastic discount factor for three different states (boom, normal, recession) with gamma equal to 1 and 𝛽 set to 0.99 yields:

Note that the stochastic discount rate if a boom occurs is smaller than during normal times or a recession. This indicates that an asset converted to today’s dollars is more discounted if we anticipate a boom than if we anticipate a recession. If we anticipate a recession and the payout is the same then that asset is more valuable to us now because money will become scarce when we liquidate this asset. This translates to a smaller discount because we should be willing to pay more for an asset that pays out during scarce times.


EDIT: This example, its solution, and follow up problem definition have some inconsistencies. Please see the followup blog post for a corrected example and problem definition.


To see how this plays into our pricing model, we consider three different assets and the SDF across three different outcomes (I invented these reasonable numbers so don’t try and derive them from the plot above). 


State

Asset 1 (cyclical)

Asset 2 (defensive)

Asset 3

Probability of outcome

SDF

Boom

150

90

110

0.33

0.8

Recession

50

120

90

0.33

1

Normal

100

100

100

0.33

1.4


Our pricing model is then:


p1,t  = Et[ Mt+T, t x1,t+1] = 0.33 * 0.8*150 + 0.33 * 1*50 + 0.33 * 1.4 * 100 = 103.33

p2,t  = Et[ Mt+T, t x2,t+1] = 0.33 * 0.8*90 + 0.33 * 1*120 + 0.33 * 1.4 * 100 = 110.67

p3,t  = Et[ Mt+T, t x3,t+1] = 0.33 * 0.8*110 + 0.33 * 1*90 + 0.33 * 1.4 * 100 = 106.00


Imagine we have a budget of $1,000 and each asset is currently priced at 100 dollars. Then according to our valuations all the assets are undervalued and we can afford to buy 10 units total. How should we decide? 


Let’s write out our optimization function. Note that we are optimizing for utility with gamma equal to 1 which means we can reduce our utility function to log(c).


max{q1, q2, q3} E[u(c[t+1])] = SUMstate=1,2,3Pr(s) log (consumption)

max{q1, q2, q3} E[u(c[t+1])] = SUMstate=1,2,3Pr(s) log (SUMstate=1,2,3q[i]x[i][state]) subject to q1 + q2 + q3 = 10


We need to constrain the allocations to our budget. The method of lagrange multipliers can be applied to this problem to enforce this constraint. The function we optimize is then the Lagrange form of the function:


L(q1, q2, q3,  λ ) = SUMstate=1,2,3Pr(s) log (SUMstate=1,2,3q[i]x[i][state]) - λ(SUMi=1,2,3q[i] - 10)


Take the derivative with respect to q1, q2, q3, set to 0, and solve for q1, q2, q3 respectively


∂L/∂q[i] = SUMstate=1,2,3Pr(s)x[i][state]/(SUMj=1,2,3q[j]x[j][state]) - λ = 0

∂L/∂q[i] = SUMstate=1,2,3(0.33)x[i][state]/(SUMj=1,2,3q[j]x[j][state]) = λ 


Which gives us three equations plus the budget constraint:


(0.33)150/(150q1 + 90q2 + 110q3 ) + (0.33)50/(50q1 + 120q2 + 90q3 ) + (0.33)100/(100q1 + 100q2 + 100q3 ) = λ

(0.33)90/(150q1 + 90q2 + 110q3 ) + (0.33)120/(50q1 + 120q2 + 90q3 ) + (0.33)100/(100q1 + 100q2 + 100q3 ) = λ

(0.33)110/(150q1 + 90q2 + 110q3 ) + (0.33)90/(50q1 + 120q2 + 90q3 ) + (0.33)100/(100q1 + 100q2 + 100q3 ) = λ

q1 + q2 + q3 = 10


Note that the budget constraint is still required because the Lagrangian keeps each quantity within the limit but does not nothing to enforce that the budget is achieved. In other words, without the final equation we cannot guarantee that all the money in the account will be spent.


Solving this equation in Python using a solver yields an allocation of (1, 9, 0). This reflects our utility function’s high value for consumption during recessive times since asset 2 performed well when money was scarce (120 in recession versus 50 and 90). 


Pulling it All Together: A Problem Definition

Thus far we have covered our goals and derived a framework we can use to select a portfolio according to those goals. To drive this idea home, let’s now formally define the problem we are interested in solving. 


Given

  • M assets, where pi,t is the price per unit 

  • an initial investment amount N in today dollars

  • A liquidation period T


Unknown: A portfolio P := {n1, …, nm } where ni is the number of units of asset i held in the portfolio.


Constraint

  • The cost of the portfolio is Costt(P) = SUMi=1…M(ni pi,t)

  • The payout of the portfolio at time t+T under scenario ω is XP, t+T(ω) = SUMi=1..M ni Xi, t+T(ω)

  • The present value (in Dt) assuming a liquidation at time T is VD[t],T(P) = Et[Mt+T,t XP,t+T] = SUMi=1..MEt[Mt+T,t Xi,t+T


We want to find P* such that 


P* = maxQ s.t. Cost[t](Q) < N(VD[t],T(Q) - Costt(Q))



This problem definition is extendable as we will see in the following installment which will be a review of a case study in how asset pricing and Bayesian modeling can be combined to collect insights about your portfolio. 


Sources: Asset Pricing, John H. Cochrane, 2001


Comments

Popular posts from this blog

Model Based Public Policy: Bayesian Neural Nets and Trade

  1 Motivation Recent changes in U.S. trade policy have sparked debates about their effect on American prosperity, national security, and federal income. This work began as an attempt to formalize the relationship between trade policy and prosperity and continues as a journey learning data science and how to apply modeling to public policy. For my first installment, I recount my experience building a Bayesian neural net to solve the problem of selecting a trade policy that optimizes American prosperity. 2 Defining The Problem Let’s begin by defining the problem we wish to solve. Problem definitions require identifying three things:  Given information. This is the data we start with before any computation. For our modeling problem, we will need at a minimum data relevant to the prosperity of a nation along with trade policy data.  Unknown. The unknown is the set of values you want to identify. For a modeling problem, the unknown are  The templated function we wish to...

Asset Pricing Revised

  In a previous post I included a problem definition and an example. Upon reviewing the post, I discovered that not only were both the problem definition and the example incorrect, they were inconsistent. In this post I aim to correct the problem definition and then reimplement the example with the new problem definition. Part 1: Correct the Problem Definition Let's start with a recap of the problem we are trying to solve. Note that I altered the problem definition a bit to correct two major issues: The constraint in the original problem definition was not in terms of the givens. The requirement is that the expression we optimize must be expressible entirely in the terms we are given. A previous definition omitted the payouts and the potential economic scenarios, both of which are referenced in our constraint equation. Optimization was not with respect to the correct property. The original expression I defined was optimizing payout minus the cost of the portfolio. But we are not o...

Back To Basics: An Introduction to Bayesian Modeling

I was preparing another blog series on how transformers work when the real world disrupted my focus and once again pulled me into the world of Bayesian inference. This time it was not geopolitical tensions that caught my attention but the relentless ascent of the S & P 500 despite the perceptively turbulent social and political environment of the United States. Confused, I sought answers by trying to identify relationships between economic activity and the share price of the largest American corporations. Assuming this relationship to be noisy, I reached for the tool that would quantify this noise via reported uncertainty. This blog post is a recount of this journey, starting with a review of the tools I plan to use to learn the relationships of interest.  This first installment is introductory. A subsequent post will attempt to recreate the results of a decades old case study with modern data. In a final installment, a hypothesis about relationships in modern times will be pro...