sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

Compute price-dividend ratio using correct formula #197

Closed sbenthall closed 1 year ago

sbenthall commented 1 year ago

We have been computing the price/dividend ratio with the quarterly discount factor and a daily dividend shock. This puts our price/dividend ratio way off and we can adjust either the discount factor or the dividend distribution to accommodate this.

Do we need to do anything with the risk aversion?

sbenthall commented 1 year ago

This is not straightforward ...

image

If I adjust the discount factor from a quarterly to a daily discount factor, $\beta_d = \beta_q^{1/60}$, then $\theta$ in the above expression becomes very small.

With $\rho = 5$, the other part of the expression becomes $(1 / 2) 5 4 * \sigma^2$, which is also small, because of $\sigma = 0.011988$, but this is now larger than $\theta$. Which means that the computed price-dividend ratio is negative. (-0.0719 when the quarterly discount factor is 0.95)

@alanlujan91 @llorracc any ideas?

sbenthall commented 1 year ago

@alanlujan91 found the right expression in footnote 3 (or 4):

$d^\rho / P = \theta$ where $\theta = \frac{1}{\beta} - 1 = \frac{1 - \beta}{\beta}$

Which implies

$$d = (P \theta)^{1/\rho} = (P (\frac{1}{\beta} - 1))^{1/\rho}$$

which is never negative because $0 < \beta < 1$ and $\rho > 0$, so we're good.

We'll need to change the formula in both SHARKFin and AMMPS (for institutional investors, market makers) according. cc @mesalas

mesalas commented 1 year ago

👍 @sbenthall. Any ideas for what reasonable values for $\rho$ and $\beta$ are?

llorracc commented 1 year ago

The value of [image: \rho] is a contentious issue in economics/finance. The famous “equity premium puzzle” https://en.wikipedia.org/wiki/Equity_premium_puzzle is basically that to match aggregate stock market data you have to have a value of [image: \rho] of at least 10, maybe more. But given the risks people face in their everyday lives, risk aversion of 10 is absurd. Like, it would mean that people would save 50 percent of their income for most of their lives in order to build up enough wealth to shield themselves from stock market risk.

The relevant derivations are in my (revised today!) lecture notes:

Lucas Asset Pricing https://llorracc.github.io/LucasAssetPrice

The case that corresponds to what we are doing is in the first equation in the section

specializing-the-model https://llorracc.github.io/LucasAssetPrice#specializing-the-model

as specialized to the case of a random walk in dividends:

when-dividends-follow-a-random-walk https://llorracc.github.io/LucasAssetPrice#when-dividends-follow-a-random-walk

with an explicit derivation of the formula https://llorracc.github.io/LucasAssetPrice#PLognormGro for the case where there is growth in dividends.

See the footnote near there for an explicit description of how all the parts work together (and in particular how to calibrate [image: \vartheta] — set it to the riskfree interest rate of about 1 percent). Then search for the [image: \rho] that makes the equation hold, using measured [image: P] and measured [image: d] and [image: \vartheta=0.01]

On Tue, Mar 7, 2023 at 8:04 AM Nicholas @.***> wrote:

👍 @sbenthall https://github.com/sbenthall. Any ideas for what reasonable values for $\rho$ and $\beta$ are?

— Reply to this email directly, view it on GitHub https://github.com/sbenthall/SHARKFin/issues/197#issuecomment-1458136513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK7Z753EZ4RRCCIKWGPDW24W7RANCNFSM6AAAAAAVHBFCTY . You are receiving this because you were mentioned.Message ID: @.***>

--

sbenthall commented 1 year ago

Thanks @llorracc

Next steps on this issue are to update the code to use the correct formula for the price/dividend ratio from your notes.

llorracc commented 1 year ago

I would urge you to implement your algorithm so that the input to your calibration is "by what amount/margin is the impatience condition satisfied" and the algorithm checks to make sure that the input is a positive number. That way it will be impossible to even explore calibrations for which the results will be nonsense (like negative prices etc).

On Mon, Mar 13, 2023 at 1:49 PM Sebastian Benthall @.***> wrote:

Thanks @llorracc https://github.com/llorracc

Next steps on this issue are to update the code to use the correct formula for the price/dividend ratio from your notes.

— Reply to this email directly, view it on GitHub https://github.com/sbenthall/SHARKFin/issues/197#issuecomment-1466624810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK77PV5WDQG4JMSANIFTW35M3FANCNFSM6AAAAAAVHBFCTY . You are receiving this because you were mentioned.Message ID: @.***>

--

sbenthall commented 1 year ago

That makes sense. Good idea @llorracc

