DCF repo now reproduces Tesla and Twitter valuations

There has been some interest (OK, one person) in my attempts to reproduce valuation models by Aswath Damodaran, principally in Python 3. I have taken stabs at performing the valuations in Python, Go, Maxima, Octave, and even VB4. I have, lately, been working on Fortran, and that is where the valuations are confirmed correct. I am thinking of switching development entirely to Fortran, as it has cool features like namelists, which really makes entering parameters very straightforward. In other languages, I would have to write code for the inputs. With Fortran, using a namelist lets me circumvent this issue. Fortran does the heavy lifting for me, with virtually no coding required.

Here is the input file for the Tesla valuation, for example:

&pars
rgr_0 = 1.70
rgr_t = 1.0275
rev(0) = 1328.70
eoi_0 = -21.86
eom_t = 0.125
taxr_0 = 0.0
taxr_t = 0.35
scr = 1.41
nol_0 = 0.0
roc_t = 0.08
coc_0 = 1.1003
coc_t = 1.08
pfail = 0.1
fproc = 6407.15
cash = 201.89
debt = 578.74
voo = 3644.97
nsh = 121.45
spr = 168.76
/

There are a lot of parameters. None of them are there for decoration, though. They all do something.

My repo is https://github.com/blippy/aswath , so anyone with Git can check out the code. I am also working on a manual. I have typed up less than half of what I have written. Everything is subject to revision, though, and it is likely that I will change the infrastructure entirely.

I have included Aswath’s spreadsheets in the repo, and you should use this for hints if you want to change the parameters in a file. I recommend that you clone your repo on a Linux platform, as it is more likely to have the infrastructure necessary to support all the paraphenalia that these kind of projects entail. There is nothing Linux-specific in the repo. code written in Python, Go, Maxima and Octave all have Windows versions available for free. Fortran complies with normal specs, and I’m not aware of any Gnu-specific extensions. You should be able to compile it with any Fortran 90 (or newer) compiler. It should also work on cygwin, and Windows native environments like MinGW. I haven’t tested them, though.

Let’s see the 3-stage valuation model in action, which is ultimately based on Damodaran’s fcfeginzu2014 model. I hope to include a whole raft of models eventually. It is not a quick process, mind.

Once you have cloned the git repo, change to directory fortran, and type make. Compilation should be fast. One executable that it creates is vdgfs, which will drive output to a 3-stage growth model. Once you have that, you are ready to process the input file tesla.dat, whose contents I have shown above. Execution is straightforward:

./vdgfs <tesla.dat

This will produce the output

RGRS=    1.0000    1.7000    1.7000    1.7000    1.7000    1.7000    1.5655    1.4310    1.2965    1.1620    1.0275    1.0275
REVS=   1328.70   2258.79   3839.94   6527.90  11097.44  18865.64  29534.16  42263.38  54794.48  63671.19  65422.15  67221.27
EOMS=   -0.0165   -0.0023    0.0118    0.0260    0.0401    0.0543    0.0684    0.0826    0.0967    0.1109    0.1250    0.1250
EOIS=    -21.86     -5.21     45.46    169.62    445.33   1023.91   2020.70   3489.45   5299.15   7058.26   8177.77   8402.66
TAXR=      0.00      0.00      0.00      0.00      0.00      0.00      0.07      0.14      0.21      0.28      0.35      0.35
NOLS=      0.00      5.21      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
EATS=      0.00     -5.21     45.46    169.62    445.33   1023.91   1879.25   3000.93   4186.33   5081.94   5315.55   5461.73
RINS=      0.00    659.64   1121.39   1906.35   3240.80   5509.37   7566.33   9027.82   8887.30   6295.54   1241.82   1877.47
FCFS=      0.00   -664.85  -1075.93  -1736.74  -2795.48  -4485.45  -5687.07  -6026.89  -4700.97  -1213.60   4073.73   3584.26
COCS=    1.0000    1.1003    1.1003    1.1003    1.1003    1.1003    1.0962    1.0922    1.0881    1.0841    1.0800    1.0800
CDFS=    1.0000    0.9088    0.8260    0.7507    0.6823    0.6201    0.5656    0.5179    0.4760    0.4391    0.4065    0.3764
PVFS=      0.00   -604.24   -888.71  -1303.77  -1907.27  -2781.32  -3216.83  -3121.32  -2237.46   -532.83   1656.09   1349.17
 Terminal Value =    68271.5391
 PV (term val)  =    27754.3145
 PV (CF decade) =   -14937.6621
 PV Sum         =    12816.6523
 Prob failure   =   0.100000001
 Failure proceed=    6407.14990
 Val Oper Ass   =    12175.7012
 Val of equity  =    11799.7012
 Val of options =    3644.96997
 Val of common  =    8154.73145
 Num shares     =    121.449997
 Est val per shr=    67.1447678
 Share price    =    168.759995
 SP as % val    =    251.337524

If you look at Aswath’s reference spreadsheet teslavaluation.xls in the root directory of the repo, you will see that the numbers will be the same, barring rounding errors. You can tinker the parameters to suit yourself. Better, you can study the source of vdgfs.f90 to see how the calculations are being made. The code is far from perfect – and there will be considerable clean-up and modularisation as time progresses – BUT, it should be a lot less enigmatic than all those weird spreadsheet cells references.

The last three lines of the output are likely to be what you are really interested. It tells you that the model produces an estimated fair value for Tesla of $67.14, the share price at the time was $168.76 – more than double the estimate of fair value.

I wont give you a complete breakdown of the input parameters, but just to give a flavour: rgr refers to the revenue growth rate. rgr_0 is the growth rate for phase I, which last five years. rgr_t is the terminal growth rate. rev(0) is the base revenue figure. scr is the sales to capital ratio. Your best bet is to compare the numbers with Aswath’s spreadsheet to identify their purpose. proper descriptions will follow as time permits.

Please do experiment with the Twitter valuation, too:

./vdgfs <twitter.dat

Have fun!

Advertisements

About mcturra2000

Computer programmer living in Scotland.
This entry was posted in Aswath. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s