New to pymc3 - learning through example - financial valuation question

Hi Guys,

Apologies if this isn’t written correctly - my first post, go easy on me ;-)… I’m not a statistician, but when I heard about prob. programming I thought it was very useful tool for financial valuation. So, here goes my question.

The value of a company can be approximated with a number of models. In this case, I am going to use a return on invested capital (roic) valuation model, which is defined as:

enterprise_value = ((ebit*(1-tax))*(1-(g/roic)))/(ke - g)

Excuse my lack of knowledge, please correct me if I am wrong here… enterprise_value is clearly a determinaistic variable which is based on known values for EBIT and TAX, but g and ke are probabilistic variables which have a uniform distribution.

The issue I have is that I do not know what distribution enterprise_value should have, and so I am wondering how to generate values for enterprise_value using the model…?

So far i have the following:

import pymc3 as pm

basic_model = pm.Model()
tax = 0.30
ebit = 1

with basic_model:

    #priors
    ke = pm.Uniform('ke', 0.03, 0.05)
    g = pm.Uniform('g', 0.05, 0.20)
    roic = pm.Uniform('roic', 0.10, 0.20)
    
    #expected value 
    ev = ((ebit*(1-tax))*(1-(g/roic)))/(ke - g)

    #likelihood - im guessing the likelihood is the forecast sample...?
    y_obs = pm.Uniform('y_obs', observed=ev)

Ive taken a stab at it withe the likelihood being uniform, but this is where my lack of stats knowledge is causing me some problems - as I’m just guessing that is the right thing to do here… As stated before, I dont know what the distribution will look like for y_obs, so can pymc3 do that?

Any help would be appreciated!

What you’re trying to do is sometimes called a simulation study, or a monte carlo simulation, or ‘sampling from the prior predictive’, and you can definitely us pymc3 for this. Unless your model becomes more complicated, you may have an easier time just writing it using plain numpy. What makes this a simulation study instead of a inference problem (which pymc3 is designed to solve) is that there is no observed data.

Since I don’t know finance, this extension of your problem may sound strange, but bear with me. Say you had some number n values of ev or enterprise value that you have “observed”, meaning you got them from some data somewhere. And say additionally, that you assume, or model, that these values were normally distributed around an unknown mean mu, where

mu =  ((ebit*(1-tax))*(1-(g/roic)))/(ke - g)

Now your likelihood function is

y_obs = pm.Normal("y_obs", mu=((ebit*(1-tax))*(1-(g/roic)))/(ke - g), sd=sigma, observed=ev_observed)

The goal would be to infer posterior distributions over the unknown variables which you placed priors on, ke, g, roic.

For the problem you have at hand though, you can write:

import pymc3 as pm

tax = 0.30
ebit = 1

with pm.Model() as basic_model:
    #priors
    ke = pm.Uniform('ke', 0.03, 0.05)
    g = pm.Uniform('g', 0.05, 0.20)
    roic = pm.Uniform('roic', 0.10, 0.20)
    
    #expected value
    ev = pm.Deterministic("ev", ((ebit*(1-tax))*(1-(g/roic)))/(ke - g))
    
with basic_model:
    samples = pm.sample_prior_predictive(1000, vars=["ev"])

samples should be what you’re looking for I think.

@bwengals - thank you. I think i understand what you’re saying now…

So while i can use pymc3 for monte carlo problems, what its more useful for is to work out what the inputs to the deterministic variable, should be…

So pymc3 is essentially built to work out what the distributions of the priors is… so kinda works backwards, rather than forwards… ie, if the value of ev is x, what would the ke, g and roic need to be?

Yes exactly. You can certainly use pymc3 for what you’re trying to do, but the working backwards part is more difficult and is what pymc3 is designed to tackle.