The impatience condition is essential, and catching violations in an intelligent way is much better than relying on mere technical failure.

I expect to have some more questions about the impatience condition once I've had the opportunity to study your fresh notes more.

mesalas commented 1 year ago

@sbenthall would it be possible to use a smaller stdev for the dividend process? Right now we are using $\sigma = 0.011988$ that does make the institutions quite active using $\sigma = 0.006$ makes things a bit more calm?

sbenthall commented 1 year ago

There's a lot going on with this question.

Recall that we got these numbers by taking the daily S&P500 statistics, and using the theoretical point that the price/dividend ratio is constant. [I believe I did the math correctly on this, but welcome corrections!]

The formula in the fresh version of the notes is actually quite different from the one we first implemented. Among other changes, price is no longer a constant times the dividend. There is another factor of $\rho$. I haven't implemented the new formula in Python yet, have you?

Our 'stylized fact' target has been to match the S&P500, roughly. That's how we got the numbers we've been using. Here's another source which confirms we're in the right ballpark with those numbers. Though note that we've had the unrealistic assumption that the returns follow a lognormal random walk. https://www.priceactionlab.com/Blog/2020/04/sp-500-statistics/

One thing to figure out with the new formula is what $\mu$, $\sigma$ of the dividend shock corresponds to the S&P500 statistics for returns.

But this is for a baseline version of the model. All these values are parameters that we can in principle sweep over.

Can you say more about how you are measuring institutional activity, and what you are targeting as a stylized fact?

sbenthall commented 1 year ago

OK, so I've worked through the new formulas a bit. To address your point, @mesalas , one thing we will need to do is scale the size of the dividend shocks down, because the corresponding shocks of the price process (which we are trying to match to S&P500 empirics) are scaled up by the risk aversion rate $rho > 1$. Likewise for the growth rate.:

image

mesalas commented 1 year ago

Ok let's see how the new formula affects things. If we are targeting a specific known dividend std, we should do that. What I observed was just that the price seems to move a lot from day to day, but the price moves match the dividend so if that's a realistic std we should keep it.

sbenthall commented 1 year ago

I've ran some calculations and it looks like there's another issue, which is that with realistic discount factors and growth rates, we don't clear the impatience condition in the fresh LAP notes, regardless of risk. So my view is there's still some more work to do on the math.

llorracc commented 1 year ago

Seb, I'm not sure what your starting point was for the derivations above, but I don't think it was the right one. (Or maybe the problem is with $\gamma$; in the notes, $\gamma$ is an annual growth rate (like 0.02 for 2 percent). But I don't think you mean to be considering the case where, if your $\phi=1$, $d{t+1} = 0.02 d{t}$ -- a negative 98 percent growth rate per period. I think you meant to be using $\Gamma = e^{\gamma}$.

I think it would make for clearer discussions if you could start with the LucasAssetPrice.tex document and add to it what further derivations you think you might need.

But I'm not sure there are any that you need. The formula I think you need is the one at the end of the revised notes, which you will note has a constant price to dividend ratio:

https://llorracc.github.io/LucasAssetPrice/#PLognormGro

(Your derivation seems to be relating growth of prices and growth rates of dividends to each other, but of course the growth rates are identical if the ratio is constant).

PS. Somehow there's an error in the Lucas-Asset-Price-Model's example of the case where dividends follow a geometric random walk with drift. I've asked @Mv77 to look at it and make the necessary edits.

sbenthall commented 1 year ago

In the above comment, I was using $\phi$ and $\Phi$ in a sui generis way to mean the lognormal shock to dividends and prices, respectively, and was starting from the statement in the notes that $\frac{P_t}{d^\rho_t}$ is constant.

But this is neither here nor there as I've seen you've made new updates to the notes and the formulas have once again changed.

I'll review the new notes and figure out how to proceed again. Thanks.

sbenthall commented 1 year ago

6cb996c updates the price-dividend-ratio utility method based on recent work on Lucas Asset Pricing.

There's a notebook added to the macro/ directory with my math on this. I had to do things somewhat differently that @llorracc does in his lecture notes because of how we are calibrating to the S&P500. But in the notebook I'm able to show the math is equivalent, and most importantly, this gets us a price/dividend ratio of ~9999, which is a positive number, with our existing calibrations.

In other words, I think this work unblocks us on this issue and we can proceed. @mesalas let me know if you'd like me to walk you through the formula, since I suppose you'll need to use it for the AMMPS agents.

Before closing out this ticket for good, I'd like to do a couple of things:

llorracc commented 1 year ago

On Thu, Mar 16, 2023 at 12:04 PM Sebastian Benthall < @.***> wrote:

6cb996c https://github.com/sbenthall/SHARKFin/commit/6cb996c6f85b4d11a9375da8739145146e66f3e7 updates the price-dividend-ratio utility method based on recent work on Lucas Asset Pricing.

There's a notebook added to the macro/ directory with my math on this. I had to do things somewhat differently that @llorracc https://github.com/llorracc does in his lecture notes because of how we are calibrating to the S&P500. But in the notebook I'm able to show the math is equivalent, and most importantly, this gets us a price/dividend ratio of ~9999, which is a positive number, with our existing calibrations.

In other words, I think this work unblocks us on this issue and we can proceed. @mesalas https://github.com/mesalas let me know if you'd like me to walk you through the formula, since I suppose you'll need to use it for the AMMPS agents.

Before closing out this ticket for good, I'd like to do a couple of things:

  • Work through how changes in time scale effect the 'impatience condition' for the Lucas Asset price. Intuitively, the price/dividend ratio should be invariant to scale. But I'm not getting that in the math. Maybe my error, or maybe something fishy to work out. @alanlujan91 https://github.com/alanlujan91 you sounded interested in this.

Price is a stock variable. Dividends are a flow variable.

So it matters what the interval is over which you are measuring the dividends.

Say the price of IBM stock is $200, and its dividend annually is $10. Then the ratio P/d{annual} is 20. But if we are looking at daily data, the dividend is assumed to be 1/365 as large for each day as for the year. So the ratio P/dividend{daily} is 365 times P/dividend_{annually}

  • Make a PR to the LucasAssetPrice repository with the math and introduced concepts in it (especially the 'subjective return' factor, which is not a name I'm attached to, but which seems important) so @llorracc https://github.com/llorracc can do a thorough review in the context of LAP more generally.

— Reply to this email directly, view it on GitHub https://github.com/sbenthall/SHARKFin/issues/197#issuecomment-1472261618, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCK74R5G3XZU2QJICMPFLW4M22TANCNFSM6AAAAAAVHBFCTY . You are receiving this because you were mentioned.Message ID: @.***>

--

sbenthall commented 1 year ago

Thanks @llorracc . Now that you put it that way, that's totally clear. I was in error.

What I wrote was not exactly what I am getting at, which is whether the factor that is at stake in the impatience condition is invariant to the time interval. (This is not so unlike the factors that play in the impatience conditions in your BufferStock paper.) I don't think this factor has a name yet; I think it is something like the subjectively valued growth rate of the dividend. I'm referring to the LHS here:

image

Or, equivalently:

image

Where $\phi_t$ is the lognormally distributed dividend shock.

sbenthall commented 1 year ago

I see now that by extension of your argument @llorracc , this factor must not be time scale invariant.

On the other hand, it must vary with time scale in a systematic way (as is reflected in the price-dividend ratio as time scale changes).

I'll give it some more thought to get a better intuition why that is.

llorracc commented 1 year ago

If $\beta$ and $\gamma$ and $\sigma^{2}$ are measured at the annual frequency (like, $\beta=0.96$ and $\gamma=0.02$ and $\sigma^{2}=0.01$ and say $\rho=2$, the annual-rate version requires 0.96e^((1-2)(0.02-2(0.01)/2)=0.95 which is less than 1.

To get the daily rate, you just raise all the terms to the power 1/365 (if we are thinking of dividends accruing on a daily basis).

sbenthall commented 1 year ago

TODO: The 0.96 discount factor is an annual figure from the literature. Shift this to quarterly for the model configuration.

sbenthall commented 1 year ago

PR to the LAP notes here: https://github.com/llorracc/LucasAssetPrice-Latest/pull/2

sbenthall commented 1 year ago

One more error with the derivation of the price/income ratio used in SHARKFin....

We have mean $\mu_P$ and standard deviation $\sigma_P$ of the price process.

We need to fit to that a dividend process $d_{t+1} = d_t \Gamma \phi$, where $\Gamma$ is a constant growth factor and $\phi$ is a lognormal shock.

In my notes, I've written that $\Gamma = \muP$ and $\sigma\phi = \sigma_P$, but that is not correct.

Rather $\sigma_\phi = \frac{\sigma_P}{\sqrt{\Gamma}}$ for facts-about-lognormal-distributions reasons. EDIT: Formula changed from before.

I'll need to work this through the notes in this repository, the code, and the LAP notes PR. @mesalas I'll ping you once I've implemented this with the code on the SHARKFin side.

sbenthall commented 1 year ago

@mesalas see e7484 for change

mesalas commented 1 year ago

Thanks. I have implemented this in ammps