Free Cash Flow Estimation and Forecasting

Continues discussion of DCF valuation. This lecture series focuses on the free cash flow (FCF) side of the model. General forecasting material is included to be able to forecast FCFs.

Introduction to Free Cash Flows


Notes

  • As a recap, we are focusing on FCF calculation so that we can do the discounted cash flow (DCF) valuation of a stock

  • We need to calculate historical FCFs and also forecast future FCFs

  • Historical FCFs are a mechanical exercise that anyone could do, but forecasting is as much an art as it is a science

  • FCFs accrue to all investors, debt and equity, and so they can be used to determine the value of the firm

  • Net income is a measure which accountants have devised to smooth out the cash flows of the company, representing one time outlays which are used in multiple periods by splitting the cost across those periods

  • As far as valuation is concerned, net income does not matter. FCFs are what matters as they are what is actually happening with the operations in that time period

  • Unless the historical FCFs are very stable, you should almost always be forecasting the financial statements and calculating the future FCFs rather than forecasting them directly

  • There is a lot of flexibility in forecasting as you can use dozens of different possible models, and three common forecast targets (levels, growth, percentage of another item)

Transcript

  • 00:03: hey everyone this is nick diabetis
  • 00:05: teaching you financial modeling
  • 00:07: today we're going to be doing an
  • 00:08: introduction to free cash flows
  • 00:11: this is part of our lecture segment on
  • 00:13: free cash flow estimation and
  • 00:15: forecasting
  • 00:16: which follows on to our previous lecture
  • 00:19: segment
  • 00:20: on the weighted average cost of capital
  • 00:24: putting these two lecture segments
  • 00:25: together we will develop the
  • 00:27: discounted cash flow valuation of a
  • 00:30: stock
  • 00:32: so getting into the free cash flows
  • 00:37: so we have already gone through
  • 00:40: basically one half of the dcf model
  • 00:45: where we
  • 00:48: got the weighted average cost of capital
  • 00:50: how much does the company have to pay in
  • 00:52: order to raise money for their
  • 00:54: operations
  • 00:55: so the other half of the dcf model is
  • 00:58: focused on the free cash flows
  • 01:00: so that ultimately we can take the
  • 01:02: present value of
  • 01:03: future free cash flows in order to
  • 01:06: determine the value of the business
  • 01:09: so within that free cash flow side of
  • 01:12: the dcf model
  • 01:14: we can even decompose it into two
  • 01:16: further parts
  • 01:18: and that is first finding the historical
  • 01:22: free cash flows so you have the
  • 01:25: historical financial statements income
  • 01:28: statement balance sheet perhaps
  • 01:29: statement of cash flows
  • 01:31: and you calculate the free cash flows
  • 01:35: from those financial statements and this
  • 01:38: part
  • 01:38: is fairly straightforward uh you're just
  • 01:41: kind of
  • 01:42: going through the formulas in order to
  • 01:44: calculate these things
  • 01:46: there's no real uh decision making to be
  • 01:49: done in the matter no kind of
  • 01:50: qualitative analysis you just do the
  • 01:53: calculations
  • 01:55: the other part which is more
  • 01:59: complicated and difficult is to
  • 02:02: project the free cash flows into the
  • 02:05: future
  • 02:06: remember that when considering the value
  • 02:08: of an asset
  • 02:09: we only consider future cash flows which
  • 02:12: are going to be paid we don't care
  • 02:14: about the historical so uh we calculate
  • 02:18: the historical
  • 02:19: just in that it will help us project the
  • 02:22: future
  • 02:22: but the future is what we really care
  • 02:24: about for the valuation
  • 02:28: so there's a lot of decisions to be made
  • 02:32: in how you forecast the future
  • 02:36: free cash flows and we'll talk about a
  • 02:39: variety of different approaches
  • 02:40: and the conditions under which you would
  • 02:44: might want to use some of these
  • 02:45: different approaches
  • 02:47: and we'll get into all of that within
  • 02:49: the forecasting material
  • 02:51: within this lecture
  • 02:55: but before we get there let me just
  • 02:58: give a quick introduction on free cash
  • 03:02: flows themselves
  • 03:04: so what are free cash flows and why do
  • 03:06: we care about them
  • 03:08: so free cash flows we can think of as
  • 03:12: the cash that the company is getting
  • 03:15: from their operations
  • 03:17: they have some revenue come in they have
  • 03:19: to pay
  • 03:20: for expenses salaries cost of goods sold
  • 03:24: the inventory
  • 03:26: etc and then they end up with some
  • 03:29: amount of cash
  • 03:30: left over after paying for all those
  • 03:32: operations
  • 03:34: so that would be the free cash flows
  • 03:39: and so some people can get this confused
  • 03:43: with
  • 03:43: net income because they think well isn't
  • 03:46: that what net income is
  • 03:48: the cash that's left over after you paid
  • 03:50: for expenses
  • 03:52: um but these are a little bit different
  • 03:56: so net income is a measure that was
  • 03:59: developed
  • 04:00: by accountants which helps
  • 04:03: smooth out irregularities in
  • 04:07: uh the company's earnings um
  • 04:10: especially around expenses
  • 04:14: which represent investments in
  • 04:17: like fixed goods and things like that
  • 04:20: which uh are going to be used over
  • 04:22: a long time span so maybe the company
  • 04:25: purchase a new
  • 04:26: a new warehouse they're going to use
  • 04:29: that warehouse over the next
  • 04:30: 15 years or net income we would say
  • 04:35: just as an example there are different
  • 04:36: ways to account for it but
  • 04:39: 1 15 of the cost is going to accrue to
  • 04:42: each year
  • 04:42: in the net income try and say well let's
  • 04:45: let's match up
  • 04:47: the expense with the usage of the asset
  • 04:50: to
  • 04:50: kind of smooth out uh the earnings
  • 04:55: so in contrast uh free cash flows do not
  • 04:59: do any of this
  • 05:00: smoothing it's all about the actual cash
  • 05:04: which is trading hands uh you know
  • 05:07: electronic or physical cash um
  • 05:10: so if they purchase a building which
  • 05:13: they're going to use over 15 years
  • 05:16: with free cash flows all of that expense
  • 05:18: is coming in the year where they
  • 05:20: actually purchased
  • 05:21: the building so it's it's when was the
  • 05:24: cash actually spent
  • 05:26: not when is the asset going to be used
  • 05:32: um so why do we care
  • 05:35: about free cash flow over net income for
  • 05:38: valuation
  • 05:40: so free cash flow is what is actually
  • 05:43: going on with the cash
  • 05:44: and so that's what we want to consider
  • 05:47: for
  • 05:47: the valuation net income
  • 05:51: is still useful to think about in terms
  • 05:54: of thinking about what is kind of a
  • 05:55: typical
  • 05:57: amount that the company would earn in a
  • 05:58: given year um
  • 06:01: considering smoothing out costs across
  • 06:03: multiple years
  • 06:04: but when we're thinking about valuation
  • 06:07: we always want to use free cash flows
  • 06:09: because that's what
  • 06:10: actually happens um and we want to be
  • 06:13: using the truth for our valuation
  • 06:16: investors care about
  • 06:18: when they're going to get that cash the
  • 06:19: timing of it is important
  • 06:21: um and so we always use free cash flows
  • 06:26: for valuation and
  • 06:29: free cash flows um
  • 06:32: represent uh the
  • 06:36: earnings from the operations and then
  • 06:38: those free cash flows go to service
  • 06:41: both debt and equity holders
  • 06:44: so uh free cash flows are used
  • 06:48: to pay interest on the debt uh and
  • 06:51: they're also
  • 06:52: used to pay dividends or
  • 06:55: uh go into retained earnings and
  • 06:58: increase the value of equity that way
  • 07:01: um when we take the present value of
  • 07:04: free cash flows
  • 07:05: what we get is the enterprise value or
  • 07:07: the entire
  • 07:09: uh full asset value of the firm and then
  • 07:12: we can decompose that further into the
  • 07:14: debt value and equity value
  • 07:16: of the firm as we covered in the prior
  • 07:19: lecture series
  • 07:23: so thinking about calculating the
  • 07:26: historical
  • 07:27: free cash flows so there's a number of
  • 07:29: different approaches which are
  • 07:31: equivalent
  • 07:33: um we're going to
  • 07:34: [Music]
  • 07:36: go through a way in this course that
  • 07:39: only requires
  • 07:40: the income statement and balance sheet
  • 07:42: so that you don't even have to
  • 07:44: work with the statement of cash flows
  • 07:45: but certainly there are
  • 07:47: methods which use the statement of cash
  • 07:49: flows as well
  • 07:53: and so this is the basic formula
  • 07:56: shown here on the right and in the
  • 07:59: next video we'll go into a lot more
  • 08:01: detail
  • 08:02: on this um but basically we're just
  • 08:05: taking this formula and we're just going
  • 08:07: to calculate it
  • 08:08: for each year of historical data
  • 08:14: but it is kind of a multi-level
  • 08:16: calculation
  • 08:17: in that each of these three components
  • 08:20: which we are going to use to adjust the
  • 08:23: net income
  • 08:24: they each have to be calculated on their
  • 08:27: own
  • 08:27: before we can go and do the historical
  • 08:30: free cash flow calculation
  • 08:34: and the philosophy behind this formula
  • 08:37: is that we are taking this net income
  • 08:41: which accountants have adjusted and
  • 08:43: we're going to reverse the adjustments
  • 08:46: that they've made
  • 08:47: and also include what they've excluded
  • 08:50: as far as capital expenditures these
  • 08:54: large
  • 08:55: purchases which are being spread over
  • 08:57: multiple years
  • 08:59: um so by doing these adjustments we'll
  • 09:02: be able to get back
  • 09:03: to the actual cash coming from the
  • 09:05: operations
  • 09:06: the free cash flows
  • 09:10: and then thinking about the other side
  • 09:12: of
  • 09:13: free cash flows in the dcf model
  • 09:16: we need to forecast them into the future
  • 09:20: and this is definitely
  • 09:21: the more challenging part because the
  • 09:24: historical free cash flows are a very
  • 09:26: mechanical thing you just
  • 09:28: do the calculation and you're done
  • 09:32: but with forecasting there's a lot of
  • 09:35: decisions you have to make
  • 09:36: as the modeler
  • 09:40: and you want to use knowledge you have
  • 09:42: about the company in order to make those
  • 09:44: decisions
  • 09:47: so we can broadly break down
  • 09:50: at the highest level uh of how to
  • 09:53: forecast the free cash flows into two
  • 09:55: methods
  • 09:56: and that is forecasting free cash flows
  • 09:59: directly or forecasting the financial
  • 10:03: statements
  • 10:04: um and forecasting free cash flows you
  • 10:07: only have to forecast
  • 10:09: one thing and so it's very easy and
  • 10:11: quick to do
  • 10:12: but it's typically going to not be able
  • 10:15: to be as accurate
  • 10:16: uh unless this is a company that has
  • 10:18: very stable
  • 10:20: free cash flows but generally
  • 10:23: what you're going to want to do is
  • 10:24: forecast the financial statements
  • 10:27: because that gives you a much greater
  • 10:30: level of detail
  • 10:31: into the company's operations
  • 10:36: and then once you've decided on
  • 10:41: what you're going to forecast either the
  • 10:42: financial statements or the free cash
  • 10:44: flows
  • 10:45: then there are a lot of ways
  • 10:48: to go about that forecasting exercise
  • 10:52: um so generally
  • 10:55: generally we're going to look at time
  • 10:57: series methods in order to
  • 10:59: do the forecasts and we'll talk a lot
  • 11:02: more about
  • 11:03: what that means in the following videos
  • 11:06: but basically different models that we
  • 11:08: can use to
  • 11:10: predict the future from the past
  • 11:13: and then even aside from those models
  • 11:17: even after we've already decided what
  • 11:18: we're forecasting
  • 11:20: there's still another decision to make
  • 11:21: which is
  • 11:23: uh what what we're going to forecast
  • 11:26: within that item are we going to
  • 11:27: forecast
  • 11:28: the level of the item the growth of the
  • 11:30: item or are we going to peg it to
  • 11:32: another item and
  • 11:33: forecast the percentage so we'll dig
  • 11:36: into all these different decisions
  • 11:40: and the considerations you want to make
  • 11:42: in those decisions
  • 11:44: and uh how you would actually
  • 11:47: go through each one of these approaches
  • 11:49: and calculate them
  • 11:52: so all that come in this lecture series
  • 11:56: and the last part of the lecture series
  • 11:58: will also look at
  • 11:59: how to finish up the dcf model
  • 12:02: with everything else that we've learned
  • 12:05: from the prior lecture series
  • 12:08: so thanks for listening and see you next
  • 12:13: time

Introduction to Calculating Historical Free Cash Flows


Notes

  • There are multiple sets of equations that can be used to calculate free cash flows

  • Here we will focus on a set of equations that does not require the statement of cash flows, only the income statement and the balance sheet

  • I usually recommend this approach because then only the income statement and balance sheet need to be forecasted rather than all three financial statements

  • The philosophy of this approach is that we are starting with net income, undoing the adjustments which have accountants have done, and adding our own adjustments for cash items which are not included in net income to get back to FCFs

  • Net working capital is not counted in net income, but can be a source or use of cash so it should be included

  • Capital expenditures are usually spread across the usage of the asset in net income, but here we are adjusting it so the cost is realized in the period of the purchase

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick durabartis teaching
  • 00:05: financial modeling
  • 00:06: today we're going to be doing an
  • 00:08: introduction on how to calculate
  • 00:10: historical
  • 00:11: free cash flows this is part of our
  • 00:14: lecture segment
  • 00:15: on free cash flow estimation and
  • 00:17: forecasting
  • 00:19: which is part of our broader goal of
  • 00:22: building out the full discounted cash
  • 00:23: flow valuation of stock
  • 00:27: so when we think about historical free
  • 00:31: cash flows
  • 00:33: there are a number of different ways to
  • 00:35: calculate them
  • 00:36: uh several different formulas which
  • 00:39: use different parts of the financial
  • 00:41: statements
  • 00:43: what we're going to focus on here is
  • 00:45: this approach of
  • 00:46: basically taking that income and trying
  • 00:48: to adjust it
  • 00:50: back into free cash flows and the reason
  • 00:53: that i've
  • 00:54: chosen this approach in the course
  • 00:57: is because most of the other approaches
  • 01:00: require using the statement of cash
  • 01:03: flows
  • 01:04: this approach uses only the income
  • 01:06: statement and
  • 01:07: balance sheet and it definitely
  • 01:10: simplifies things in your model to only
  • 01:13: have to
  • 01:14: forecast two sets of financial
  • 01:16: statements rather than
  • 01:17: three so you can
  • 01:21: save some of the work in your model and
  • 01:23: get an equivalent result
  • 01:25: by going with this method now if you
  • 01:29: are just calculating historical free
  • 01:30: cash flows and you're not needing to
  • 01:32: project them in the future
  • 01:34: then using the statement of cash flows
  • 01:36: is usually easier
  • 01:38: there's fewer calculations to do but
  • 01:42: you don't need it to calculate the free
  • 01:44: cash flows and
  • 01:46: forecasting it is a good deal of effort
  • 01:49: so that's why we're going with this
  • 01:52: approach
  • 01:55: so as i mentioned in the introduction
  • 02:00: we are going to adjust the net income by
  • 02:03: these various components to get to the
  • 02:05: free cash flows
  • 02:06: but each of these components in another
  • 02:09: of themselves
  • 02:10: need to be calculated as well so let's
  • 02:12: look at the calculation
  • 02:14: of each of those items and then you
  • 02:16: basically just put them together to get
  • 02:18: the free cash flow
  • 02:21: so the first here is non-cash
  • 02:24: expenses and we're calculating non-cash
  • 02:28: expenses because
  • 02:31: net income is this measure which
  • 02:32: accountants have smoothed out
  • 02:35: and they want to include expenses even
  • 02:38: if they weren't
  • 02:39: made in cash this year because they're
  • 02:42: trying to smooth things out over
  • 02:44: multiple years
  • 02:48: but for free cash flows we
  • 02:51: don't want to consider that we want to
  • 02:53: reverse this adjustment that
  • 02:54: the accountants have made to net income
  • 02:57: so we can get back to what cash
  • 02:59: actually changed hands
  • 03:02: so looking here at the non-cash expenses
  • 03:05: we have a few different
  • 03:07: categories within that that we have to
  • 03:09: add up to
  • 03:10: get the total so we have
  • 03:14: uh depreciation and amortization
  • 03:17: that is representing uh basically when
  • 03:20: you buy a fixed asset
  • 03:23: say that a company just
  • 03:26: just bought a jet in order to
  • 03:31: ship things across countries
  • 03:34: and they are going to use this jet
  • 03:38: over the next 10 years
  • 03:41: so with depreciation and amortization we
  • 03:44: would basically say
  • 03:46: one tenth of that cost or there are
  • 03:48: other uh schedules but
  • 03:50: we can think of it as just you know one
  • 03:52: tenth of that cost
  • 03:53: per year over each of the ten years when
  • 03:56: going into net income and that's what
  • 03:58: the depreciation is is saying well let's
  • 04:01: count
  • 04:01: a little bit of that expense each year
  • 04:03: over the time that we're going to be
  • 04:04: using the asset
  • 04:06: that's not cash changing hands the cash
  • 04:08: only changed hands at the beginning
  • 04:11: when we bought the jet um and so we'll
  • 04:14: get to that
  • 04:15: jet purchase itself uh once we get to
  • 04:18: capex
  • 04:19: a little bit later uh but we've gotta
  • 04:22: adjust back this portion that's being
  • 04:25: taken out every year
  • 04:27: for something which was not purchased in
  • 04:29: this year
  • 04:30: so that's depreciation amortization we
  • 04:33: will reverse that
  • 04:34: in the calculation by adding in here
  • 04:38: then coming to stock-based compensation
  • 04:41: so that means that employees were
  • 04:44: compensated but they were compensated
  • 04:46: via stock instead of via cash
  • 04:50: um and so it is an expense for the
  • 04:52: company and it is
  • 04:54: valid to include that in net income and
  • 04:56: thinking about
  • 04:57: how much basically did they actually
  • 04:59: earn kind of on average
  • 05:01: but it wasn't a cash expense and so in
  • 05:04: order to get back to the actual cash
  • 05:05: that changed hands
  • 05:07: we need to add back in that stock based
  • 05:10: compensation that wasn't a cash expense
  • 05:14: and then the last two components here
  • 05:16: impairment charges and gains losses on
  • 05:19: investments
  • 05:19: these are basically the same thing but
  • 05:22: impairment is talking about
  • 05:24: uh longer term assets and gains and
  • 05:28: losses on investments is more about
  • 05:29: shorter term uh assets but it's
  • 05:32: basically
  • 05:33: an asset that the company holds has
  • 05:36: changed in value
  • 05:37: while they've been holding it they
  • 05:39: didn't sell it they didn't buy it
  • 05:41: it just changed in value while they were
  • 05:43: holding it
  • 05:44: um and so accountants will go ahead
  • 05:47: and take that as a gain or a loss in
  • 05:50: calculating that income
  • 05:52: but again no cash changed hands there
  • 05:54: because they didn't actually sell
  • 05:56: the asset and so we're going to reverse
  • 05:58: that as well
  • 06:04: and then coming to the next component we
  • 06:05: have the change in networking capital
  • 06:09: so networking capital basically
  • 06:11: represents
  • 06:12: how much cash does it take um in order
  • 06:16: to
  • 06:17: uh sell your product produce and sell
  • 06:21: your product uh the cash which is just
  • 06:24: tied up
  • 06:25: in the daily um transactions of
  • 06:28: the company so it's not going as far as
  • 06:31: saying uh you know the salaries of
  • 06:34: everyone involved in producing the
  • 06:36: product is just
  • 06:37: uh how much cash is tied up in this kind
  • 06:39: of
  • 06:40: work in progress of creating and selling
  • 06:42: the products
  • 06:45: um so
  • 06:48: we are going to adjust
  • 06:51: uh the net income by the change in
  • 06:55: networking capital
  • 06:57: because um if now this year compared to
  • 07:03: last year
  • 07:04: we need to tie up an additional million
  • 07:06: dollars in
  • 07:07: the uh process of selling
  • 07:10: our goods then that represents a use of
  • 07:14: cash
  • 07:15: we have taken a million dollars and
  • 07:17: invested it into
  • 07:19: the production process and so we need to
  • 07:22: consider that
  • 07:22: in the free cash flows whereas on the
  • 07:26: flip side we
  • 07:27: are able to reduce the networking
  • 07:29: capital by a million dollars because we
  • 07:31: have
  • 07:31: now a more efficient inventory system
  • 07:34: then that represents a source of cash
  • 07:38: now that's money which has been freed up
  • 07:40: from the process and it's available
  • 07:42: to the investors the company or for the
  • 07:46: company to reinvest
  • 07:47: in other operations so any change
  • 07:50: in the networking capital is something
  • 07:52: that we need to consider
  • 07:54: and free cash flows
  • 07:58: and then uh going about calculating it
  • 08:02: so we need to calculate the networking
  • 08:05: capital in the first place
  • 08:06: um and then we can calculate the change
  • 08:10: in networking capital
  • 08:12: so you're going to need these three uh
  • 08:15: line items from the financial statements
  • 08:18: uh
  • 08:18: all from the balance sheet
  • 08:22: and you're going to need it for the
  • 08:24: prior year as well in order to calculate
  • 08:26: the
  • 08:27: change in networking capital so you'll
  • 08:29: never be able to calculate this in the
  • 08:30: first year for which you have data
  • 08:33: but you'll be able to calculate it every
  • 08:35: year thereafter or every period
  • 08:38: thereafter
  • 08:40: so um we
  • 08:43: had accounts receivable and inventory
  • 08:47: because these are uses of
  • 08:50: cash um because
  • 08:54: accounts receivable means that we have
  • 08:58: uh sold some items on credit so that's
  • 09:00: money we're waiting to receive for a
  • 09:02: product we've already sold
  • 09:05: so that is using up cash basically to
  • 09:08: have money tied up in this credit
  • 09:10: um and then inventory represents that
  • 09:13: we've we've paid to produce these goods
  • 09:15: but we haven't sold them yet and so
  • 09:16: that's cash tied up just sitting in
  • 09:18: inventory
  • 09:19: and then we subtract the accounts
  • 09:21: payable because that's money that
  • 09:24: we have not paid to other people that we
  • 09:26: do owe to them
  • 09:27: for um you know just general
  • 09:30: goods and services in the production
  • 09:33: process so that is a source of cash
  • 09:36: and that we don't have to pay for it
  • 09:39: right away
  • 09:40: and so the cash is not tied up there
  • 09:45: so we calculate the net working capital
  • 09:48: following this formula
  • 09:49: and then you just take this year's value
  • 09:51: minus last year's value
  • 09:53: in order to get the change in networking
  • 09:55: capital that will come
  • 09:56: into the free cash flow calculation
  • 10:01: then moving on to the last component
  • 10:05: capital expenditures
  • 10:07: so capital expenditures represent
  • 10:10: these fixed assets which are getting
  • 10:12: used over
  • 10:14: multiple periods so buildings and
  • 10:17: machinery are kind of the most common
  • 10:19: examples of capital expenditures um
  • 10:23: you know buying a warehouse buying a jet
  • 10:25: will be given as examples it doesn't
  • 10:27: have to be huge assets
  • 10:29: buying a computer even can be considered
  • 10:32: a fixed asset because you're going to
  • 10:33: use that computer
  • 10:35: over multiple uh periods fiscal periods
  • 10:38: so basically any asset
  • 10:42: which is purchased and used over a
  • 10:44: longer period of time
  • 10:47: can count in these capital expenditures
  • 10:52: so as i mentioned accountants basically
  • 10:55: spread this cost across multiple periods
  • 10:57: but when we think about free cash flows
  • 10:59: we care about when was it actually
  • 11:01: paid for um and so we want to bring
  • 11:04: those
  • 11:04: capital expenditures into the
  • 11:07: calculation of free cash flows
  • 11:11: so how do we calculate that well we look
  • 11:14: at this other balance sheet item
  • 11:17: the property plant and equipment which
  • 11:19: represents
  • 11:20: basically the total fixed assets
  • 11:24: in the company so when we look at the
  • 11:27: change
  • 11:28: of that property plant and equipment
  • 11:30: that is you know
  • 11:32: how many new fixed assets did they
  • 11:34: acquire this year
  • 11:36: um so that's the basis for estimating
  • 11:40: capex
  • 11:40: but then we also need to add
  • 11:44: the depreciation and amortization for
  • 11:46: this year as well
  • 11:48: because remember with the with the jet
  • 11:51: example spreading that over 10 years
  • 11:54: the accountant has already taken out the
  • 11:56: first one-tenth of the cost
  • 11:58: and accrued it to this year um so we
  • 12:01: can't just
  • 12:02: add then all 10 years of cost back in
  • 12:04: that would be 11 years of cost
  • 12:07: and so we need to add back in that
  • 12:09: depreciation
  • 12:11: as well they actually uh accountants
  • 12:14: will
  • 12:14: decrease the level of property plan
  • 12:17: equipment
  • 12:18: by the amount of the depreciation so we
  • 12:20: need to add it back to get to
  • 12:22: the full price there it would be only
  • 12:25: nine tenths of the cost would be showing
  • 12:28: on the
  • 12:29: balance sheet for the property plant
  • 12:31: equipment for that jet
  • 12:32: assuming straight line depreciation
  • 12:37: so those are the three components uh
  • 12:40: that we need to adjust the net income to
  • 12:42: reverse it
  • 12:43: into free cash flows uh so then
  • 12:47: in order to calculate the free cash
  • 12:48: flows you're just putting these items
  • 12:50: together
  • 12:51: so net income plus non-cash expenses
  • 12:54: minus the change in net working capital
  • 12:56: minus the capital expenditures uh and
  • 12:59: you're adding the non-cash expenses
  • 13:01: because we're
  • 13:02: reversing what was already taken out but
  • 13:04: shouldn't have been taken out
  • 13:06: for thinking about free cash flows
  • 13:09: and then we subtract the other two
  • 13:12: components because they represent uses
  • 13:14: of cash if you uh
  • 13:17: tie up more money in your production
  • 13:19: process that's the use of cash
  • 13:21: and if you purchase a fixed asset
  • 13:24: then that's also a use of cash and so we
  • 13:27: need to reduce
  • 13:28: the free cash flows
  • 13:31: so that's an introduction on calculating
  • 13:34: historical
  • 13:35: free cash flows we're going to uh
  • 13:38: come back next time in order to look at
  • 13:41: how we can
  • 13:42: calculate those in python
  • 13:45: so thanks for listening and see you next
  • 13:47: time

Historical Free Cash Flows in Python Using Pandas and finstmt


Notes

  • Most of the work in calculating historical free cash flows with Pandas is just getting the data loaded, cleaned up, and in the right structure

  • We use .loc in Pandas to look up a statement item when it is in the index and the columns are the dates

  • Be careful about the names of columns, they may have gotten loaded in with extra spaces or otherwise not exactly as you expected

  • Be sure to think about the sign on your item. Are costs represented as positive or negative in the statement?

  • I created the finstmt package to make all of these operations more convenient and repeatable, with the goal being that you should be able to quickly work with financial statements without all the cleanup operations, and you should be able to provide different statements and have the code work the same

  • I have continued to add useful features to finstmt such as calculating free cash flows and forecasting

  • It is easy to do lags and changes in the calculations with finstmt

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick dear burtis teaching you
  • 00:05: financial modeling
  • 00:06: today we're going to be talking about
  • 00:08: how to calculate free cash flows
  • 00:10: in python using pandas and fin statement
  • 00:14: this is part of our lecture series on
  • 00:16: free cash flow
  • 00:17: estimation and forecasting as part of a
  • 00:20: larger goal
  • 00:21: of building out the discounted cash flow
  • 00:24: valuation of a stock
  • 00:27: so we already gave an introduction
  • 00:30: to the free cash flow side of the model
  • 00:32: and
  • 00:33: how to calculate free cash flows
  • 00:36: historically
  • 00:37: uh in prior videos so take a look at
  • 00:40: those if you haven't already
  • 00:42: and now we're going to actually just
  • 00:44: jump right into the calculation
  • 00:46: in python so let's go over
  • 00:49: to the jupiter notebook
  • 00:54: so at first we'll look at just using
  • 00:57: pennis and then we'll look
  • 00:58: at an additional tool that i
  • 01:01: developed called fin statement that
  • 01:04: makes
  • 01:05: some of this process quite a bit easier
  • 01:08: but first focusing just on panic so we
  • 01:11: have
  • 01:12: some financial statements in an external
  • 01:15: excel file and we want to get them
  • 01:17: into python so the first thing i'm going
  • 01:20: to do is
  • 01:21: import pandas and just set the name of
  • 01:24: that file which has the financial
  • 01:27: statements
  • 01:28: and i'm going to read that in with
  • 01:31: parents's read excel method
  • 01:33: and then we can just do dot head on the
  • 01:35: resulting data frame to check out what
  • 01:37: we got
  • 01:39: now we can immediately see this is maybe
  • 01:42: not
  • 01:42: 100 percent what we expected to get uh
  • 01:46: it looks a little bit messy we have this
  • 01:48: unnamed thing
  • 01:50: we have these mans going on sometimes it
  • 01:53: snans sometimes it stashes
  • 01:57: so some cleanup is needed here in order
  • 02:00: to
  • 02:01: work with this one other thing
  • 02:04: is that these statement line items
  • 02:09: if we have them in the index we'll be
  • 02:11: able to look up
  • 02:12: uh the various line items but it's a
  • 02:15: little bit more difficult to do that
  • 02:17: when they're just in a column
  • 02:19: so we can
  • 02:22: um add this argument to the read excel
  • 02:25: method
  • 02:25: and index column equals zero
  • 02:28: and when we do that it's saying take the
  • 02:30: first column here
  • 02:31: and set that as the index and so that
  • 02:34: solves our unnamed
  • 02:35: issue because now that's the index it
  • 02:37: doesn't need a name
  • 02:38: and it solves this issue of these things
  • 02:41: should probably be in the index now they
  • 02:42: are
  • 02:46: so then next we have to deal with
  • 02:49: this nan versus dash issue
  • 02:54: nan is the representation for
  • 02:57: missing in pandas and dash
  • 03:01: were just some strings in the excel file
  • 03:04: that got loaded in
  • 03:05: where that's how the excel file is
  • 03:08: representing them as
  • 03:09: missing um but here they're coming in as
  • 03:13: the string dash
  • 03:16: so ultimately we want to clear out these
  • 03:18: empty rows
  • 03:19: and we want to make sure that when
  • 03:22: something is missing
  • 03:23: that we're actually getting it as
  • 03:24: missing and not as a string
  • 03:26: so what we can do is we want to replace
  • 03:30: uh this dash with
  • 03:34: the missing representation nam and you
  • 03:37: import uh once you import numpy then
  • 03:40: it's
  • 03:41: numpy dot nam that's
  • 03:44: the missing representation so we're just
  • 03:48: replacing everywhere in the data frame
  • 03:50: where there's the string dash with a
  • 03:52: missing
  • 03:53: and then we can see that what was a dash
  • 03:56: before now
  • 03:57: is the same nan not a number missing
  • 04:00: value so now that we
  • 04:03: have the missing values appropriately
  • 04:07: where they should be
  • 04:08: now we can go ahead and drop the missing
  • 04:11: values
  • 04:13: but we don't want to accidentally drop
  • 04:15: this this is
  • 04:16: important to keep this other revenue
  • 04:18: even though the others
  • 04:19: are not there and so
  • 04:23: we will pass to the drop n a method uh
  • 04:26: this how argument of how equals all
  • 04:30: saying that we only want to drop the row
  • 04:33: if every value in the row
  • 04:35: is missing so when we do that
  • 04:38: then we see that these totally blank
  • 04:41: rows that were there before
  • 04:43: are now gone but we're still left with
  • 04:45: the row that had some missings in it
  • 04:48: but at least one valid value
  • 04:52: so now this is looking quite a bit
  • 04:54: better than what we started with
  • 04:57: so we can go ahead and wrap these steps
  • 04:59: up into a function
  • 05:01: load and clean statement data frame
  • 05:05: give it the path of the statements and
  • 05:08: the name of the sheet and it does these
  • 05:11: three steps that we mentioned so then uh
  • 05:14: here i'm just starting in from scratch
  • 05:16: by using that function
  • 05:19: and we're loading in the income
  • 05:21: statement and now we can see it just
  • 05:23: looks like this
  • 05:24: already it was good to build out a
  • 05:27: function for this because we were going
  • 05:28: to have to do
  • 05:29: all the same things with the balance
  • 05:30: sheet um
  • 05:32: so now that just becomes a one-liner we
  • 05:35: can do the same thing with the balance
  • 05:36: sheet
  • 05:37: and that comes in nice and clean as well
  • 05:43: so that's the kind of initial loading
  • 05:47: process that you do with pandas and
  • 05:49: you'll need to do that
  • 05:50: regardless of whether you choose to do
  • 05:53: the actual
  • 05:54: uh free cash flow calculation with
  • 05:56: pandas or with fin statement
  • 05:59: but let's look at how we can do all this
  • 06:02: with just pandas first
  • 06:04: so as a reminder for what we're doing
  • 06:07: we're calculating these three
  • 06:08: adjustments to net income
  • 06:10: non-cash expenses increase in working
  • 06:12: capital and capital expenditures
  • 06:15: uh all explained in the prior videos um
  • 06:18: and then we're going to calculate the
  • 06:20: free cash flow from the net income and
  • 06:22: these items
  • 06:26: so um we
  • 06:29: are going to need to work with these
  • 06:30: statement items so let's look at
  • 06:32: everything that we've got we can do dot
  • 06:34: index
  • 06:34: to see everything that's in that index
  • 06:37: and you can see
  • 06:38: all the different items that we have
  • 06:40: here
  • 06:43: and then in order to look up a given
  • 06:45: item we can
  • 06:47: use dot look and then pass it the string
  • 06:51: of the index value in order to get that
  • 06:54: entire row
  • 06:55: of the data frame
  • 06:58: so we can get this asset write down
  • 07:02: expense by doing dot loc with asset
  • 07:06: write down and we can see it gets us
  • 07:08: each year
  • 07:09: of the expense as a panda series
  • 07:15: so um
  • 07:19: one other thing we have to consider is
  • 07:22: we've said in our calculation that uh
  • 07:25: we're going to
  • 07:26: add this but it's coming as a negative
  • 07:29: number here um so we need to think about
  • 07:33: basically the costs on the
  • 07:36: income statement are they being
  • 07:37: represented as negative or positive
  • 07:39: numbers different financial statements
  • 07:41: will show it differently
  • 07:43: um because you can say well it's a
  • 07:46: positive cost so it subtracts or you
  • 07:48: could say
  • 07:48: well the cost is subtracting and so it's
  • 07:50: negative
  • 07:52: um so you'll need to pay attention to
  • 07:54: that
  • 07:55: and handle that as you
  • 07:58: work with the line items so we want this
  • 08:01: to be a positive cost
  • 08:03: and so we're going to take the absolute
  • 08:04: value with
  • 08:06: the built-in ads function
  • 08:10: um so we're trying to calculate this
  • 08:14: non-cash uh expenses so we'll also need
  • 08:18: the depreciation
  • 08:20: so we can grab that and since we can do
  • 08:22: math directly with series
  • 08:24: we can just add these two things
  • 08:26: together
  • 08:28: and now we can see that we have
  • 08:31: these values added together
  • 08:32: appropriately
  • 08:34: but we'll notice that something strange
  • 08:36: here happened with the first two years
  • 08:38: even though we had depreciation numbers
  • 08:40: for that year
  • 08:41: we're now getting missing and that's
  • 08:43: because the numbers were missing
  • 08:45: in this uh other series of the
  • 08:48: impairment or asset write down
  • 08:50: so um whenever you uh do math with a
  • 08:54: missing number
  • 08:55: it's going to cause the k the whole
  • 08:57: calculation to become missing
  • 08:59: but really in this case uh it wasn't
  • 09:02: missing it should have been zero
  • 09:04: for these there just was no expense and
  • 09:06: so it ended up is missing
  • 09:08: but really it's zero
  • 09:11: so what we can do is fill in all those
  • 09:15: missing values
  • 09:16: in the data frames with a zero so that's
  • 09:19: what this
  • 09:19: fill and a is doing we're going to put a
  • 09:21: zero in for everywhere that had
  • 09:24: a missing number and then when we look
  • 09:26: again
  • 09:27: at this impairment charge we now see
  • 09:29: zeros coming there
  • 09:31: and that allows the calculation to go
  • 09:33: through as expected
  • 09:36: so then we can go ahead and do the full
  • 09:38: calculation
  • 09:39: of these four different line items
  • 09:44: and then we get our non-cash expenses
  • 09:47: here as a series
  • 09:51: next we go to calculating uh the change
  • 09:54: in working capital
  • 09:56: um so we need to pull the appropriate
  • 09:59: items so let's look at our index again
  • 10:02: we're gonna need to use uh accounts
  • 10:04: receivable
  • 10:05: uh inventory and accounts payable so
  • 10:09: we just put those things together and
  • 10:12: we get these uh connected together but
  • 10:15: now
  • 10:16: this is the current networking capital
  • 10:18: we need to calculate the change
  • 10:20: in networking capital so there is a way
  • 10:23: to do this
  • 10:24: uh change uh kind of concept and panzer
  • 10:27: and pandas
  • 10:29: if we use the dot shift
  • 10:32: method that allows us to move
  • 10:36: the the series values
  • 10:40: up or down by a certain number
  • 10:44: so here shift one is going to
  • 10:47: move all the values forward by
  • 10:51: one period um so that
  • 10:54: um when we look at the 2015 value what
  • 10:57: we have
  • 10:58: uh in the shifted is actually the 2014
  • 11:02: value um so that's what we want to
  • 11:05: calculate the change
  • 11:06: we want to do the original minus the
  • 11:09: shifted by one period
  • 11:11: and then of course we can't get the
  • 11:13: first period because we have no prior
  • 11:15: period
  • 11:16: but then looking at the second we're
  • 11:18: getting 1481 which appears to be
  • 11:21: uh the change between 15 and
  • 11:25: uh or yeah between 14 and
  • 11:28: 15 so that looks like it's
  • 11:32: working appropriately
  • 11:37: then we need to calculate capital
  • 11:39: expenditures
  • 11:41: and you'll notice
  • 11:44: back when we look at this index that
  • 11:47: that property plant equipment
  • 11:48: came with a space on the beginning
  • 11:52: so unfortunately we do need to include
  • 11:54: that space unless we go and change
  • 11:56: the name of the column when we do it
  • 11:58: like that we're able to look it up
  • 12:00: but if we did it without the space we
  • 12:02: would get an
  • 12:03: error so you do need to be careful about
  • 12:06: your column names
  • 12:07: and they're not always going to be
  • 12:09: loaded in perfectly cleanly
  • 12:11: when you just pull in an excel sheet um
  • 12:15: so you may want to just rename the items
  • 12:20: or you can just work with them as is
  • 12:22: with
  • 12:23: the additional spacing or whatever else
  • 12:25: is coming in
  • 12:28: anyway we uh get our net ppe here
  • 12:31: without loc and then we want to
  • 12:37: get the change in that uh similarly to
  • 12:39: what we did
  • 12:41: for the networking capital
  • 12:45: and then to the change we add the
  • 12:47: current appreciation
  • 12:48: and amortization so here now
  • 12:52: we have the capital expenditures
  • 12:55: so then we just put all that together
  • 12:57: into the free cash flows
  • 12:59: um take the net income add the dot cash
  • 13:02: expenses subtract the change in net
  • 13:04: working capital and subtract the capex
  • 13:07: and there we are left with the free cash
  • 13:09: flows
  • 13:11: and of course we can't get them for the
  • 13:13: first year because we had no prior year
  • 13:16: for the changed items
  • 13:20: so then we can look
  • 13:24: at perhaps an easier way to go about
  • 13:26: this uh
  • 13:27: using the fan statement package so
  • 13:30: uh i actually created this package
  • 13:33: because i felt like this process that we
  • 13:36: just went through is a little bit
  • 13:38: arduous or something that should be
  • 13:41: pretty simple
  • 13:42: and that lots of people need to do
  • 13:47: and there were a number of things about
  • 13:49: this that make it
  • 13:50: difficult to repeat um
  • 13:54: and make it make the code just you know
  • 13:56: very tied to these specific financial
  • 13:58: statements
  • 14:00: rather than working for any given
  • 14:02: statements that you would want to work
  • 14:03: with
  • 14:04: um you're going to have different
  • 14:08: names in the financial statements from
  • 14:10: different data providers so you'd have
  • 14:11: to go back and switch out these names
  • 14:14: and we're getting extra spaces and stuff
  • 14:16: in there that would also be affected by
  • 14:18: where you're getting the
  • 14:19: statements from um and then
  • 14:22: we have this negative versus positive
  • 14:24: for cost issue
  • 14:26: um sometimes you might need to be taking
  • 14:27: the absolute value other times not
  • 14:30: um and it's
  • 14:33: you know the dot loc thing is a little
  • 14:35: bit annoying
  • 14:37: in order to look up items getting the
  • 14:40: change
  • 14:40: is also a little bit annoying it's not
  • 14:43: too bad but
  • 14:44: a little bit verbose
  • 14:47: and we also need to think about well is
  • 14:49: this item on the income statement is it
  • 14:51: on a balance sheet
  • 14:52: um and then find it and work with it
  • 14:57: we had to remember about this
  • 15:00: cleanup with the zeros filling in the
  • 15:03: zeros
  • 15:05: and of course we had to go through all
  • 15:07: these manual steps ourselves to
  • 15:08: calculate the free cash flow
  • 15:11: people calculate free cash flow all the
  • 15:12: time shouldn't uh
  • 15:14: there just be a simple way to do that
  • 15:17: so i created this fence statement
  • 15:19: package to solve all these kinds of
  • 15:21: issues
  • 15:22: um and the reason i think
  • 15:26: something like this was not out there
  • 15:27: already is most of
  • 15:29: the um python finance code which is out
  • 15:33: there
  • 15:33: just exists within uh
  • 15:37: large banks for the most part and so
  • 15:39: it's closed source they're not sharing
  • 15:40: it with anybody
  • 15:42: but i wanted to make this analysis
  • 15:45: easier for everyone and so i have open
  • 15:47: sourced
  • 15:48: all this code
  • 15:52: so you're going to need to install the
  • 15:55: pen statement package
  • 15:56: it does not come in anaconda because i
  • 15:59: only recently created it
  • 16:02: so you're going to need to do the
  • 16:04: install
  • 16:06: and we've covered installing packages
  • 16:08: and prior videos
  • 16:12: and since i already have it installed i
  • 16:13: can just go ahead and import it
  • 16:17: and for now the conventional import is
  • 16:20: to
  • 16:22: import the income statement balance
  • 16:24: sheet and financial statements
  • 16:25: from pin statement as of now it supports
  • 16:29: the income statement and balance sheet
  • 16:32: so we're going to use that same method
  • 16:34: we had from before because
  • 16:36: it is expecting to receive kind of this
  • 16:38: cleaned up structure
  • 16:40: you pass it data frames in order to
  • 16:43: create
  • 16:43: statements and it expects that your
  • 16:47: line items are in the index and that you
  • 16:49: have dates as the columns
  • 16:52: which is the structure that we set up in
  • 16:54: the beginning of the video
  • 16:56: so then you know we have those data
  • 16:59: frames
  • 17:00: which are ready to go
  • 17:04: and we can load in the
  • 17:07: financial statement uh income statement
  • 17:10: class
  • 17:10: from that income data frame so we run
  • 17:13: that and we do see some
  • 17:15: output here which is just it
  • 17:18: mentions the items which it saw in the
  • 17:20: data frame which it was not able to
  • 17:22: assign to a statement item um
  • 17:26: so most of this stuff is just are things
  • 17:29: that you don't really need
  • 17:31: and that's why they're showing up here
  • 17:34: so what does this look like when we
  • 17:36: examine the data
  • 17:38: um you'll notice a few things about this
  • 17:41: versus
  • 17:43: the data frame that we were just working
  • 17:45: with one is that
  • 17:46: it kind of just has the core items
  • 17:49: displayed here
  • 17:50: not all these extra things the dates
  • 17:53: have been
  • 17:54: reformatted and you'll notice that we
  • 17:57: have the dollar formatting with commas
  • 17:59: automatically everywhere
  • 18:01: and that we have dashes now to represent
  • 18:05: the
  • 18:06: zero or missing values
  • 18:10: um so
  • 18:14: um and then
  • 18:17: we can use tab completion on that
  • 18:21: income statement data to be able to pull
  • 18:25: uh whatever item that we want out of
  • 18:28: the income statement so you can see all
  • 18:32: these different options here
  • 18:34: and then let's just think about getting
  • 18:37: the revenue
  • 18:38: all we do is is dot revenue and
  • 18:41: we get the revenue series so just like
  • 18:43: what we had to do
  • 18:44: look for and pass it the specific name
  • 18:46: however it's coming
  • 18:47: in the original data now we just do dot
  • 18:50: revenue regardless of
  • 18:52: how the original name was and the
  • 18:54: original data
  • 18:58: um and then we can pull uh
  • 19:01: periods out at the financial statements
  • 19:04: so here i'm just pulling the
  • 19:06: 2014 period and we just get that
  • 19:10: you can also pull out multiple periods
  • 19:12: um
  • 19:13: by giving a list of the periods that you
  • 19:15: want
  • 19:17: and you'll notice also that
  • 19:20: these don't exactly match up in terms of
  • 19:22: date format right this is with
  • 19:24: dashes with the year first
  • 19:27: this slashes with your last but
  • 19:30: the package is smart enough to
  • 19:32: understand that you're talking about the
  • 19:33: same date
  • 19:34: and grab the correct periods
  • 19:39: um so we can go ahead and create the
  • 19:43: balance sheet
  • 19:45: as well so we see a similar message
  • 19:48: coming up there about
  • 19:49: you know things it wasn't able to
  • 19:50: extract because a lot of them weren't
  • 19:52: actually even balance sheet items
  • 19:56: and we can look at the data there as
  • 19:58: well
  • 20:00: so seeing similar things in terms of the
  • 20:02: structure
  • 20:03: compared to the income statement
  • 20:07: um so there's even one
  • 20:10: even more high level ways to work with
  • 20:13: package and that is
  • 20:14: you can create a financial statements
  • 20:16: class
  • 20:17: out of both the income statement
  • 20:21: and balance sheet so we create that
  • 20:23: statements class
  • 20:25: um and then what that
  • 20:29: allows us to do is work with the whole
  • 20:31: statements at once so if we just look at
  • 20:33: statements
  • 20:34: we'll see we get this header of the
  • 20:35: income statement it shows the income
  • 20:37: statement
  • 20:38: and then we'll get this header of the
  • 20:39: balance sheet and it shows the balance
  • 20:41: sheet
  • 20:42: so we can see everything
  • 20:45: and then we have this same thing where
  • 20:48: we can do the
  • 20:49: tab completion but now it works across
  • 20:52: both the income statement and the
  • 20:54: balance sheet
  • 20:55: so we have all those possible items
  • 20:57: there
  • 20:59: uh we can get the cash from the balance
  • 21:01: sheet we can get the cost to get sold
  • 21:03: from the income statement
  • 21:04: and we don't have to think about where
  • 21:06: that item actually comes from
  • 21:09: um and we can do the same kind of
  • 21:12: date access
  • 21:15: as we can with the individual statements
  • 21:19: um and this can be useful in order to
  • 21:23: you know pull certain items for
  • 21:24: different time ranges
  • 21:26: here i'm just getting the total equity
  • 21:28: for 14
  • 21:30: and 15.
  • 21:33: so then getting into uh calculating the
  • 21:36: free cash flows
  • 21:37: well there is a dot fcf and that gets
  • 21:40: you the free cash flows so you're done
  • 21:43: we didn't have to calculate all those
  • 21:44: separate items and put them together
  • 21:46: just fcf and you have the free cash
  • 21:48: flows so
  • 21:50: nice and straightforward but just to
  • 21:53: show
  • 21:54: some of the other convenient
  • 21:57: methods that have uh been added to the
  • 21:59: library to work with statement data
  • 22:01: let's look at how we would go and
  • 22:03: calculate those free cash flows
  • 22:05: uh manually using fin statement
  • 22:09: so we take the nat ppe
  • 22:12: um and we have this
  • 22:16: uh lag method um which
  • 22:19: is able to do um the same thing as shift
  • 22:23: and pandas
  • 22:27: so we're going to lag it by one period
  • 22:30: and
  • 22:31: then we also have this change method
  • 22:35: so the change is already doing just the
  • 22:37: original minus the
  • 22:39: lagged by one period but it's just a
  • 22:40: more convenient way
  • 22:42: to get to the change because the change
  • 22:44: is often what we're concerned about
  • 22:45: getting
  • 22:47: so in order to calculate the free cash
  • 22:50: flows
  • 22:50: uh all these these uh parks are
  • 22:55: calculated for you as well like the
  • 22:57: networking
  • 22:59: capital is already there the capex is
  • 23:02: already there
  • 23:03: the non-cash expenses is already there
  • 23:06: and so you can just uh you know directly
  • 23:10: go and add up those items
  • 23:11: and use the change on the networking
  • 23:13: capital
  • 23:15: so definitely simplifies this process
  • 23:18: quite a bit
  • 23:19: and then the same exact code is going to
  • 23:21: work no matter which
  • 23:23: financial statements you're working with
  • 23:28: and some other things i want to mention
  • 23:31: about using the package
  • 23:33: so i've gotten this working with uh
  • 23:36: stock row and capital iq financial
  • 23:38: statements
  • 23:39: i think it will work for a lot of others
  • 23:41: as well
  • 23:43: um but if you load in your financial
  • 23:46: statements
  • 23:47: and something goes wrong just send them
  • 23:49: to me and i'll make sure that they get
  • 23:51: incorporated into the package as well
  • 23:56: and there is basically a configuration
  • 23:58: system within fin statement
  • 24:01: which allows you to extend it to be able
  • 24:03: to work with any custom
  • 24:05: statements that you want to work with
  • 24:07: but i'm still working on
  • 24:08: filling out the documentation on all
  • 24:10: that so if you are interested
  • 24:13: in customizing how this works at all
  • 24:16: just reach out and i'll give you some
  • 24:19: guidance there
  • 24:22: so uh and also if you see any other
  • 24:24: issues with the library
  • 24:26: or things are not working as you would
  • 24:27: expect
  • 24:29: also just reach out and i would be happy
  • 24:31: to
  • 24:32: look into whatever issues that you have
  • 24:36: so that's an overview on how to
  • 24:39: calculate
  • 24:39: historical free cash flows in python
  • 24:42: using both pandas
  • 24:44: and fin statement so thanks for
  • 24:45: listening and see you next time

Historical Free Cash Flows Lab Exercise Overview


Notes

  • The first exercise is just about going through the math of the FCF calculation

  • The second exercise requires you to work with actual financial statements to do the calculations, similar to the example

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick dear vertis teaching you
  • 00:05: financial modeling today
  • 00:07: i'm going to be introducing the lab
  • 00:09: exercise on
  • 00:10: calculating historical free cash flows
  • 00:13: this is part of our lecture segment on
  • 00:15: free cash flow estimation
  • 00:16: and forecasting as part of our larger
  • 00:19: objective
  • 00:20: of building out the full discounted cash
  • 00:22: flow evaluation of a stock
  • 00:26: so we just wrapped up the historical
  • 00:29: free cash flows material
  • 00:31: i'm going through an introduction on it
  • 00:33: as well as
  • 00:34: showing how to calculate it in python
  • 00:37: and now we come to
  • 00:38: the lab exercise which tests knowledge
  • 00:41: of that material
  • 00:42: so it's two exercises um and the first
  • 00:46: one here
  • 00:47: uh i just directly gave you the numbers
  • 00:49: to use
  • 00:50: to calculate the free cash flows so it's
  • 00:53: kind of
  • 00:54: just about being able to uh go through
  • 00:57: that
  • 00:57: formula to calculate the free cash flows
  • 01:01: um so you can get used to
  • 01:04: uh the components that are involved and
  • 01:06: how you put them together
  • 01:08: and then level two is a little more
  • 01:10: realistic
  • 01:11: exercise of you have to actually load in
  • 01:15: um income statement and balance sheet
  • 01:17: data
  • 01:18: and calculate the free cash flows using
  • 01:21: those data directly um and you'll want
  • 01:24: to calculate two different periods
  • 01:26: of the free cash flows
  • 01:30: um so this is going to be quite simple
  • 01:32: uh
  • 01:33: or sorry quite similar to the
  • 01:36: example that we went through in python
  • 01:39: and you can feel free to
  • 01:41: use whatever tools um excel
  • 01:44: python or within python you can use just
  • 01:47: panos or you can use find statement
  • 01:51: however you want to go and calculate the
  • 01:54: free cash flows
  • 01:56: so that's the lab exercise for the
  • 01:59: historical
  • 01:59: free cash flows thanks for listening and
  • 02:02: see you next time

Introduction to Forecasting


Notes

  • I could teach an entire course on forecasting. There is far too much material to cover in the time allowed

  • There is so much complexity as there are multiple options on two dimensions: what to forecast and which model to use

  • We will focus on only a few possible models in this course to keep things simple

  • It is up to the modeler which models to use and what to forecast. It should generally be guided by knowledge of the company as well as understanding of the structure of financial statements

  • The simple time-series models are easy to understand, but the advanced models quickly get into a confusing alphabet soup and are outside the scope of this course

  • You could also use machine learning models for forecasting

  • Regardless of the chosen model, the steps to forecasting are the same. So once you learn the steps in this course, you will be able to learn the more advanced models on your own and apply them in the same framework

Transcript

  • 00:02: hey everyone this is nick diabetis
  • 00:04: teaching you financial modeling
  • 00:05: today we're going to be doing an
  • 00:07: introduction on
  • 00:08: forecasting this is part of our lecture
  • 00:11: segment
  • 00:12: on free cash flow estimation and
  • 00:14: forecasting
  • 00:16: which is part of a broader goal in the
  • 00:17: course of building out the full
  • 00:19: discounted cash flow valuation of a
  • 00:22: stock
  • 00:25: so we already covered uh the historical
  • 00:28: free cash flow
  • 00:29: part of all this so go back to the prior
  • 00:32: videos
  • 00:33: to see that and now we're just getting
  • 00:35: into
  • 00:36: thinking about well we need to think
  • 00:39: know about the future
  • 00:41: free cash flows in order to take the
  • 00:44: present value and get the value of the
  • 00:46: company
  • 00:47: and so that brings us into this whole
  • 00:50: area
  • 00:50: of forecasting
  • 00:53: um so forecasting uh
  • 00:57: is a fairly complicated topic there is a
  • 01:01: lot involved
  • 01:02: i could really teach an entire course
  • 01:04: just on forecasting we're really just
  • 01:06: going to look at a very high level
  • 01:08: overview
  • 01:09: on it in general um
  • 01:12: and it gets quite complicated once you
  • 01:15: get into
  • 01:16: the details uh you know it's a whole
  • 01:20: branch of econometrics to work on these
  • 01:23: time series models used for
  • 01:25: forecasting people make a living off of
  • 01:28: researching these things
  • 01:31: people have full-time jobs working on
  • 01:33: forecasting
  • 01:35: so it's definitely a full topic to
  • 01:38: discuss
  • 01:39: but we're just going to kind of you know
  • 01:42: briefly look through it and
  • 01:44: take the most high level things that we
  • 01:45: need to know about it just to be able to
  • 01:47: do
  • 01:48: our own simple forecasts
  • 01:52: so um as we talked about earlier in the
  • 01:55: introduction
  • 01:56: on this lecture series um
  • 02:00: we are going to be forecasting uh either
  • 02:02: the free cash flows or the financial
  • 02:04: statement line items
  • 02:06: and in order to forecast those we're
  • 02:08: going to use time series methods
  • 02:11: uh which are methods of predicting the
  • 02:13: future from the past
  • 02:15: and we're going to use those on one of
  • 02:17: possible one of a few possible targets
  • 02:19: either the levels of the item
  • 02:21: the growth of the item or
  • 02:24: the percentage that this item is of
  • 02:26: another item
  • 02:27: which is already forecasted
  • 02:31: so these time series methods is any
  • 02:34: method
  • 02:35: which we can use to
  • 02:38: predict the future from the past
  • 02:41: so we'll look at a number of
  • 02:44: simple models such as the average
  • 02:46: approach the recent value approach
  • 02:49: uh linear trend and compounded annual
  • 02:52: growth rates
  • 02:54: um and we'll also get into some more
  • 02:57: complex models
  • 02:58: which can be used for
  • 03:01: more complex time series such as a
  • 03:04: quarterly
  • 03:05: seasonal trend model and looking at
  • 03:09: more advanced models as well
  • 03:14: and thinking about this levels versus
  • 03:17: growth versus
  • 03:18: percentage of so what we're talking
  • 03:20: about there
  • 03:21: is levels means you're forecasting the
  • 03:24: value itself so sales was
  • 03:27: a million and then it's 1.5 million we
  • 03:30: might predict
  • 03:31: using a linear trend that is going to be
  • 03:33: 2 million
  • 03:34: for next year so we're using that
  • 03:36: million and that 1.5 million
  • 03:38: directly in our forecast to generate the
  • 03:41: forecast
  • 03:41: of 2 million so the the original
  • 03:45: values of whatever item are what we are
  • 03:47: feeding into the forecast model
  • 03:52: then looking at the growth means that we
  • 03:55: first calculate the growth rates
  • 03:57: on the item um so say sale grew ten
  • 04:00: percent then it grew eight percent
  • 04:02: and we're feeding those growth rates
  • 04:03: into the forecast model
  • 04:05: so we might predict again based off a
  • 04:07: linear trend that the next year's growth
  • 04:09: is going to be six percent
  • 04:11: uh and then we apply that six percent to
  • 04:14: the prior sales level value in order to
  • 04:17: get
  • 04:18: uh our forecasted sales
  • 04:23: and the last target that we're talking
  • 04:24: about is the percentage of another item
  • 04:28: so that means you have some other item
  • 04:30: which is already forecasted so say that
  • 04:32: we already have sales forecasted
  • 04:34: and now we're trying to forecast the
  • 04:36: cost of goods sold
  • 04:38: well we could say that you know
  • 04:39: historically cost of goods sold has been
  • 04:41: about
  • 04:42: 60 of sales uh and so now
  • 04:45: let's forecast the percentage of sales
  • 04:48: which cost of goods as a percentage of
  • 04:50: sales rather than the level or growth
  • 04:53: of cost of goods sold so then we
  • 04:57: forecast that it will also be 60 in the
  • 05:00: future
  • 05:00: and then we just multiply that 60 by the
  • 05:03: forecasted sales
  • 05:04: to get our estimate of the cost of goods
  • 05:08: sold and
  • 05:11: with all of these different forecast
  • 05:13: targets with any time
  • 05:14: series method that you're going to use
  • 05:17: you can still adjust uh the forecast
  • 05:21: afterwards you can say well you know
  • 05:24: here's kind of the baseline from the
  • 05:25: model
  • 05:26: but because of you know this new project
  • 05:29: that the company is going to start or
  • 05:32: uh this additional risk factor which has
  • 05:35: become more of an issue
  • 05:38: lately or whatever your analysis
  • 05:42: of the company's operations uh is you
  • 05:44: can incorporate that into your
  • 05:46: projections and say no i actually need
  • 05:47: to adjust
  • 05:49: some of these periods uh because of this
  • 05:52: additional information i have which is
  • 05:54: not reflected
  • 05:55: in the historical financials
  • 05:59: and you can also use this kind of
  • 06:01: qualitative information to actually pick
  • 06:05: which forecast method and target you're
  • 06:07: going to use
  • 06:12: so looking a little more at what these
  • 06:14: time series methods are again
  • 06:16: we are trying to predict the future
  • 06:18: using past information
  • 06:21: and there are a lot of possible models
  • 06:23: that we
  • 06:24: can use but the defining characteristics
  • 06:28: of all of them is that they're using
  • 06:31: something about the past
  • 06:32: in order to prevent predict the future
  • 06:36: and depending on the model it's using
  • 06:38: different characteristics
  • 06:39: of the past so it might be the trend it
  • 06:42: might be the growth it might be
  • 06:45: a historical deviations
  • 06:48: from the baseline forecasts i can adjust
  • 06:51: the forecast as well um
  • 06:54: so there's a lot of different um
  • 06:58: models that we can use there
  • 07:02: some of the simplest ones that you can
  • 07:04: use and we'll look
  • 07:06: at calculating these in a future video
  • 07:10: um simple very simple models we can just
  • 07:13: take an average
  • 07:14: of all the historical and say well it's
  • 07:16: going to be at that average
  • 07:18: going forward or we can take whatever
  • 07:20: was the most recent value
  • 07:22: and just say well that's our best
  • 07:23: estimate what it is now
  • 07:25: is our best estimate of what it's going
  • 07:26: to be going forward
  • 07:30: um and those
  • 07:33: are fitting in a number of
  • 07:36: uh forecasts it just depends on what
  • 07:39: you're forecasting it was something
  • 07:41: which tends to be very stable
  • 07:44: then these can be good models
  • 07:47: but most the time probably
  • 07:50: there is going to be some kind of trend
  • 07:52: or growth in
  • 07:53: the historical values
  • 07:56: so it's trending up or down or
  • 07:59: exponentially growing up or down
  • 08:02: and we want to continue that trend or
  • 08:04: growth into
  • 08:05: the future so we'll look at
  • 08:08: models uh for both of those
  • 08:12: and then there's a whole array of more
  • 08:16: advanced time series models
  • 08:18: and this is where a lot of that research
  • 08:20: that i mentioned is
  • 08:21: is around
  • 08:24: and so there are a few different general
  • 08:27: categories
  • 08:28: of how these models are different
  • 08:33: um one is auto aggressive terms
  • 08:37: so that means that you're directly using
  • 08:40: the recent values in the equation to
  • 08:43: predict the future
  • 08:45: our moving average means that
  • 08:48: um you're taking the historical
  • 08:52: you're taking the the forecast for the
  • 08:54: historical and the historical values
  • 08:56: calculating what was the forecast error
  • 08:59: how much were you off in those forecasts
  • 09:01: and those errors actually help you
  • 09:03: predict uh
  • 09:05: what the future uh is going to be
  • 09:08: or conditional heteroskedasticity
  • 09:12: which is a fancy way to say that
  • 09:15: the variance of the underlying data
  • 09:17: changes over time
  • 09:20: so if you're your line item is is
  • 09:23: uh you know very uh stays about the same
  • 09:27: and then it's changing a lot
  • 09:28: and it switches between that um then you
  • 09:30: should consider
  • 09:31: one of these kinds of models
  • 09:36: and so this is where we get into kind of
  • 09:38: the alphabet soup
  • 09:39: of models they tend to be just named uh
  • 09:42: with these different combinations of
  • 09:45: letters
  • 09:46: ar m a arma arch garch
  • 09:49: gam like there are so many of these
  • 09:52: types of models
  • 09:53: which are really uh going to be
  • 09:57: specialized for different purposes
  • 10:00: um so then you might say well
  • 10:04: we have these four simple models we have
  • 10:06: a bunch of more complicated models
  • 10:09: how do i go and pick which model i'm
  • 10:11: going to use
  • 10:14: so there's a number of factors that go
  • 10:17: into it
  • 10:19: and thinking about just the historical
  • 10:21: data
  • 10:23: the how much data you have is important
  • 10:26: as well as how frequent it is
  • 10:29: and whether there are any historical
  • 10:31: patterns and the data is going to be the
  • 10:33: biggest
  • 10:35: contributor to the decision of which
  • 10:38: model to use
  • 10:41: so if the data is basically constant
  • 10:44: historically
  • 10:45: then uh the the average or recent value
  • 10:48: approach
  • 10:49: should be a fine approach um and it just
  • 10:52: comes down to your
  • 10:53: um judgment call of whether you think
  • 10:55: that there's going to be some kind of
  • 10:57: mean reversion
  • 10:59: um and so the average would be more
  • 11:00: appropriate or if it's just going to
  • 11:02: stay where it's at
  • 11:04: and then the more the recent value
  • 11:06: approach would be
  • 11:07: the the best choice there
  • 11:12: but if um there's kind of a trend up in
  • 11:16: the data or
  • 11:16: trend down in the data whether that's
  • 11:18: more straight or it's more exponential
  • 11:21: um then you're going to want to consider
  • 11:23: using a trend or growth
  • 11:25: model so if it's a straighter line
  • 11:27: linear
  • 11:28: growth or decline you want to use the
  • 11:30: trend model
  • 11:31: and if it's more of an exponential
  • 11:33: growth or decline
  • 11:35: then you want to use the growth model
  • 11:40: and um if there are some kind of
  • 11:44: repeating patterns in the data like
  • 11:47: maybe it spikes up
  • 11:48: every like within every year maybe you
  • 11:50: have quarterly data and every
  • 11:51: you know second quarter uh the sales
  • 11:53: spike up
  • 11:56: these are cases where you're definitely
  • 11:58: going to need to use a more advanced
  • 11:59: model any of these for the
  • 12:04: average recent value trend and growth
  • 12:06: are not going to be able to capture
  • 12:08: these kinds of repeating patterns in the
  • 12:10: data that's where you definitely
  • 12:12: need to go to a more complex forecasting
  • 12:15: model
  • 12:20: but one you know there's there's a lot
  • 12:22: of decisions there to be made in terms
  • 12:24: of what
  • 12:25: model you're going to use but what is
  • 12:27: nice about forecasting is that
  • 12:29: regardless
  • 12:30: of what model you choose you go through
  • 12:32: the same process
  • 12:34: to do the forecast itself you just kind
  • 12:36: of switch out this model portion in the
  • 12:38: middle
  • 12:40: so if you understand the general process
  • 12:43: and you can learn the general process
  • 12:45: with simple models
  • 12:47: then it's easy to go and expand on that
  • 12:49: later learn the more complex models and
  • 12:51: just kind of plug them into this
  • 12:53: existing framework
  • 12:56: so the general process to forecasting is
  • 13:00: first you want to look at the historical
  • 13:03: data
  • 13:04: plot is usually a very good way to do
  • 13:07: this
  • 13:08: uh and if you just have a few numbers
  • 13:10: you don't necessarily have to plot them
  • 13:11: you can just look in the numbers
  • 13:12: but um as soon as you have more than a
  • 13:15: few data points it makes sense to plot
  • 13:16: it
  • 13:17: visually see it and what you're trying
  • 13:20: to do
  • 13:22: is get an understanding of that data
  • 13:26: so that you can ultimately make a choice
  • 13:28: on what time series model
  • 13:30: you're going to use
  • 13:33: so you want to look for patterns in the
  • 13:35: historical data whether it's a repeating
  • 13:37: pattern
  • 13:37: and you need a more complex model um or
  • 13:40: whether it's a trend or a growth rate
  • 13:43: and you want to use one of those models
  • 13:45: or if it's basically flat and you want
  • 13:47: to
  • 13:48: use the average or recent value model
  • 13:53: and you also want to consider any kind
  • 13:55: of
  • 13:56: qualitative knowledge that you have
  • 13:59: about it
  • 14:00: um you know if um
  • 14:03: it says in the company's 10k that
  • 14:06: um they're not going to be purchasing
  • 14:08: any new fixed assets
  • 14:10: over the next couple of years then uh
  • 14:13: no it doesn't make sense to use a trend
  • 14:16: if the historical data has been turning
  • 14:17: upwards well you already know
  • 14:19: that the company is not going to keep
  • 14:21: continuing on that path
  • 14:22: um so in that case you know maybe the
  • 14:24: recent value approach is is going to be
  • 14:28: better
  • 14:30: um and then the next step
  • 14:33: is then to fit that time series model
  • 14:37: and you'll have to make a choice there
  • 14:39: on whether you're fitting up on the
  • 14:41: levels
  • 14:41: the growth or the percentage of this
  • 14:44: item
  • 14:44: of another item but
  • 14:48: regardless of which you choose you're
  • 14:49: just fitting this model
  • 14:53: and then you're going to use the fitted
  • 14:55: model to predict
  • 14:56: the future um so you'll have some
  • 15:00: coefficients
  • 15:01: fitted from the historical data and then
  • 15:04: you use those coefficients to then
  • 15:06: predict the future data
  • 15:10: and then you have your forecast you've
  • 15:12: predicted the future
  • 15:13: and the last step is just to examine the
  • 15:16: forecast
  • 15:17: uh to make sure that you got kind of
  • 15:19: what expected and that it makes sense
  • 15:22: um so a plot is definitely the best way
  • 15:25: to do this
  • 15:26: you can look at a plot of both the
  • 15:28: historical
  • 15:29: and going into the forecasted and that
  • 15:32: lets you visually see
  • 15:33: well does this forecast seem to kind of
  • 15:37: continue
  • 15:38: the patterns which i saw in the past
  • 15:42: then i know that the forecast has worked
  • 15:44: correctly unless of course
  • 15:45: you've used your qualitative knowledge
  • 15:47: to adjust the forecast and then
  • 15:50: you know you're making sure that it is
  • 15:52: in line with your expectations of the
  • 15:54: company for the future
  • 16:00: so um
  • 16:04: we have to choose the time series model
  • 16:07: and recent value growth etc but we also
  • 16:10: have to choose
  • 16:12: what to forecast the levels the growth
  • 16:14: or percentage of another item
  • 16:17: um and
  • 16:21: there's a little bit different uh
  • 16:23: process of
  • 16:25: what you do depending on what you're
  • 16:26: forecasting
  • 16:29: when you forecast the levels um
  • 16:32: then you just forecast it and you're
  • 16:34: done the results from your forecasts
  • 16:36: are the results that you need and so
  • 16:38: you're done
  • 16:40: um and forecasting the
  • 16:43: levels makes sense when you have
  • 16:48: these more complex models which are
  • 16:49: really able to take in
  • 16:51: a lot of features of the data um
  • 16:55: in order to do the forecast
  • 16:59: and it makes sense for things which are
  • 17:01: growing
  • 17:02: more slowly or on a linear trend but if
  • 17:05: it's an exponential trend
  • 17:08: you might consider using the growth
  • 17:10: rates instead
  • 17:13: so when you want to forecast using the
  • 17:16: growth rates what you do is you first
  • 17:18: calculate the historical growth rates
  • 17:21: through the percentage change and then
  • 17:24: you
  • 17:24: run the forecast with the growth numbers
  • 17:27: instead of the original numbers
  • 17:29: and that will allow you to predict the
  • 17:32: future growth
  • 17:34: and then you take the most recent level
  • 17:36: and you do
  • 17:38: uh multiply it by one plus next periods
  • 17:40: of growth rate and keep doing that with
  • 17:42: each future growth rate
  • 17:43: to get uh the level forecasted
  • 17:46: into the future
  • 17:50: and then we have these this percentage
  • 17:53: of item approach
  • 17:54: uh where i think
  • 17:58: in deciding whether to use that you
  • 18:00: should think
  • 18:01: about the whatever you're forecasting
  • 18:05: um and how it relates to
  • 18:09: other things which you forecasted
  • 18:12: so having a knowledge of what each
  • 18:15: financial statement line item means and
  • 18:17: how it fits in the context of a
  • 18:20: company's operations
  • 18:22: is how you can guide these decisions
  • 18:25: uh kind of the most classic example for
  • 18:28: doing this
  • 18:29: is forecasting costs of goods sold
  • 18:33: cost of goods sold is almost always
  • 18:35: forecasted as a percentage
  • 18:36: of revenue because as you sell
  • 18:40: additional products
  • 18:41: you also have to increase the cost of
  • 18:44: producing those products
  • 18:45: basically it's the variable cost each
  • 18:47: additional unit that you sell
  • 18:49: you have to pay for the materials which
  • 18:52: you use to create that product
  • 18:55: and so the cost of goods scales uh with
  • 18:58: these sales and so it makes the most
  • 19:02: sense to just
  • 19:02: tie these two things together um
  • 19:06: and then you really just focus on
  • 19:08: getting the sales forecast correct
  • 19:11: and then cost of goods sold just becomes
  • 19:12: a percentage of that
  • 19:15: but you do still have to forecast the
  • 19:18: percentages themselves um
  • 19:21: most commonly people just use the recent
  • 19:24: value or historical average approaches
  • 19:27: but
  • 19:28: again you would want to just go through
  • 19:29: the same kind of evaluation of the
  • 19:31: historical data
  • 19:33: to determine which method to use but
  • 19:36: um you calculate the historical
  • 19:39: percentage so you divide say cost of
  • 19:41: goods by sales
  • 19:42: uh in the historical periods that will
  • 19:44: get you the historical percentage
  • 19:46: then you feed that into the forecast um
  • 19:50: you'll get as a result the future uh
  • 19:52: percentage
  • 19:53: of this item of the other item cost of
  • 19:56: goods sold as a percentage of sales
  • 19:59: and then you just multiply that by your
  • 20:01: forecast
  • 20:02: of the sales or whatever the other item
  • 20:04: is in order to get
  • 20:06: the forecasted levels for this item
  • 20:12: so yeah i have that same example here
  • 20:15: cost of goods sold as a percentage of
  • 20:16: sales
  • 20:17: so maybe you know maybe the historical
  • 20:20: periods were like
  • 20:21: 38 42 41
  • 20:25: and so you say well it's just kind of
  • 20:26: going up and down the historical average
  • 20:28: approach makes sense for the forecast
  • 20:30: so the average is 40 percent we're going
  • 20:33: to use 40
  • 20:34: going forward and then you already have
  • 20:37: a separate forecast of the sales
  • 20:38: so then you just multiply these two
  • 20:40: things together uh
  • 20:42: the forecasted sales with this 40 in
  • 20:45: order to get the forecasted
  • 20:46: cost of goods sold
  • 20:49: so that's an overview on
  • 20:53: everything that we're going to be doing
  • 20:55: in forecasting
  • 20:57: in this course we're going to come back
  • 20:59: next time to
  • 21:00: look at the simple
  • 21:03: forecasting models so thanks for
  • 21:06: listening
  • 21:07: and see you next time

Simple Time-Series Forecasting Models


Notes

  • Use the historical average approach when there is not a defined trend or growth in the historical data and when you think that the average will be more relevant than just looking at the most recent value

  • Use the recent value approach in the same situation, but instead you think that the most recent data is more relevant than an average

  • If the data are going up or down over time, as long as there is not a repeating pattern within that, use the trend or growth model. Use the trend model when the change seems linear/constant, and the growth model when the change seems exponential/changing over time. If there are repeating patterns within the data, a more complex model will be required

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick diabetis teaching you
  • 00:05: financial modeling today we're going to
  • 00:07: be
  • 00:07: talking about simple time series
  • 00:10: forecasting
  • 00:11: models this is part of our lecture
  • 00:13: series on free cash flow estimation and
  • 00:16: forecasting
  • 00:17: as part of a larger goal of developing a
  • 00:20: full discounted cash flow valuation of a
  • 00:23: stock
  • 00:26: so in the prior video we gave a full
  • 00:29: overview on the whole forecasting
  • 00:31: process and all the considerations
  • 00:33: and pieces that go into that so take a
  • 00:35: look at that
  • 00:36: first if you haven't seen that already
  • 00:39: now we're getting into
  • 00:41: uh the simple forecasting portion
  • 00:44: of the lecture series where in this
  • 00:47: video we're going to look at
  • 00:49: simple models we can use to forecast
  • 00:53: time series which are not very complex
  • 00:58: the first model that we're looking at
  • 01:00: here is the historical average model
  • 01:03: um and basically all we're doing here is
  • 01:07: taking an average
  • 01:08: of the historical data and using that to
  • 01:10: predict the future
  • 01:13: so this is useful if uh there's not a
  • 01:16: clear
  • 01:16: trend up or down in the data it's kind
  • 01:18: of fairly constant but it's moving up
  • 01:20: and down
  • 01:23: and you think that it basically reverts
  • 01:25: to the mean
  • 01:26: then this is a good approach to use
  • 01:31: um and so it's just you know taking each
  • 01:35: uh time period in the historical data
  • 01:40: summing them up taking the average
  • 01:43: and then using that average to predict
  • 01:45: all the future periods
  • 01:47: so
  • 01:51: every every future period is going to
  • 01:53: have the same
  • 01:54: value for its forecast it's just all of
  • 01:57: it
  • 01:58: is at the average um
  • 02:02: and this epsilon here just represents
  • 02:04: the error and the forecast that you're
  • 02:06: never going to be able to forecast
  • 02:08: things perfectly
  • 02:12: second model we're looking at is the
  • 02:13: recent value model so this is
  • 02:16: even a little bit simpler than the
  • 02:17: historical average model
  • 02:20: here we're just taking whatever the most
  • 02:22: recent value was
  • 02:23: and assuming that it's going to stay
  • 02:25: there in the future
  • 02:27: um and we just use that same value for
  • 02:30: all the future
  • 02:31: periods so
  • 02:35: this this is applicable in mostly the
  • 02:37: same settings
  • 02:38: as the historical average model
  • 02:41: uh if the data does not have a defined
  • 02:44: uh
  • 02:44: trend up or downward um then
  • 02:50: this can make sense but in contrast to
  • 02:53: the historical average
  • 02:54: this is where you think uh whatever it
  • 02:57: was most
  • 02:57: recently is going to be a better
  • 03:00: estimate for where it's going to be in
  • 03:01: the future
  • 03:02: in other words there's not any kind of
  • 03:04: mean reversion in this data
  • 03:07: so that whatever we had is most recently
  • 03:10: is the best estimate
  • 03:15: then um we're gonna look here at
  • 03:19: two models which deal with when the data
  • 03:21: is going up or down
  • 03:23: over time so the first is the trend
  • 03:26: model
  • 03:27: um and so this is appropriate when it
  • 03:29: seems like it's linearly going up or
  • 03:31: down
  • 03:32: like kind of a straight line uh in the
  • 03:34: data
  • 03:36: whereas if it's kind of a curve an
  • 03:38: exponential change
  • 03:39: then you're going to want to use the
  • 03:40: growth model which we're going to look
  • 03:42: at next
  • 03:44: but if it's linear then uh the trend
  • 03:46: model
  • 03:47: is the most appropriate and so this is
  • 03:50: the first one where we actually have to
  • 03:53: do something other than a very simple
  • 03:55: calculation to actually fit it
  • 03:57: uh what we have to do to fit this is run
  • 04:00: an ols regression
  • 04:02: um so still not very complicated but
  • 04:05: certainly more than just using the last
  • 04:07: period
  • 04:08: um so that
  • 04:12: regression um you would estimate it with
  • 04:15: a constant um and
  • 04:19: the x or independent
  • 04:22: variable there would be t
  • 04:25: time the number of periods and so it can
  • 04:29: be
  • 04:29: you know one for the first period two
  • 04:31: for the second period three for the
  • 04:33: third period and so on that's going to
  • 04:34: be the variable
  • 04:36: you're gonna use as on the right hand
  • 04:39: side
  • 04:40: and then on the left hand side as your y
  • 04:42: your
  • 04:43: response or dependent variable um
  • 04:46: you're going to use whatever you're
  • 04:48: trying to forecast
  • 04:51: so you fit this regression and that's
  • 04:54: going to get you this coefficient
  • 04:56: on the time variable and that's what we
  • 04:59: need to get out of this fitting process
  • 05:03: so then in order to predict that into
  • 05:05: the future
  • 05:07: we then calculate uh
  • 05:10: the the fitted model by using that
  • 05:13: coefficient that we calculated
  • 05:15: from the historical multiplying it by
  • 05:18: the time period um and adding the
  • 05:21: constant which was estimated
  • 05:23: so uh if you had five historical periods
  • 05:27: those might be one two three four five
  • 05:30: as t
  • 05:31: in your uh regression
  • 05:34: then you wanna forecast one period in
  • 05:36: the future that's going to be period
  • 05:38: six so you're going to plug in 6 for t
  • 05:41: here
  • 05:42: and the estimated coefficient
  • 05:45: and intercept then you want to predict
  • 05:48: the next period you're going to plug in
  • 05:49: 7
  • 05:50: period to that you're going to plug in
  • 05:51: eight and so on
  • 05:53: and this is able to capture a linear
  • 05:55: trend up or down
  • 05:57: in the data
  • 06:01: but if that change over time
  • 06:05: going up or down is is more of a curve
  • 06:08: exponential
  • 06:09: rather than a straight line
  • 06:13: then we want to use the growth model or
  • 06:16: compounded annual growth model
  • 06:19: um so what this says is basically we're
  • 06:22: calculating
  • 06:23: the per period growth rate in the
  • 06:25: historical data
  • 06:27: and we're going to apply that growth
  • 06:28: rate going forward
  • 06:31: so you can calculate the compounded
  • 06:33: annual growth rate which is basically
  • 06:34: what
  • 06:35: growth rate would you have to have had
  • 06:38: in each period in order to have the
  • 06:41: growth over the full
  • 06:43: time period
  • 06:46: so you do that by just taking your most
  • 06:48: recent value
  • 06:50: and dividing it by the earliest value
  • 06:53: that you have
  • 06:54: um taking all of that taking it to the
  • 06:58: one over number of periods power so that
  • 07:01: would be
  • 07:02: how many periods are in between that
  • 07:04: beginning of the historical data and the
  • 07:06: end of historical data
  • 07:08: um you raise that fraction to that power
  • 07:12: and then you subtract one and that's
  • 07:14: going to get you the compounded annual
  • 07:16: growth rate or how much should the
  • 07:18: growth rate have been in each period
  • 07:19: to grow as much as it did over the
  • 07:23: entire range of the historical data
  • 07:27: so then once you have that kagger fitted
  • 07:31: then you can predict the future using it
  • 07:35: so uh you know we're just going to use
  • 07:37: the standard
  • 07:38: like growth kind of formula
  • 07:42: where you just take whatever the last
  • 07:44: period was
  • 07:46: and you multiply by one plus the growth
  • 07:48: rate
  • 07:49: compounded at however many periods you
  • 07:51: want to forecast into the future
  • 07:53: so if you're just forecasting one period
  • 07:55: in the future it's just times one plus
  • 07:57: the growth rate
  • 07:58: if you're going two periods in the
  • 07:59: future is times one plus the growth rate
  • 08:01: squared
  • 08:03: and so on um
  • 08:07: so that's how you uh calculate the
  • 08:10: kagger model so
  • 08:13: that's the four different simple
  • 08:16: forecasting
  • 08:17: models that we're going to look at and
  • 08:20: collectively these four models are
  • 08:22: useful uh
  • 08:24: whenever the historical data is fairly
  • 08:27: simple
  • 08:28: now if there are repeating historical
  • 08:30: patterns in the data
  • 08:32: uh maybe there's a spike uh you know
  • 08:35: over and over
  • 08:36: in the data these models are not going
  • 08:38: to be appropriate that's where you need
  • 08:40: to go to the more complex models but
  • 08:43: if it's you know just kind of staying
  • 08:44: around the same or it's just turning up
  • 08:46: or turning down
  • 08:48: then these simple forecast models can
  • 08:50: work just fine
  • 08:53: so that covers the symbol forecast
  • 08:56: models we're going to come back
  • 08:57: next time in the next uh two videos to
  • 09:00: look at
  • 09:01: how we can carry this out in both excel
  • 09:04: and python
  • 09:05: so thanks for listening and see you next
  • 09:07: time

Simple Time-Series Forecasting in Excel


Notes

  • Most of the calculations are straightforward in Excel

  • We can use the SLOPE and INTERCEPT functions to fit the trend model without using the Data Analysis Toolpak regression

Transcript

  • 00:03: hey everyone
  • 00:04: this is nick dear burtis teaching you
  • 00:06: financial modeling today we're going to
  • 00:08: be talking about
  • 00:09: simple time series forecasting in excel
  • 00:13: this is part of our lecture segment on
  • 00:15: free cash flow estimation and
  • 00:16: forecasting as part of a broader goal of
  • 00:19: building out the full
  • 00:20: discounted cash flow valuation of stock
  • 00:25: so we already covered the overview of
  • 00:29: forecasting as well
  • 00:30: as the simple forecast models in
  • 00:33: previous videos so make sure to take a
  • 00:35: look at those if you haven't already
  • 00:37: now we're getting into examples of how
  • 00:41: to
  • 00:41: do this and in this video focusing on
  • 00:44: the excel side
  • 00:46: of how we carry out these simple
  • 00:48: forecasts
  • 00:49: uh with simple models so let's go over
  • 00:54: to an excel sheet which just has the
  • 00:57: data on sales and cost of goods sold
  • 00:59: across three different years
  • 01:02: and the goal here is to forecast next
  • 01:04: year's
  • 01:05: sales and cost of goods sold
  • 01:10: so we will look at the four different
  • 01:12: approaches
  • 01:14: uh four different uh models as well as
  • 01:17: forecasting the levels of the items and
  • 01:19: forecasting
  • 01:20: the percentage of cost of goods sold as
  • 01:23: a percentage of sales
  • 01:27: so um
  • 01:30: we can make a little extra space here
  • 01:34: um so
  • 01:38: see um we're going to
  • 01:44: um have potentially different
  • 01:48: method for sales and cost of goods sold
  • 01:52: um just keep them the same
  • 01:56: um so we can have the
  • 01:59: trend model the compounded annual growth
  • 02:01: model the average
  • 02:03: model and the recent value model
  • 02:06: and we'll just use those same methods
  • 02:08: across both
  • 02:11: um so the
  • 02:14: trend model um
  • 02:17: we um need to run a regression ols
  • 02:21: regression
  • 02:22: um using time as the
  • 02:26: uh independent variable so
  • 02:29: we have to create that time variable so
  • 02:32: we can just start
  • 02:33: at zero you can also start it at one or
  • 02:35: whatever
  • 02:37: so 2017 is zero 2018 is one and
  • 02:40: uh 2019 is two the important thing is
  • 02:43: just that it increases by one
  • 02:44: each period
  • 02:47: and we could go and use the data
  • 02:50: analysis tool pack
  • 02:52: regression in order to do this
  • 02:55: but considering that there's only a
  • 02:57: single independent
  • 02:59: variable uh we can do it just with plain
  • 03:02: excel functions using the slope and
  • 03:04: intercept
  • 03:04: functions so
  • 03:08: we can
  • 03:15: come over here so this is going to be
  • 03:18: our sales forecast and this is our
  • 03:21: our cost to get sold forecast
  • 03:24: so we can use the slope function to
  • 03:28: find the coefficient on the
  • 03:32: t variable and the regression
  • 03:35: so the y here is going to be the values
  • 03:38: for
  • 03:39: sales and the x is going to be
  • 03:42: this value for t and now for t
  • 03:46: uh we're gonna want to have this totally
  • 03:48: fixed because when we drag this down for
  • 03:50: cost of goods sold we don't want it to
  • 03:51: move
  • 03:52: and if we were doing this over in a
  • 03:54: different spot uh we wouldn't want it to
  • 03:56: move
  • 03:57: either so totally fixed on that
  • 04:01: and then for the sales we do want it to
  • 04:04: move down
  • 04:05: when we estimate cost of goods sold but
  • 04:08: we don't
  • 04:09: want it to move left or right so we want
  • 04:11: it fixed on the column but not fixed on
  • 04:13: the row
  • 04:14: um so fixed on the column
  • 04:18: we want the dollar sign in front of the
  • 04:19: column letter
  • 04:21: uh so there we go
  • 04:24: uh so that's the slope slope is 50. um
  • 04:29: and we want to multiply that slope
  • 04:32: by whatever that last period
  • 04:37: as t was plus one to get one
  • 04:40: period into the future and then we want
  • 04:43: to add the
  • 04:44: intercept from the regression so
  • 04:47: again similar fixing here
  • 04:50: fixed on the column
  • 04:53: and here completely fixed
  • 04:59: um so that gets us our estimate of the
  • 05:02: next period
  • 05:03: using the trend approach and we can drag
  • 05:07: that down
  • 05:08: to then uh get the same thing for cost
  • 05:11: of goods sold
  • 05:11: as well
  • 05:14: now coming to the compounded annual
  • 05:18: growth
  • 05:18: uh so the first step in that model is to
  • 05:22: calculate the historical compounded
  • 05:24: annual growth
  • 05:25: and then we're going to apply it into
  • 05:27: the future
  • 05:28: so to calculate that compounded annual
  • 05:30: growth we're going to take the ending
  • 05:32: period
  • 05:32: divided by the beginning period and then
  • 05:35: we're going to take that to the power of
  • 05:38: uh this period's t minus
  • 05:41: the original periods t and then subtract
  • 05:45: one
  • 05:45: at the end um
  • 05:51: okay that doesn't seem right
  • 05:56: um sorry it needs to be
  • 06:00: one divided by the
  • 06:03: difference in periods
  • 06:09: there we go now that looks right growing
  • 06:12: at almost five percent per year
  • 06:15: um so i'll just format that as a
  • 06:17: percentage
  • 06:19: and then i can drag it down to get the
  • 06:21: same for
  • 06:22: the cost of goods sold
  • 06:27: but we'll notice i didn't fix this
  • 06:29: appropriately so let me
  • 06:31: fix these dates
  • 06:35: and then drag again and now it looks
  • 06:38: right
  • 06:41: okay so now we can take that
  • 06:44: calculated compounded annual growth rate
  • 06:46: and apply it to the most recent period
  • 06:49: so we grab the most recent period here
  • 06:52: again fixed on the column not on the row
  • 06:56: multiply by 1 plus
  • 06:59: the compounded annual growth rate fixed
  • 07:02: on the column
  • 07:03: but not the row
  • 07:07: there we have our estimate of the next
  • 07:08: period and we can get the same
  • 07:10: for the cost of goods sold
  • 07:14: and now the average approach you just
  • 07:17: take an
  • 07:17: average of the historical data uh nice
  • 07:20: and straightforward
  • 07:24: fix on the column now on the row again
  • 07:30: um and the recent value approach
  • 07:33: you just take the most recent value and
  • 07:35: again
  • 07:36: fixed in the column not in the row
  • 07:42: so those are four different methods
  • 07:45: on the levels
  • 07:48: um now we can think about doing the same
  • 07:54: but with um
  • 07:57: these different um
  • 08:02: but but using a percentage forecasting
  • 08:04: the percentage
  • 08:05: uh cost of goods of sales instead
  • 08:09: so um in order to use the percentage
  • 08:14: methods we first need to calculate the
  • 08:15: historical percentage so we're just
  • 08:18: going to take
  • 08:19: cost of goods sold divided by sales
  • 08:22: that's going to be the historical
  • 08:24: percentage
  • 08:26: and we want to calculate that for all
  • 08:28: the years
  • 08:31: and we can get the compound and annual
  • 08:33: growth rate of that as well
  • 08:39: and now we have kind of um
  • 08:43: we're focusing now on just getting the
  • 08:45: cost of goods sold forecast
  • 08:47: but now the cost of goods sold forecast
  • 08:49: is affected by the sales forecast as
  • 08:51: well so we have the four different
  • 08:52: methods for forecasting sales and we
  • 08:55: have the four different methods for
  • 08:56: forecasting the percentage
  • 08:58: so that leads to 16 different uh ways
  • 09:01: that we can now forecast this
  • 09:04: um so let me take these same
  • 09:08: uh for the sales
  • 09:12: copy we're going to have these same
  • 09:17: four methods for sales
  • 09:21: and we should be able to just copy these
  • 09:23: as well
  • 09:24: since i did all the fixing appropriately
  • 09:31: okay and now
  • 09:34: we want to go and estimate the
  • 09:37: percentage of sales
  • 09:40: so um we can
  • 09:45: uh then within that we're going to have
  • 09:47: the different approaches so
  • 09:50: for here at the average for here
  • 09:53: at recent value approach
  • 09:57: um we're gonna have four at the trends
  • 10:04: and for at the compound and annual
  • 10:07: growth
  • 10:12: so for the average uh we should be able
  • 10:15: to just copy this over
  • 10:16: hopefully that worked yep so then we can
  • 10:20: use that for all of these
  • 10:23: and for the recent value should be able
  • 10:25: to copy that
  • 10:27: all of this working because we did the
  • 10:30: fixing appropriately
  • 10:33: so recent value is grabbing that recent
  • 10:35: value
  • 10:38: trend we can
  • 10:43: see it is using the trend model
  • 10:45: appropriately
  • 10:46: so bring that over for those four
  • 10:50: and then compounded annual growth rate
  • 10:53: um
  • 10:54: we can see that it is applying that
  • 10:58: to the most recent period
  • 11:11: so then we can drag that over as well
  • 11:18: so then in order to get the actual
  • 11:21: estimate of the sales we just multiply
  • 11:22: these two things together the forecasted
  • 11:24: sales by the forecasted percentage
  • 11:27: and that gets us our estimate of the
  • 11:29: cost of goods sold
  • 11:33: so we have all these different estimates
  • 11:36: that are coming from putting these two
  • 11:38: different methods together
  • 11:42: so some other things that we might want
  • 11:44: to do in the forecasting process
  • 11:46: um you know normally you wouldn't just
  • 11:49: calculate all these models that's really
  • 11:50: just for sake of example
  • 11:53: what you would do as a first step is
  • 11:58: graph the data we want to plot it so we
  • 12:00: can see what it's looked like
  • 12:02: historically so we're going to insert a
  • 12:06: chart
  • 12:07: line chart works well for this
  • 12:12: so this would be the
  • 12:18: financials over time
  • 12:24: um and there we can see
  • 12:28: you know both of these are fairly flat
  • 12:31: they go up and then they go down
  • 12:32: so uh you know maybe the the recent or
  • 12:35: average value approaches would be fine
  • 12:37: for this
  • 12:41: another thing we might want to do since
  • 12:43: we have gone through the process of
  • 12:45: using all these different
  • 12:46: forecast methods we can
  • 12:51: take all these different costs of goods
  • 12:53: sold forecasts that we have
  • 12:57: and we can do
  • 13:00: a box and whisker
  • 13:04: plot on that
  • 13:08: um which is basically going to tell us
  • 13:10: uh the distribution
  • 13:12: of the possible forecasts based on the
  • 13:14: method
  • 13:15: so cogs forecast by method
  • 13:20: um and we can see that forecasts are as
  • 13:24: like low as 6 25 or so go up to 720
  • 13:29: but most of them fall in this 650 to 690
  • 13:33: kind of range
  • 13:37: so then we understand what the range of
  • 13:41: possible forecasts could be
  • 13:42: based on the method
  • 13:45: so that's a quick overview of how we can
  • 13:48: carry out these simple forecasting
  • 13:50: methods in excel in the next video we'll
  • 13:53: come back and look at this on the python
  • 13:56: side
  • 13:57: so thanks for listening and see you next
  • 14:00: time

Simple Time-Series Forecasting in Python


Notes

  • The calculations themselves are straightforward in Python, though we see a couple new tricks such as transposing a DataFrame and working with the DataFrame index

  • This example also builds up some functions which could be taken and used in a project

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick dierbertis teaching you
  • 00:05: financial modeling today we're going to
  • 00:07: be talking about
  • 00:08: simple time series forecasting in python
  • 00:12: this is part of our lecture segment on
  • 00:15: free cash flow estimation
  • 00:16: and forecasting which is part of our
  • 00:19: broader goal in the course
  • 00:20: to build out the full discounted cash
  • 00:22: flow valuation of stock
  • 00:26: so we already covered introduction
  • 00:30: on forecasting and the simple
  • 00:32: forecasting
  • 00:33: models and also how to go about the
  • 00:36: forecast in excel
  • 00:37: so take a look at those videos um
  • 00:41: now we're getting to carrying out the
  • 00:43: process in python
  • 00:46: so let's jump over to the jupiter
  • 00:48: notebook
  • 00:49: example for this which is on the course
  • 00:51: site
  • 00:53: and here we're going to load in the same
  • 00:56: data
  • 00:56: that we used in the excel exercise
  • 01:01: sales and cost of goods sold for three
  • 01:03: different periods
  • 01:06: and we're going to try and forecast the
  • 01:07: next period into the future
  • 01:11: so just as we had seen with other
  • 01:13: financial statement data
  • 01:15: we should set the first column as the
  • 01:18: index
  • 01:19: so that we can easily look up these
  • 01:22: items
  • 01:22: by their names i will also solve this
  • 01:26: unnamed issue here and allow
  • 01:29: the date columns to work appropriately
  • 01:35: so um the first
  • 01:38: step in the forecasting process is to
  • 01:40: examine the history
  • 01:42: and so we can plot it
  • 01:45: but you can't just easily plot the data
  • 01:48: in this format really we need it to be
  • 01:50: flipped because uh we're plotting over
  • 01:53: the
  • 01:54: index the each column over the index
  • 01:57: um so with this we would have like a
  • 02:01: 2017 a 2018 and a 2019 plot that
  • 02:04: connects sales and cost of goods sold
  • 02:05: not what we want
  • 02:07: so thankfully with pandas we can do dot
  • 02:10: capital t and that transposes the data
  • 02:13: frame
  • 02:14: so now we have the columns as those
  • 02:17: statement items
  • 02:18: and the rows as the time periods which
  • 02:20: is the format
  • 02:21: we need to be able to plot it so if we
  • 02:24: just
  • 02:24: uh take that transposed data frame and
  • 02:27: we do a line plot
  • 02:29: on that then we can see sales and cost
  • 02:31: of goods sold
  • 02:32: over time so it kind of goes up and then
  • 02:36: down and so
  • 02:37: the average or recent value approach may
  • 02:39: be appropriate
  • 02:40: but we'll look at all the different
  • 02:43: simple approaches
  • 02:44: to see how we can do each of them so
  • 02:50: first we can look
  • 02:51: at the recent value approach um
  • 02:55: so we're gonna need to pull
  • 02:59: the um most recent value of sales and
  • 03:03: cost of goods sold
  • 03:06: so one thing we can do to make our life
  • 03:08: a little bit easier there is save
  • 03:10: that last period into a variable
  • 03:13: and we can get that value by looking at
  • 03:16: the columns of the data frame
  • 03:18: and taking the max uh within that
  • 03:21: so um we see that 2019 is the most
  • 03:26: recent period here
  • 03:28: and so now we can
  • 03:31: use the outlook which gets us the entire
  • 03:34: row of sales or cost of goods sold and
  • 03:37: then
  • 03:37: also uh look up the last date
  • 03:41: within that so that will get us the most
  • 03:44: recent
  • 03:45: period out of uh whatever time series
  • 03:51: so we'll do that for both sales and cost
  • 03:52: of goods sold
  • 03:54: and then because with the recent value
  • 03:57: model we just use the recent value going
  • 03:59: forward
  • 04:00: those are our forecasts so um there
  • 04:03: we have forecasted value for sales 1100
  • 04:06: and for
  • 04:07: cost of goods sold 650
  • 04:11: next we'll look at the average uh
  • 04:14: historical average approach method model
  • 04:17: for forecasting
  • 04:19: so for that we're just going to take an
  • 04:21: average of the historical
  • 04:23: so we're going to pull out that sales
  • 04:24: row and take the average and pull out
  • 04:26: that cost of goods sold row and take
  • 04:28: the average and those are our forecasts
  • 04:30: for
  • 04:31: going forward
  • 04:36: so the the trend is the first one that
  • 04:38: actually takes
  • 04:39: a little bit of effort to do we need to
  • 04:42: run an ols regression
  • 04:44: uh with the t uh just
  • 04:47: an incrementing time period variable
  • 04:50: as the independent variable and
  • 04:54: our our values as the y
  • 04:58: and we're going to estimate the
  • 05:00: intercept and the coefficient that we're
  • 05:02: going to use
  • 05:03: in calculating the forecast going
  • 05:06: forward
  • 05:08: so first thing that we need to do is set
  • 05:11: up
  • 05:12: a data frame which um
  • 05:15: is going to be in the structure to run
  • 05:16: the regression so we can first
  • 05:19: grab that sales column out of the data
  • 05:21: frame
  • 05:22: and make a new data frame out of that so
  • 05:24: that now it's in this
  • 05:26: transposed format
  • 05:29: um you also could have transposed it and
  • 05:32: then looks up the sales column that
  • 05:33: would have worked as well
  • 05:37: and then um
  • 05:40: what we want for t is like zero one two
  • 05:43: um so we can do that by
  • 05:47: kind of using pandas's automatic index
  • 05:50: to our advantage so if we use reset
  • 05:53: index
  • 05:53: to get rid of uh this
  • 05:58: date index here we use drop equals true
  • 06:01: to make sure it doesn't come in as a
  • 06:02: column in the data frame
  • 06:04: now we have 0 1 2. this is ultimately
  • 06:07: going to be our t but we have to get it
  • 06:09: to come as a column
  • 06:11: so we um
  • 06:13: [Music]
  • 06:15: do reset index again this time without
  • 06:18: the drop
  • 06:19: and that says take what was the index
  • 06:21: and now make it a column
  • 06:23: in the data frame and generate a new
  • 06:25: auto incrementing index
  • 06:28: um so then we can just rename that
  • 06:31: column
  • 06:32: as t and now we have this t
  • 06:36: column in here um this is certainly not
  • 06:39: the only approach to
  • 06:41: getting this uh t variable but
  • 06:44: it's straight it's a straightforward way
  • 06:46: to do it
  • 06:50: so that was a number of steps there
  • 06:53: uh and we're gonna need to do the same
  • 06:55: thing for both sales and costa gets sold
  • 06:57: so let's create a function which does
  • 07:00: those steps for us
  • 07:02: creates the new data frame from that
  • 07:04: particular
  • 07:05: line item resets
  • 07:08: gets rid of the data index and then uses
  • 07:10: the
  • 07:12: auto incrementing and next as t
  • 07:16: so then we can run that from the
  • 07:18: original
  • 07:19: data frame and just pick
  • 07:22: which line item we want to use it on and
  • 07:26: it generates
  • 07:26: the data frame and the correct structure
  • 07:28: for us
  • 07:32: um so then the next step is then to run
  • 07:34: the regression
  • 07:36: um so
  • 07:39: here we're using stats models to run the
  • 07:41: regression and we're going to run
  • 07:43: an ols regression
  • 07:46: and whatever our line item we want to
  • 07:49: predict is going to be the y
  • 07:51: and then the x is going to be the t and
  • 07:53: make sure to add the constant
  • 07:56: um and then we fit the model
  • 07:59: and we get the summary of the results so
  • 08:02: there we can see
  • 08:03: the um intercept was estimated as 1050
  • 08:07: and that the coefficient on t is 50.
  • 08:12: so we can pull those out of the results
  • 08:14: by
  • 08:16: accessing params on the results and
  • 08:18: pulling out the const
  • 08:19: and the t
  • 08:22: so now we have those as individual
  • 08:24: variables
  • 08:26: so now we have fitted the model we just
  • 08:28: need to predict
  • 08:30: um and so the prediction is just you
  • 08:32: take the intercept plus the
  • 08:34: beta times the t or whatever period you
  • 08:37: want to forecast
  • 08:38: and because 2 was the t of
  • 08:42: the last period 3 is going to be the
  • 08:44: next t
  • 08:46: and so that is our forecast of the sales
  • 08:49: using the train method
  • 08:52: so um we can
  • 08:57: also make some functions
  • 09:00: for this process as well running the ols
  • 09:03: regression and getting the beta and
  • 09:04: intercept and predicting based on that
  • 09:08: beta
  • 09:09: intercept and the t um
  • 09:12: so then we can use those functions
  • 09:13: instead and we can make one more final
  • 09:16: function that puts all these steps
  • 09:18: together
  • 09:18: create that data frame and then run
  • 09:21: these
  • 09:22: uh run the regression and predict from
  • 09:24: the regression
  • 09:25: now we have one function which is able
  • 09:27: to do the full
  • 09:29: uh trend regression forecasting process
  • 09:31: so you just give it the data frame the
  • 09:33: name of the
  • 09:34: item that you want to forecast
  • 09:37: and the number of
  • 09:42: time periods that you want to forecast
  • 09:43: it or the
  • 09:45: the uh t value of the time period that
  • 09:49: you want to forecast
  • 09:50: so if two was your last historical then
  • 09:53: three is one period into the future
  • 09:56: and then we can just use that function
  • 09:57: on the sales the cost of goods sold
  • 10:00: and that will allow us to get our
  • 10:01: forecast here
  • 10:06: and you can feel free to take these
  • 10:08: functions into your own model
  • 10:10: to do this as well
  • 10:14: so then we also have the compounded
  • 10:17: annual growth rate approach
  • 10:19: so we
  • 10:22: can still use that data frame which was
  • 10:26: set up for the forecasting so let's take
  • 10:28: the one for sales
  • 10:30: and now we want to calculate this uh
  • 10:34: kaiger formula so we want to get the
  • 10:36: first
  • 10:37: sales so we can use a.i look
  • 10:40: to get the first value and uh the last
  • 10:43: value
  • 10:44: so we set that as y0 and yt
  • 10:48: um and we can get the number of time
  • 10:52: periods
  • 10:53: by doing the same thing on the t
  • 10:55: variable so two
  • 10:57: time periods elapsed
  • 11:00: between the first and the last period
  • 11:03: and then we can just calculate the
  • 11:06: kagger formula and we have the
  • 11:09: the kagger and then we'll want to
  • 11:13: apply that going forward into the future
  • 11:17: so to apply that then you just
  • 11:22: multiply the last value the yt
  • 11:28: times 1 plus the compounded annual
  • 11:31: growth rate
  • 11:32: to the power of the number of periods in
  • 11:35: the future
  • 11:36: that you want to forecast
  • 11:42: um
  • 11:50: oh that's how you do exponents in python
  • 11:54: i'm a little tired today
  • 11:56: um so there we go that's our forecasted
  • 11:59: value
  • 12:01: and now we can put that into
  • 12:05: um formula and two functions
  • 12:08: one that gets the compound and annual
  • 12:11: growth rate doing those steps we just
  • 12:12: looked at
  • 12:13: and the other which uh creates the
  • 12:16: forecast
  • 12:16: from that compounded annual growth rate
  • 12:19: um so using those two functions
  • 12:21: then we can get the forecasted value
  • 12:24: and we can put those together into one
  • 12:26: final function which
  • 12:28: is the forecast data frame calculates
  • 12:30: the compound anal growth rate and
  • 12:32: applies that into the future
  • 12:34: uh one function which does it all for
  • 12:36: the kagger approach and then
  • 12:38: we can use it in the same way as that
  • 12:43: the regular trend approach
  • 12:47: and we get the results there
  • 12:53: so that was all working with the levels
  • 12:57: of the sales and cost of goods sold
  • 13:00: but usually cost of goods sold is
  • 13:03: forecasted as a percentage
  • 13:05: of sales so let's look at doing that
  • 13:09: so the first thing that we want to do is
  • 13:11: create a row in our data frame which
  • 13:12: represents the cost of goods sold as a
  • 13:14: percentage of sales
  • 13:15: so i'm going to assign a new row
  • 13:19: by taking the cost of goods sold divided
  • 13:22: by
  • 13:23: the um sales
  • 13:27: and then we've already built out these
  • 13:29: forecasting
  • 13:30: uh functions so we can just use them on
  • 13:34: that percentage as well with the trend
  • 13:36: we would estimate that the next
  • 13:38: periods cost of goods sold as a
  • 13:40: percentage of sales would be
  • 13:41: 57
  • 13:44: and then we just multiply that by the
  • 13:46: forecasted sales value
  • 13:48: and that gets us our cost of goods sold
  • 13:50: forecast
  • 13:54: so to kind of put everything together
  • 13:55: around this exercise
  • 13:58: let's make one more function here which
  • 14:00: um
  • 14:01: you can give it the name of the method
  • 14:05: that you want to use
  • 14:07: and it's going to run that particular
  • 14:10: forecast method
  • 14:11: so using the two functions which we
  • 14:15: developed
  • 14:16: for the trend regression and the the
  • 14:18: kagger approach
  • 14:20: as well as just taking the most recent
  • 14:23: value
  • 14:24: and taking the average of the historical
  • 14:25: values
  • 14:27: all these now incorporated into one
  • 14:28: function
  • 14:30: so now we have these four different
  • 14:31: methods
  • 14:34: and we want to forecast the next period
  • 14:39: so then we're going to go through each
  • 14:41: method and we're going to forecast sales
  • 14:43: by that method
  • 14:45: and then uh for each of those
  • 14:49: uh sales methods we're going to go
  • 14:51: through the methods again for the cost
  • 14:52: of goods sold
  • 14:54: and then within that we're going to
  • 14:56: forecast the levels
  • 14:58: of the cost of goods sold and forecast
  • 15:01: the
  • 15:02: percentage cost of goods sold as a
  • 15:03: percentage of
  • 15:05: revenue and uh calculate the levels
  • 15:08: based on that so when we do that then we
  • 15:12: get
  • 15:13: lots of different results here for
  • 15:15: possible
  • 15:16: um results for the cost of goods sold
  • 15:20: depending on
  • 15:22: which method was used for the sales and
  • 15:25: which method was used for the cost to
  • 15:27: get sold
  • 15:29: and whether the levels of the cost of
  • 15:31: goods sold or the percentage
  • 15:33: of sales of cost of goods sold was
  • 15:36: forecasted so lots of options here even
  • 15:39: with just
  • 15:40: the simple forecasting models
  • 15:44: and since there were so many approaches
  • 15:45: here it's useful to visualize that it's
  • 15:48: kind of hard to read all this text
  • 15:50: output
  • 15:51: so we can use a box plot to look at the
  • 15:54: distribution
  • 15:55: of these forecasts and that shows us
  • 15:59: that
  • 15:59: the forecasts basically go down to about
  • 16:02: uh
  • 16:03: 6 20 or so 6 25 maybe
  • 16:06: up to like 7 almost 7 20
  • 16:10: but most of the forecasts lie between 6
  • 16:13: 50
  • 16:13: and 6 90.
  • 16:17: so now we have an idea of kind of the
  • 16:19: general range of the forecast
  • 16:21: depending on the method that we choose
  • 16:25: so that's a quick overview on how to
  • 16:28: use the four different
  • 16:31: simple time series models that we're
  • 16:35: covering
  • 16:35: in this course and applying it to both
  • 16:38: levels
  • 16:39: and percentages of items so
  • 16:42: thanks for listening and i'll see you
  • 16:44: next time

Simple Time-Series Forecasting Lab Overview


Notes

  • This lab exercise follows closely the structure of the previous example

  • Through this you should understand the different simple methods

Resources

Transcript

  • 00:03: hey everyone this is nick d robertis
  • 00:05: teaching you financial modeling
  • 00:07: today we're going to be introducing the
  • 00:10: lab exercise
  • 00:11: on simple time series forecasting
  • 00:15: this is part of our lecture segment on
  • 00:17: free cash flow estimation and
  • 00:19: forecasting
  • 00:20: as part of a broader goal to build at
  • 00:22: the full discounted cash flow valuation
  • 00:25: of a stock
  • 00:26: so we finished up
  • 00:30: in prior videos the overview of
  • 00:32: forecasting
  • 00:33: and all the simple forecast models
  • 00:37: uh and then we went through examples of
  • 00:39: how to run these simple forecast models
  • 00:42: in both excel and python so now
  • 00:46: we are coming to the lab exercise which
  • 00:50: uh cements understanding of all these
  • 00:53: topics
  • 00:55: and it's a very similar exercise to what
  • 00:58: was shown in the excel and python
  • 01:00: examples
  • 01:01: so you're going to take this debt
  • 01:03: interest file which has
  • 01:04: information on the
  • 01:07: total debt and the interest payment
  • 01:11: and you want to
  • 01:13: [Music]
  • 01:15: basically forecast uh with all the
  • 01:18: different approaches
  • 01:19: and you want to forecast on for interest
  • 01:23: you want to forecast that both in terms
  • 01:26: of levels
  • 01:27: as well as forecasting it as
  • 01:30: a percentage of debt
  • 01:35: so infest is another common example
  • 01:40: that is typically percent forecasted as
  • 01:42: a percentage
  • 01:44: of uh total debt or long-term debt
  • 01:46: rather than at levels so it's a good
  • 01:48: uh fit for this exercise
  • 01:52: um and then you can find all the answers
  • 01:54: here
  • 01:55: on the um slides as well
  • 02:00: so that's the review of the lab exercise
  • 02:04: we'll come back next time to talk about
  • 02:08: more specifically forecasting financial
  • 02:11: statements as a whole
  • 02:12: with these simple forecasting methods so
  • 02:15: thanks for listening
  • 02:16: and see you next time

Forecasting Simple Financial Statements in Python with finstmt


Notes

  • Forecasting financial statements can be overwhelming because there are so many different line items to think through

  • finstmt allows you to forecast them all at once, conveniently, and with reasonable baseline assumptions. You can modify the forecast method or target (level, growth, % of other item) for any item as desired by adjusting the configuration

  • finstmt also automatically generates plots with confidence intervals for all the line items

  • finstmt also allows you to make manual adjustments to an existing forecast, either by adjusting the existing forecasted values or by replacing them

Transcript

  • 00:04: hey everyone this is nick dear burtis
  • 00:06: teaching you financial modeling
  • 00:07: today we're going to be talking about
  • 00:09: forecasting simple financial statements
  • 00:12: in python using fin statement this is
  • 00:15: part of our lecture series on
  • 00:17: free cash flow estimation and
  • 00:18: forecasting which is part of a broader
  • 00:21: goal in the course of
  • 00:22: building out a full discounted cash flow
  • 00:25: valuation
  • 00:26: of a stock so
  • 00:29: we had just finished all the simple
  • 00:32: forecasting material in prior videos
  • 00:36: and um we had looked at
  • 00:39: examples of how to do simple time series
  • 00:42: forecasting
  • 00:43: but now this is focusing on working with
  • 00:46: the entire financial statements
  • 00:48: in a forecast and using the fence
  • 00:50: statement package
  • 00:51: to smooth that process
  • 00:54: so we can jump over to the example
  • 00:58: jupiter notebook so
  • 01:02: um the first thing that we'll do here
  • 01:05: is uh load in the
  • 01:08: financial statements so
  • 01:12: we are going to um
  • 01:15: create data frames from the csv files
  • 01:18: that have the statements
  • 01:19: and then create the balance sheet
  • 01:22: income statements uh both from
  • 01:26: those data frames and then create the
  • 01:29: financial statements
  • 01:30: from the income statement and balance
  • 01:32: sheet
  • 01:35: so since we've done that we can view
  • 01:38: the statements so we see the income
  • 01:41: statement
  • 01:42: and all the different periods of values
  • 01:46: and we see the balance sheet also with
  • 01:49: all the different periods of values
  • 01:54: so um we're going to look at
  • 01:57: forecasting um we have a couple of
  • 02:01: different
  • 02:02: uh configuration settings um but here is
  • 02:06: a little aside to say
  • 02:08: uh it's often the case that you might
  • 02:09: want to run multiple different forecasts
  • 02:12: so if you know that's true then you can
  • 02:14: make a copy
  • 02:15: of the statements to keep uh any changes
  • 02:18: that you make to the configuration
  • 02:20: separate so that you can run multiple
  • 02:23: completely separate forecasts
  • 02:25: so here is how you would copy the
  • 02:27: statements
  • 02:28: into uh additional uh
  • 02:31: statements which are now totally
  • 02:33: separate from the first
  • 02:37: so now let's jump into forecasting
  • 02:40: um so what we have
  • 02:43: um in order to understand what
  • 02:46: assumptions are going into the forecast
  • 02:48: is this dot forecast assumptions uh
  • 02:52: attribute on the financial statements
  • 02:55: object
  • 02:56: so when you look at that as penis data
  • 02:58: frame
  • 02:59: of basically each
  • 03:03: line item in the index and some details
  • 03:06: about how the forecast is going to be
  • 03:09: carried out
  • 03:10: so the first column here is
  • 03:15: the method so you can choose
  • 03:18: among one of the available forecast
  • 03:21: methods in order to do the forecast
  • 03:25: and it defaults to the compounded annual
  • 03:27: growth rate
  • 03:28: but we can also choose to use the
  • 03:31: average
  • 03:32: approach the recent value approach or
  • 03:34: the
  • 03:35: trend regression approach
  • 03:39: and when we get into looking at more
  • 03:40: complex time series we'll see another
  • 03:42: approach which is helpful there as well
  • 03:47: and then the next column here is talking
  • 03:50: about
  • 03:51: is this item forecasted as a percentage
  • 03:54: of another item
  • 03:55: so you see here that revenue is not
  • 03:59: forecasted as a percentage of another
  • 04:00: item it's forecasted standalone
  • 04:02: but cost of goods sold is forecasted as
  • 04:05: a percentage of
  • 04:06: revenue and it has kind of the standard
  • 04:09: assumptions that you would normally
  • 04:11: see for forecasting items as a
  • 04:14: percentage of other items
  • 04:16: but you can adjust that further if
  • 04:18: needed
  • 04:20: um and then next we have
  • 04:24: cap and floor that's in case you want to
  • 04:26: put
  • 04:27: a minimum or a maximum on your
  • 04:30: forecasted values
  • 04:33: and then finally here we have plug which
  • 04:36: is about
  • 04:37: balancing the balance sheet so the
  • 04:39: library will automatically
  • 04:40: balance the balance sheet for you based
  • 04:42: off of the forecasts
  • 04:44: but in order to do that it does have to
  • 04:48: avoid uh forecasting uh
  • 04:52: at least one one or two items
  • 04:56: uh typically one on the assets uh
  • 04:59: one on the asset side and one on the
  • 05:01: liabilities side
  • 05:03: liabilities or equity side um in order
  • 05:06: to balance the balance sheet based off
  • 05:07: your forecast it has to
  • 05:09: manually adjust these values
  • 05:13: and so by default cash
  • 05:16: and long term debt are going to be the
  • 05:19: plug items
  • 05:20: so if the assets are too high from your
  • 05:24: initial forecast it's going to increase
  • 05:26: the debt
  • 05:27: and if the assets are too low then it's
  • 05:30: going to
  • 05:30: increase the cash basically
  • 05:34: but you can adjust which items are the
  • 05:36: plug
  • 05:37: should you want to directly forecast
  • 05:39: cash or directly forecast long-term debt
  • 05:41: and have
  • 05:42: something else serve as the plug
  • 05:47: so we can update this configuration
  • 05:54: using the update method so we
  • 05:58: on the statements we have this
  • 06:03: config and we can
  • 06:07: update that um
  • 06:13: so we have update and update all um here
  • 06:16: update
  • 06:16: all so all of these forecast assumptions
  • 06:19: are going to be under
  • 06:20: the forecast config so you pass first a
  • 06:23: list
  • 06:24: uh where the first item will be forecast
  • 06:26: config
  • 06:28: and the second item will be which one of
  • 06:31: these that you want to
  • 06:33: update so here method
  • 06:36: and then that list is the first argument
  • 06:39: what you want to update
  • 06:41: and then the value you want to use to
  • 06:44: update it comes next
  • 06:45: so this sets the compounded annual
  • 06:48: growth rate method for all the forecasts
  • 06:50: of course we already had that
  • 06:52: uh we could also set it a trend and see
  • 06:56: that come through
  • 06:57: on all the assumptions
  • 07:01: um and you can also update
  • 07:04: a single item um so to update
  • 07:08: a single item then it's um
  • 07:11: going to be a similar syntax and we'll
  • 07:14: see that here
  • 07:15: in a moment but i'm going to switch it
  • 07:18: back to the
  • 07:19: compounding growth rate method
  • 07:25: so the way that we forecast once we have
  • 07:29: decided that our
  • 07:30: assumptions are good enough to run the
  • 07:31: forecast then
  • 07:33: um there's just a dot forecast method on
  • 07:37: the financial statements and then you'll
  • 07:39: see
  • 07:40: some output go by
  • 07:43: and the warnings that you see here are
  • 07:45: about
  • 07:46: uh the compounded annual growth rate not
  • 07:48: being an appropriate method for some of
  • 07:50: the items
  • 07:51: basically the items which are at zero
  • 07:53: the entire time it can't calculate a
  • 07:54: growth rate
  • 07:56: um so you could set those to trend
  • 07:59: if the warnings bother you otherwise
  • 08:01: it's just going to remain at zero anyway
  • 08:04: um and then we can look at the
  • 08:06: forecasted statements
  • 08:08: so uh by default it's going to forecast
  • 08:12: for five periods into the future you are
  • 08:14: able to
  • 08:16: adjust that in the forecast
  • 08:19: arguments um
  • 08:22: and then
  • 08:26: we have all of our forecasted statements
  • 08:28: here but it can be a little difficult to
  • 08:30: see what happened just from the numbers
  • 08:31: so there's also a plot method which is
  • 08:34: going to show us
  • 08:36: all of the different forecast plots
  • 08:39: which
  • 08:40: we can easily examine to understand what
  • 08:43: happened with the forecast
  • 08:47: so we can see the forecast for revenue
  • 08:49: we can see that forecasted cost of goods
  • 08:51: sold as a percentage of revenue and
  • 08:54: all these other line items as well
  • 08:57: so all that just kind of happened in the
  • 08:59: background for us
  • 09:01: and now we have forecasts for everything
  • 09:08: if you want to just look at a few plots
  • 09:09: you can pass the subset to the plot
  • 09:11: method
  • 09:12: so you don't have this huge output every
  • 09:15: time
  • 09:19: so um if you want to
  • 09:22: update particular items you can use this
  • 09:25: syntax so it's the same as the update
  • 09:27: all syntax except we first
  • 09:29: put the name of the item that we want to
  • 09:31: update
  • 09:32: um so this is going to set revenue
  • 09:35: to the trend forecast method and it's
  • 09:38: going to set
  • 09:39: cost of goods sold to the mean forecast
  • 09:42: method
  • 09:44: so when we look at the forecast
  • 09:48: assumptions then we'll see that those
  • 09:52: have
  • 09:52: updated revenues now trend cost of goods
  • 09:55: sold
  • 09:56: is now a mean but still a percentage of
  • 09:58: revenue
  • 10:01: so then we can run the forecast again
  • 10:05: and we will see the results here in a
  • 10:10: moment
  • 10:10: it does take a little bit of time to
  • 10:12: balance the balance sheet
  • 10:14: and then we can look at the results that
  • 10:17: come out
  • 10:20: um so we'll see now in contrast to
  • 10:23: before
  • 10:24: we can see that um
  • 10:27: before the cost of goods sold was using
  • 10:30: a compound or annual growth rate
  • 10:31: approach
  • 10:32: and now it is at an average approach
  • 10:35: instead
  • 10:38: and same thing with the revenue
  • 10:40: compounded annual growth rate
  • 10:42: before and now it is using a trendline
  • 10:45: approach
  • 10:49: so um then it's often the case that you
  • 10:53: don't just want to take
  • 10:54: kind of the baseline result that you get
  • 10:56: from the forecast you may have some kind
  • 10:58: of
  • 10:59: qualitative information that you can use
  • 11:01: to adjust the forecast such as some
  • 11:04: new project that you know is coming on
  • 11:06: for the company or some other change in
  • 11:08: the operations which is not reflected
  • 11:10: in the historical information so
  • 11:14: i built this into the library where we
  • 11:16: can adjust
  • 11:17: an existing forecast
  • 11:20: um so after you've done the forecasts
  • 11:24: then you can access uh the forecast by
  • 11:27: forecast and then the name of the
  • 11:29: statement item
  • 11:31: and then you can convert it to a manual
  • 11:33: forecast
  • 11:34: where we just have fixed values for the
  • 11:37: forecast
  • 11:39: and as you're converting it to a manual
  • 11:42: forecast
  • 11:43: then you can make adjustments or you can
  • 11:45: replace
  • 11:46: uh different parts of that forecast
  • 11:50: so and by default it
  • 11:53: uh works in growth rates but you can
  • 11:56: also pass
  • 11:56: use levels equal true to work with the
  • 11:59: levels of the item
  • 12:01: um so the um
  • 12:04: first one here we're adjusting cash
  • 12:08: and it's going to adjust the first
  • 12:12: period
  • 12:12: zero index period
  • 12:16: to increase the growth by 40
  • 12:19: in that period the second example here
  • 12:23: um is on the levels instead of on the
  • 12:25: growth rate
  • 12:27: and it's going to replace uh
  • 12:30: each of the values
  • 12:33: for the cost of goods sold as a
  • 12:35: percentage of sales forecasts with 85
  • 12:40: and then this last one on the revenue
  • 12:43: again on the levels and it's going to
  • 12:46: replace
  • 12:46: the second period value with
  • 12:50: uh 80 billion dollars
  • 12:54: so i do that and then uh run the
  • 12:57: forecast again
  • 12:58: and we'll look at the results that come
  • 13:01: out
  • 13:04: um
  • 13:08: so we have um now in the
  • 13:11: revenue we see that that second forecast
  • 13:14: period was replaced
  • 13:15: by uh 80 billion
  • 13:18: and the cost of goods sold as a
  • 13:20: percentage of revenue
  • 13:22: we see that now it's flatlined at 85
  • 13:25: percent instead
  • 13:28: and in the cash uh we see that we have
  • 13:31: an additional
  • 13:32: uh bump at the beginning uh of a 40
  • 13:36: growth uh for the first period
  • 13:41: so um and then when we look at the
  • 13:45: forecast assumptions there
  • 13:48: we see all these things that we've done
  • 13:51: so revenue cost of goods sold
  • 13:53: and cash got converted to manual
  • 13:55: forecasts
  • 13:56: and now it specifies
  • 14:00: what values are just basically hard
  • 14:03: coded into the forecast
  • 14:07: and we see all our other forecast
  • 14:10: assumptions
  • 14:11: there
  • 14:14: but we made that copy of the statements
  • 14:16: at the beginning because we might want
  • 14:18: to do another forecast
  • 14:19: and we look at that one and we see that
  • 14:21: none of the assumptions have been
  • 14:23: touched
  • 14:23: so that's why we did the copy before
  • 14:26: going and modifying the assumptions
  • 14:28: that way we have a totally clean set of
  • 14:30: assumptions now
  • 14:31: that we can go and run a completely
  • 14:34: separate forecast
  • 14:37: so that's a quick overview on using
  • 14:40: fin statement to do financial statement
  • 14:42: forecasting uh
  • 14:44: we'll have another video where we look
  • 14:46: at uh
  • 14:47: forecasting complex time series
  • 14:50: in financial statements also using fin
  • 14:52: statement
  • 14:53: so thanks for listening and see you next
  • 14:56: time

Complex Time-Series Forecasting


Notes

  • Forecasts are simple when the data are just trending upwards or downwards without any repeating pattern

  • Once there are repeating patterns in the data, more advanced models are needed

  • Seasonality is a classic cause of these repeating patterns. A cruise line is going to have much higher sales in the summer than in the winter, and this pattern is going to repeat every year

  • In general, these advanced models are outside of the scope of the course. Here we just cover the quarterly seasonal trend model which is specifically designed to deal with this seasonality in quarterly data, which should be sufficient for DCF financial statement forecasting

  • Dummy variables are just those which take on a value of 1 for true and 0 for false

  • If you need to forecast higher frequency data for other purposes, the quarterly seasonal trend model will not be a good fit. Other frequency seasonality models can be fit, but it would usually be better to go to the full model selection process

  • Thankfully, we have software solutions to fit advanced models for us such as prophet, which is integrated into finstmt

Transcript

  • 00:04: hey everyone
  • 00:04: this is nick dear burtis teaching you
  • 00:06: financial modeling today
  • 00:08: we're going to be talking about
  • 00:10: forecasting complex
  • 00:11: time series this is part of our lecture
  • 00:14: segment
  • 00:14: on free cash flow estimation and
  • 00:17: forecasting
  • 00:19: so we already covered how to forecast
  • 00:23: more simple time series which is
  • 00:26: represented by basically it being
  • 00:30: flat or i'm just trending up or trending
  • 00:33: down
  • 00:34: and pretty clear simple way
  • 00:38: but it's the case that you have a more
  • 00:41: complex pattern
  • 00:42: going on in your financial statements
  • 00:47: so this kind of pattern
  • 00:50: is what i'm talking about where you see
  • 00:55: just repeating patterns over and over in
  • 00:57: the data
  • 00:58: we can see that there's also a trend
  • 01:00: going on here
  • 01:02: but there's this repeating pattern
  • 01:05: which makes this a complex time series
  • 01:08: and a simple trend or
  • 01:10: growth kind of model is not going to be
  • 01:12: able to represent
  • 01:14: these repeating spikes in the data
  • 01:18: this is uh walmart's quarterly sales
  • 01:21: that i've pulled here
  • 01:22: in order to show this plot
  • 01:26: and um basically
  • 01:30: what's going on is that there's a
  • 01:33: seasonality here
  • 01:34: in the data walmart is
  • 01:38: going to sell more around christmas time
  • 01:41: the holidays
  • 01:42: um and so we see those spikes happening
  • 01:46: year over year every year
  • 01:48: so if you want to forecast the quarterly
  • 01:50: sales you have to be able to account for
  • 01:52: that
  • 01:52: some quarters are going to be better
  • 01:54: than others year over year
  • 01:59: so we can kind of break down
  • 02:02: this uh plot
  • 02:06: into two separate plots one looking at
  • 02:08: the trend component
  • 02:10: and one looking at the seasonality
  • 02:12: component
  • 02:13: to better understand what's going on
  • 02:15: here as we had already seen it is
  • 02:18: turning upwards over time
  • 02:19: and so we see that trend effect going on
  • 02:22: here
  • 02:23: um and then this is representing
  • 02:26: throughout the year
  • 02:27: where are the spikes um so we see this
  • 02:31: spike in the december time frame
  • 02:35: and we also see that that sales tend to
  • 02:37: be low
  • 02:39: after after that initial time frame
  • 02:41: going into march
  • 02:45: so here a certain
  • 02:49: time series model was used that does
  • 02:51: allow to
  • 02:52: decompose these two different parts
  • 02:56: um and
  • 02:59: it's useful to do this kind of
  • 03:00: separation because then you can really
  • 03:02: understand
  • 03:03: the seasonality component in more detail
  • 03:07: which gives you an insight into what's
  • 03:10: going on
  • 03:11: in the business
  • 03:16: so you've got a complex time series
  • 03:20: you've looked at the historical plot
  • 03:22: and you say well this isn't just simply
  • 03:24: going up or
  • 03:25: or exponential or flat
  • 03:29: there is some kind of repeating pattern
  • 03:31: that i need to be able to predict
  • 03:34: so what do i do
  • 03:38: so in general it is a little more
  • 03:41: complicated
  • 03:42: or substantially more complicated than
  • 03:44: the simple
  • 03:46: forecasts still the overall process
  • 03:49: is the same you know you fit the model
  • 03:52: on the historical data and then you use
  • 03:54: that fitted model to predict the future
  • 03:58: but picking the model to use for your
  • 04:02: complex time series
  • 04:03: can be in a complicated and involved
  • 04:05: process
  • 04:07: so i've given a resource here that you
  • 04:10: can read more about that
  • 04:12: if you're interested um
  • 04:16: but there is a simple approach that we
  • 04:18: can do
  • 04:19: specifically for the case of um
  • 04:23: this seasonality issue if you're just
  • 04:26: trying to capture
  • 04:27: seasonality in your forecast then
  • 04:30: there's
  • 04:31: a fairly simple model we can use for
  • 04:33: that and we'll look at that
  • 04:35: explicitly and so when dealing with
  • 04:38: quarterly data we
  • 04:39: call that the quarterly seasonal trend
  • 04:41: model
  • 04:44: but that may not ultimately produce the
  • 04:47: best
  • 04:47: fitting forecast there may be other
  • 04:50: features
  • 04:51: of the data that you need to predict
  • 04:53: than just the seasonality
  • 04:57: and it's definitely outside of the
  • 05:01: scope of the course to discuss all the
  • 05:04: different
  • 05:05: models that you could possibly use for
  • 05:06: all different use cases
  • 05:09: but what i can recommend that you can do
  • 05:11: instead
  • 05:12: in the meantime until you you know want
  • 05:15: to go
  • 05:16: and learn all of that is there are
  • 05:18: software solutions
  • 05:20: which can help you pick the appropriate
  • 05:22: model
  • 05:24: so profit is one such
  • 05:27: uh software package which does this it's
  • 05:30: created by
  • 05:30: facebook they use it for their in-house
  • 05:34: uh forecasting of uses metrics and
  • 05:36: things like that
  • 05:39: and we can just use that in order to
  • 05:44: predict our complex time series without
  • 05:46: having a deep understanding
  • 05:48: of all the details of how you should go
  • 05:52: about
  • 05:52: uh selecting these more complex models
  • 05:58: and as we'll see um in a future video
  • 06:02: here soon
  • 06:03: into the fin statement package which
  • 06:06: i've created
  • 06:07: i've also built in an integration
  • 06:10: with profits so you can automatically
  • 06:12: use profit
  • 06:13: through if and statement
  • 06:18: so let's just uh go through the
  • 06:21: quarterly seasonal trend model
  • 06:22: that's going to be the one complex model
  • 06:25: that we're going to look at actually
  • 06:27: estimating
  • 06:28: and we're just going to say for
  • 06:29: everything else we can just
  • 06:31: use profit in order to automatically
  • 06:34: fit the model for us so the quarterly
  • 06:39: seasonal trend model uh it looks a
  • 06:42: little bit like the trend model
  • 06:43: all it is the trend model but then plus
  • 06:46: these additional components
  • 06:49: and these additional components are
  • 06:51: including dummy variables
  • 06:54: and one dummy variable for each quarter
  • 07:00: and so
  • 07:03: by that uh approach then you're going to
  • 07:07: um have a different uh
  • 07:10: coefficient fit for each quarter
  • 07:14: uh so that it's able to adjust and say
  • 07:16: some quarters should be higher
  • 07:18: than others um so these dummy variables
  • 07:22: are just going to represent uh
  • 07:26: that it is this quarter or it's not this
  • 07:28: quarter
  • 07:30: so if your sales
  • 07:33: or whatever observation is
  • 07:36: for first quarter then this variable is
  • 07:39: going to be one
  • 07:40: and all the others are going to be zero
  • 07:43: whereas
  • 07:44: if it's second quarter then this one's
  • 07:46: going to be one the others are zero
  • 07:48: and so on these dummy variables are just
  • 07:50: one or zero one to represent
  • 07:52: true zero to represent false
  • 07:55: and it's going to be true or one
  • 07:57: whenever
  • 07:59: this particular observation this
  • 08:03: time period is within
  • 08:07: that quarter of the year
  • 08:11: so to fit this basically we have to
  • 08:14: create these
  • 08:15: um dummy variables and then
  • 08:18: we just throw them in there in the trend
  • 08:21: regression model
  • 08:22: and that will fit this quarterly
  • 08:25: seasonal trend model
  • 08:28: as far as predicting it so
  • 08:32: you're just going to
  • 08:35: fit it like the trend model so this this
  • 08:38: constant plus the
  • 08:40: uh beta times the time period
  • 08:44: but you're also going to add on the
  • 08:46: dummy
  • 08:47: corresponding to the appropriate quarter
  • 08:50: so the next period that you're
  • 08:52: forecasting is first quarter
  • 08:54: then you're going to add the coefficient
  • 08:56: on the first
  • 08:57: quarter dummy if it's the second quarter
  • 08:59: then the second quarter coefficient
  • 09:01: third quarter third coefficient and so
  • 09:04: on
  • 09:05: and you're only adding one of them
  • 09:07: because again these are dummy variables
  • 09:10: only one of them
  • 09:10: is going to be uh taking a value of one
  • 09:13: at a given time and all the others are
  • 09:15: going to be zero
  • 09:16: corresponding to whichever is the active
  • 09:18: quarter
  • 09:20: um and then this is the quarterly
  • 09:23: version of the model
  • 09:24: but you could fit it for any kind of
  • 09:27: time horizon
  • 09:28: you could do a monthly seasonal trend
  • 09:31: model if you have monthly data then you
  • 09:33: would have 12
  • 09:34: different of these dummy variables
  • 09:36: corresponding to
  • 09:38: whether the observation is within that
  • 09:40: month
  • 09:42: and the dummies don't necessarily have
  • 09:45: to correspond to the frequency
  • 09:47: of your data either it could be that you
  • 09:49: have daily data
  • 09:51: but then you're still fitting a
  • 09:54: quarterly model
  • 09:54: if you think the seasonality itself is
  • 09:57: actually quarterly
  • 09:58: you want the frequency of the model to
  • 10:02: line up with
  • 10:03: the frequency of the seasonality rather
  • 10:06: than
  • 10:06: the frequency of the data
  • 10:11: so that's a quick overview of
  • 10:15: forecasting these more complex time
  • 10:17: series
  • 10:18: we'll come back in the following videos
  • 10:20: to look
  • 10:21: at estimating this quarterly seasonal
  • 10:23: trend model
  • 10:24: and then using the auto forecasting
  • 10:28: through a profit with fin statement
  • 10:31: so thanks for listening and see you next
  • 10:36: time

Complex Time-Series Forecasting in Python - Manual Method


Notes

  • To estimate the quarterly seasonal trend model, most of the work is in setting up the data

  • We need to create a t variable as well as dummies for the quarters

  • While it would not be too difficult to manually calculate dummies, thankfully pandas has a get_dummies method

  • We still follow the same general forecasting process: fit the model on historical, use it to predict the future

  • In contrast to the standard linear trend model, when fitting we just add the coefficient of the dummy variable which corresponds to the current month

  • pandas date_range is useful to generate our future dates for prediction

  • We can use pandas concat to put together the historical and forecasted series to generate a single plot

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick dear burtis teaching you
  • 00:05: financial modeling
  • 00:06: today i'm going to be talking about
  • 00:08: complex
  • 00:09: time series forecasting in python
  • 00:13: and this is going to be covering the
  • 00:16: manual method
  • 00:17: whereas we will look at a more automated
  • 00:19: approach
  • 00:20: in the following video this is part of
  • 00:23: our lecture series on free cash flow
  • 00:25: estimation
  • 00:26: and forecasting
  • 00:29: so we already covered uh basically what
  • 00:33: a complex time series is and um
  • 00:36: when you would want to use one of these
  • 00:38: more complex models to forecast it
  • 00:40: and now we're just going into the actual
  • 00:43: example
  • 00:44: of how to carry that out
  • 00:47: so we're going to look in this video at
  • 00:49: applying the quarterly
  • 00:50: seasonal trend model to be able to
  • 00:53: forecast
  • 00:54: quarterly data which has seasonal
  • 00:57: effects in it
  • 00:59: so let's go over to the jupiter notebook
  • 01:01: which is on the core site so i'd
  • 01:03: encourage you to go through it
  • 01:05: on your side as well
  • 01:11: so the first thing that we have to do is
  • 01:14: load in the data so that we can work
  • 01:18: with it
  • 01:18: so i'm going to use a fin statement here
  • 01:21: in order to
  • 01:23: load the data into the financial
  • 01:26: statement structure
  • 01:29: so it's taking a second to load
  • 01:31: everything in
  • 01:33: and then we should see the statements
  • 01:36: come up here when it's done
  • 01:39: now you'll see some other output coming
  • 01:41: out here um
  • 01:43: basically items which it wasn't able to
  • 01:45: load into statement items
  • 01:48: as long as you don't see anything
  • 01:51: important here then you should be fine
  • 01:58: and the other warning here is about
  • 02:01: both operating income and abbott were in
  • 02:04: the statement
  • 02:05: and so it used the value from ebit
  • 02:09: so then we see the statements here it's
  • 02:12: loaded them in
  • 02:13: properly and we see all the different
  • 02:16: line items on the statements
  • 02:23: and we're working with quarterly data
  • 02:25: here
  • 02:26: and we have um 39
  • 02:29: different periods here so this goes out
  • 02:32: quite far
  • 02:34: so plenty of data to work with the
  • 02:36: forecast
  • 02:38: so the first thing we can do is plot uh
  • 02:43: the item that we want to forecast so
  • 02:45: let's look at forecasting the revenue
  • 02:47: here
  • 02:49: and with in statement when you pull out
  • 02:53: um a line item from these statements
  • 02:57: um then it's going to be a pandas series
  • 03:01: and so that's why we can do.plot that
  • 03:03: line on that series in order to see it
  • 03:06: plotted over time
  • 03:08: so looking at the sales data here
  • 03:12: this is you know what we had seen in the
  • 03:15: prior
  • 03:15: video on the slides there is definitely
  • 03:19: a repeating pattern
  • 03:20: going on here in the data there seems to
  • 03:22: be a trend as well
  • 03:24: but we definitely need a more complex
  • 03:27: model in order to capture
  • 03:29: the seasonality shown here with the
  • 03:31: repeating patterns
  • 03:34: so let's look at using the
  • 03:37: quarterly seasonal trend model and in
  • 03:40: order to do that
  • 03:41: we're going to have to create these
  • 03:43: dummy variables as we
  • 03:44: explained in the prior video
  • 03:48: so again that's just uh data that we're
  • 03:51: working with
  • 03:52: a quick look at it and now we can make a
  • 03:56: data frame
  • 03:57: out of that because we're going to need
  • 03:59: to add additional columns here
  • 04:04: and so we can create a t variable
  • 04:07: and we looked in a
  • 04:10: prior video on simple time series
  • 04:12: forecasting with the
  • 04:15: linear trend model one way to do that
  • 04:17: with set index
  • 04:18: here's another way that we can create
  • 04:20: this t variable with with range
  • 04:24: so either way it works just fine
  • 04:29: um and here's just a look at the end of
  • 04:32: the data we can see it's going out to
  • 04:33: the 39th period
  • 04:34: with t equals 38 so it all looks correct
  • 04:40: so in order to get to four dummy
  • 04:43: variables which are
  • 04:44: one when this
  • 04:48: um certain period is within a certain
  • 04:52: quarter
  • 04:53: and zero otherwise first we need to get
  • 04:56: a variable which says
  • 04:57: what month is the observation in
  • 05:03: so thankfully um dates
  • 05:07: in heinous the pandas panda's timestamp
  • 05:10: datatype does have a dot month
  • 05:13: attribute so you can just directly pull
  • 05:15: out the month from the date
  • 05:19: so we can take the index basically
  • 05:23: which has all these states um
  • 05:27: and take take them out of there and take
  • 05:30: the month
  • 05:31: out of each one so that's what we're
  • 05:35: doing but we're just
  • 05:36: putting that all into a list
  • 05:37: comprehension to do them all
  • 05:39: at once and create a new variable the
  • 05:42: month variable
  • 05:43: column with those months
  • 05:48: so then we see here it's january and we
  • 05:51: get one of the month
  • 05:52: then april we get four july we get seven
  • 05:55: october we get 10 and then that pattern
  • 05:59: just keeps repeating even though we go
  • 06:01: into the next year we get those same
  • 06:03: values for the month variable
  • 06:08: so um you know certainly
  • 06:11: we could write some logic which creates
  • 06:15: these variables
  • 06:16: based off these values uh just i was
  • 06:19: saying
  • 06:20: is it equal to one well this one's gonna
  • 06:21: be one otherwise zero is equal to four
  • 06:23: well the second one is gonna be equal to
  • 06:24: one otherwise zero and so on
  • 06:27: but it's a little tedious and this is
  • 06:29: definitely a common thing that people
  • 06:30: have to do and so pandas has created
  • 06:32: this
  • 06:33: get dummies function
  • 06:36: which is going to be able to do this for
  • 06:38: us
  • 06:40: so you just pass it the data frame and
  • 06:42: then you pass it what columns you want
  • 06:44: to make the dummies on
  • 06:45: here it's just the month column and
  • 06:48: you can see in the created data frame
  • 06:51: that now it has dummies saying
  • 06:54: is this the first month is this the
  • 06:57: fourth month
  • 06:58: seventh and tenth month um so there we
  • 07:00: see
  • 07:01: now we have what we need for these
  • 07:03: quarterly dummies because
  • 07:05: every time it's first quarter we get a
  • 07:06: one here um
  • 07:08: and otherwise it's zero every time it's
  • 07:11: second quarter
  • 07:12: we get a one here otherwise it's zero
  • 07:15: and so on so this is what we need in
  • 07:18: order to pick up the seasonal effect
  • 07:24: so
  • 07:27: here is just putting those steps into
  • 07:30: a function so that it
  • 07:33: you can just immediately have the data
  • 07:36: frame that you need for forecasting
  • 07:38: from a series
  • 07:41: and so you can see here i'm passing it
  • 07:43: the cache
  • 07:45: and it's making a whole the full uh
  • 07:47: forecasting data frame
  • 07:49: for the cache as well so now um
  • 07:53: if you want to go forward with the
  • 07:54: quarterly seasonal trend model
  • 07:56: you can just use this function in your
  • 07:59: own model to prepare
  • 08:00: the data frame
  • 08:05: so now we're going to go and fit the
  • 08:08: model
  • 08:09: um and so we're going to go through the
  • 08:12: classic
  • 08:13: stats models ols approach
  • 08:16: um but we need to tell it that the t
  • 08:20: as well as each of these columns are
  • 08:22: going to be our variables
  • 08:24: and depending on your company
  • 08:27: it's gonna have the quarters uh in
  • 08:29: different months
  • 08:31: and so we certainly can explicitly say
  • 08:34: that the
  • 08:35: columns should be month one month four
  • 08:36: etc
  • 08:38: but then if you try to run a different
  • 08:41: company
  • 08:42: through the same code then it's not
  • 08:43: going to work necessarily because the
  • 08:45: quarters could be different
  • 08:47: so there is a general way we can do this
  • 08:49: that's going to work for
  • 08:50: any company is we can just
  • 08:54: grab the columns which have month and
  • 08:56: the name
  • 08:58: um so we can see
  • 09:01: um that if we just
  • 09:04: uh start from the columns
  • 09:09: which will tell us all the columns and
  • 09:11: we iterate through them with this list
  • 09:13: comprehension
  • 09:14: and we just say if the string month is
  • 09:17: in the column
  • 09:18: then we're going to include it in this
  • 09:19: list and so that's how we get
  • 09:22: uh these four different month columns
  • 09:25: automatically regardless of
  • 09:27: what the actual month was
  • 09:30: then all the x columns are going to be t
  • 09:32: plus those
  • 09:34: and so now we can go to rather
  • 09:36: regression
  • 09:37: so importing stats models as usual
  • 09:40: running the ols regression with the y
  • 09:44: is going to be uh whatever our
  • 09:47: variable of interest for forecasting um
  • 09:50: the revenue here
  • 09:52: and then the x we've already selected
  • 09:54: the x columns and we just want to add
  • 09:56: the constant to that
  • 09:58: and then we fit and see the summary
  • 10:02: and so here then we're able to see
  • 10:05: that we have the intercept and we have
  • 10:07: the t coefficient as well as the
  • 10:08: coefficient
  • 10:09: for each one of these monthly quarterly
  • 10:11: dummy variables
  • 10:15: so then we can go and predict the future
  • 10:20: also we can see that the r squared was
  • 10:23: quite high that's a good sign
  • 10:25: that we're going to have a decent
  • 10:26: forecast
  • 10:31: so we need to predict the next period
  • 10:34: in order to do that we need to know well
  • 10:37: what
  • 10:37: t uh is for the next period
  • 10:41: so we can just take the maximum of the t
  • 10:43: that's already there
  • 10:44: and then add one to it and that's going
  • 10:46: to get the next t
  • 10:50: and we want to do the same with the
  • 10:53: dummies we've got to be able to select
  • 10:54: the appropriate dummy
  • 11:00: and so we see that the last quarter was
  • 11:03: uh month seven and so the next one is
  • 11:07: going to be month 10.
  • 11:10: um so in order to get the forecast
  • 11:13: then we take the constant we add the t
  • 11:16: variable times uh this t that we
  • 11:19: calculated
  • 11:20: and then we add on the dummy
  • 11:22: corresponding to the month
  • 11:25: that this observation is in and we get
  • 11:28: our result there
  • 11:31: but it's a little hard to see you know
  • 11:32: especially with these seasonal patterns
  • 11:34: if just forecasting a single period is
  • 11:36: working correctly really you have to
  • 11:38: to bring it out further um and so let's
  • 11:42: look at how we can do that
  • 11:45: so we want to forecast for a number of
  • 11:47: dates in the future
  • 11:49: um and so
  • 11:52: we can use pandas date range
  • 11:55: function in order to create a range of
  • 11:57: dates that we want to forecast
  • 12:00: and so we're going to start from our
  • 12:02: last quarter
  • 12:04: we're going to have periods every three
  • 12:06: months
  • 12:07: and we're going to have 12 periods and
  • 12:10: that's what gets us
  • 12:11: to this here where
  • 12:14: the first period is
  • 12:18: the last one here and
  • 12:22: then we are going to every period in the
  • 12:24: future
  • 12:26: up to 12 periods
  • 12:30: so then we can create the forecast
  • 12:34: for all these different periods with a
  • 12:36: loop here so just going to loop through
  • 12:38: the forecast states and also
  • 12:41: use enumerate to get a counter variable
  • 12:44: so that we can
  • 12:45: adjust t appropriately
  • 12:48: and store all the forecasts in a
  • 12:50: dictionary um
  • 12:52: so we want the
  • 12:56: first uh forecasted period
  • 12:59: to be adding one
  • 13:02: on to the uh previous t and so
  • 13:06: we can call that the t offset and that's
  • 13:08: going to be the counter plus one so that
  • 13:10: it's one on the first loop
  • 13:13: and so then the t is going to be
  • 13:16: what the last t was plus this offset
  • 13:18: variable
  • 13:20: and then we can pull out the month of
  • 13:23: the
  • 13:24: specific date that we're working with
  • 13:26: and then assign into the forecast
  • 13:28: dictionary
  • 13:29: the result of our prediction same thing
  • 13:32: that we saw before
  • 13:33: constant plus the t times this t
  • 13:35: variable
  • 13:36: and now we're just pulling the
  • 13:38: appropriate month
  • 13:40: using string formatting so we do that
  • 13:43: and we see we get all these forecasts
  • 13:46: here
  • 13:50: so then we can create a series
  • 13:54: from the forecast because it's a
  • 13:56: dictionary
  • 13:57: we can just directly create a series
  • 13:59: from it
  • 14:01: and then we can plot that so
  • 14:04: uh this definitely looks like some of
  • 14:07: the patterns we have been seeing in the
  • 14:08: historical so that's already a good sign
  • 14:12: but it's really best to evaluate the
  • 14:13: forecast when also looking at it with
  • 14:15: the historical
  • 14:17: so we can use pandas's concatenate
  • 14:20: function concat um pass it a list of the
  • 14:24: two series
  • 14:25: the historical as well as the forecasted
  • 14:29: that creates the full uh series with all
  • 14:32: those values and then we can plot that
  • 14:35: and now we see the whole thing um
  • 14:38: so it looks like this turned out pretty
  • 14:40: well because our forecast here
  • 14:42: started around here and you can really
  • 14:45: barely tell
  • 14:46: where uh the historical stops and the
  • 14:49: forecast it starts
  • 14:50: it does get a little more regular here
  • 14:53: but basically it looks like we did a
  • 14:56: pretty good job
  • 14:57: of forecasting this time series even
  • 15:00: though
  • 15:00: it had this seasonality component
  • 15:04: so that is how we can
  • 15:08: deal with seasonality and time series
  • 15:11: forecasting
  • 15:12: and python with a more manual approach
  • 15:15: and then we'll come back in the
  • 15:16: following video
  • 15:18: to look at uh using fence statement
  • 15:21: to kind of do this automatically for us
  • 15:24: without
  • 15:25: so many steps so thanks for listening
  • 15:28: and see you next time

Complex Time-Series Forecasting in Python - finstmt Method


Notes

  • We need to install fbprophet to work through this exercise

  • This is the first package we have installed which needs to be installed by Anaconda rather than pip as there are additional non-Python dependencies

  • You can change the default forecast method for your statements in finstmt with stmts.config.update_all

  • “auto” is the forecast method which uses fbprophet in the background to fit the model. fbprophet takes some time to do its work

  • finstmt handles balancing the balance sheet for you. This also will take substantial time if you are forecasting many periods

  • fcst_stmts.plot can plot all the line items or just a subset, including the historical, forecasted, and confidence interval

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick durabartis teaching you
  • 00:05: financial modeling today we're going to
  • 00:07: be talking about
  • 00:08: forecasting complex time series in
  • 00:11: python
  • 00:12: using the fin statement package this is
  • 00:15: part of our lecture series
  • 00:16: on free cash flow estimation and
  • 00:19: forecasting
  • 00:21: so we already talked about a simple
  • 00:24: versus complex time
  • 00:25: series and uh some basic uh
  • 00:30: models that you would want to use for
  • 00:31: each and we also
  • 00:33: already looked at an example of how to
  • 00:36: fit the quarterly seasonal trend model
  • 00:39: for complex
  • 00:40: uh seasonal time series uh in python
  • 00:44: now this video is focused on
  • 00:47: uh using a more automated approach to
  • 00:50: dealing with complex time series
  • 00:52: which is going to be able to handle
  • 00:54: additional
  • 00:55: types of complexity beyond just the
  • 00:58: seasonality
  • 01:00: so let's go over to the jupiter notebook
  • 01:02: which is on the course site
  • 01:04: the quarterly financial statements
  • 01:07: notebook so i encourage you to follow
  • 01:08: along
  • 01:09: on your end as well
  • 01:13: so we're working here on the forecasting
  • 01:16: using the automated software approach
  • 01:18: section and before i discuss
  • 01:23: we have some installation things to talk
  • 01:24: about here i'm just going to go ahead
  • 01:26: and
  • 01:27: get this forecast running because it
  • 01:29: does take a little bit of time to do
  • 01:32: that
  • 01:37: so and then if you're just jumping into
  • 01:39: this you would want to first run this
  • 01:41: this first block
  • 01:42: in the notebook to get the statements to
  • 01:44: find an infant statement
  • 01:48: um but so in order to
  • 01:52: do the automated complex time series
  • 01:56: approach
  • 01:56: and fin statement it actually uses
  • 02:00: another package under the hood this uh
  • 02:03: profit package developed by
  • 02:05: facebook which they use for their own
  • 02:08: forecasting
  • 02:09: um and is flexible to a lot of
  • 02:13: um features of the data as well as bad
  • 02:16: data such as missing and
  • 02:18: outliers so it's a very nice
  • 02:22: system that they've developed for
  • 02:24: forecasting
  • 02:25: and it's just plugged into fin state
  • 02:27: mode
  • 02:29: now it doesn't automatically get
  • 02:31: installed when you install fin statement
  • 02:33: if you try to use the automated approach
  • 02:36: infant statement it will without
  • 02:37: installing
  • 02:39: fb profit it will say hey you need to
  • 02:41: install fb profit in order to
  • 02:43: use this approach you can use the other
  • 02:47: forecasting methods and invent statement
  • 02:50: trend compounded annual growth recent
  • 02:53: and average approaches you can use all
  • 02:56: those
  • 02:56: without any other dependencies but the
  • 02:59: auto approach
  • 03:00: does take this at the profit um
  • 03:04: and the installation for this is um
  • 03:08: a little different than what we looked
  • 03:10: at previously in the course
  • 03:11: uh because actually fb profit
  • 03:15: is not 100 python there's actually a c
  • 03:20: plus plus component in there and so
  • 03:23: you can't just install it regularly with
  • 03:26: the regular method for installing python
  • 03:30: packages
  • 03:32: um but i have encouraged everyone to use
  • 03:35: anaconda
  • 03:36: in this course because anaconda does
  • 03:38: make this process still pretty easy
  • 03:40: without anaconda
  • 03:42: it's fairly complicated to get all this
  • 03:44: set up
  • 03:45: but with conda it's still just one line
  • 03:48: that you're gonna run
  • 03:50: but where you run that does matter
  • 03:52: before we've done the installing
  • 03:54: within jupiter um but in this case
  • 03:58: you're gonna need to go um to the
  • 04:01: anaconda prompt
  • 04:03: um so if you're in windows you can just
  • 04:07: type anaconda
  • 04:08: into the search and you'll see this
  • 04:11: anaconda prompt come up you should be
  • 04:14: able to access it similarly on mac
  • 04:17: and if you can't find it you can also go
  • 04:19: to the anaconda navigator and you should
  • 04:20: see the command prompt
  • 04:22: in there so you can go that approach as
  • 04:24: well
  • 04:26: but you should see something like this
  • 04:29: when you open that up um
  • 04:33: and you'll want to make sure
  • 04:38: i don't think this is necessary on mac
  • 04:40: but at least on windows
  • 04:42: that you run as administrator
  • 04:45: so when you see this pop up then you
  • 04:47: right click and you do run it as
  • 04:49: administrator
  • 04:50: it does that little pop-up and then you
  • 04:53: can see it it says
  • 04:54: administrator up here in the top left
  • 04:59: um and so the command that you need to
  • 05:01: put in there
  • 05:02: conda that's anaconda's package manager
  • 05:05: comma install
  • 05:06: c condoforge fbprofit so put that
  • 05:10: exactly in there and hit enter and then
  • 05:12: you'll see
  • 05:13: this collecting package metadata solving
  • 05:16: environment stuff
  • 05:17: it takes a little bit of time because it
  • 05:18: actually does need to install a lot of
  • 05:20: things to make this work
  • 05:22: and then eventually you'll see something
  • 05:25: like this
  • 05:26: um where it says hey i'm going to
  • 05:28: install a bunch of things
  • 05:30: and you just need to put y and hit enter
  • 05:32: to proceed
  • 05:34: then it's going to you go ahead and
  • 05:38: take some time to install these packages
  • 05:39: eventually you'll see
  • 05:41: uh done and you'll get back to this
  • 05:43: prompt and that's how you know you're
  • 05:44: done
  • 05:45: at that point you can come back and
  • 05:48: restart your kernel
  • 05:50: um and then you'll be ready to go
  • 05:53: for the auto forecasting
  • 05:57: um so
  • 06:01: i'd already done those steps though and
  • 06:02: so i already had it all set up and ready
  • 06:04: to use you only need to do that once
  • 06:06: on a given system
  • 06:11: so then
  • 06:14: the way that we forecast
  • 06:18: using fb profit within fin statement
  • 06:21: is with the auto forecast method um
  • 06:25: so we have currently five different
  • 06:27: forecasting methods
  • 06:29: in event statement compounded annual
  • 06:31: growth rate trend
  • 06:32: mean recent these all
  • 06:35: uh work just with fin statement no
  • 06:37: external package
  • 06:39: then this auto which uses that be profit
  • 06:44: and so just to see how it works for
  • 06:46: everything uh we can
  • 06:49: use update all to set the forecast
  • 06:52: method to auto for every item
  • 06:57: and so we'll see now in the forecast
  • 07:00: assumptions
  • 07:02: that we have method auto
  • 07:05: for all these items
  • 07:09: and we ran the forecast which i did a
  • 07:11: moment earlier
  • 07:14: and so now we have the forecast
  • 07:17: statements
  • 07:18: um so you can see because we asked for
  • 07:21: 12 periods here
  • 07:22: that it went ahead and got us 12 periods
  • 07:25: out into the future
  • 07:27: um of the entire financial statements
  • 07:32: and it was also able to detect that the
  • 07:35: historical data was quarterly
  • 07:37: and so it also used a quarterly forecast
  • 07:40: going into the future
  • 07:45: um we'll also notice that um
  • 07:48: the balance sheet is um
  • 07:52: basically uh you know not 100 balance
  • 07:56: but
  • 07:56: it's close so 191 187
  • 08:01: 191 187 um
  • 08:04: and so after the forecast
  • 08:08: is made then statement goes in and
  • 08:09: balances the balance sheet for you
  • 08:14: um so then we have this plotting
  • 08:17: functionality infant statement
  • 08:18: so we can do plot on the forecasted
  • 08:21: statements
  • 08:22: and we can give it a subset to say which
  • 08:25: items we want to plot
  • 08:26: um or we can plot the entire results
  • 08:30: with just doing plot and no arguments
  • 08:34: and so um looking at
  • 08:38: some of these forecasts um
  • 08:41: you know we can look at the revenue here
  • 08:43: we can see the points here are the
  • 08:45: historical the black points
  • 08:47: um and then we don't have those once we
  • 08:50: get into the future
  • 08:51: and uh we start to see a confidence
  • 08:54: interval on the forecast in the future
  • 08:57: um and we can see that it seems to have
  • 08:59: picked up this pattern well
  • 09:00: even though we didn't um you know
  • 09:03: tell it anything about this is seasonal
  • 09:06: data or anything it just was able to
  • 09:07: pick up that pattern
  • 09:10: and when we look at all the plots we see
  • 09:12: those kinds of patterns
  • 09:14: going on in a bunch of these different
  • 09:16: line items and it was able to pick that
  • 09:18: up
  • 09:19: in most cases
  • 09:28: so yeah again looking at the forecast
  • 09:30: assumptions we can see the method was
  • 09:31: set to auto for all these items
  • 09:34: except for the uh items which are
  • 09:37: ultimately
  • 09:38: uh being used as a plug to balance the
  • 09:40: balance sheet so cash and long term debt
  • 09:42: will be adjusted
  • 09:44: uh because they're the plug items you
  • 09:46: can also change that in the config
  • 09:47: if desired
  • 09:51: um you can also pull out individual
  • 09:55: forecasts like that you get a forecast
  • 10:00: object and you can
  • 10:04: see what the model was
  • 10:07: and that can tell you some things about
  • 10:13: results etc so there's a lot more detail
  • 10:17: if you want to dig in there
  • 10:21: you can also access the plots that way
  • 10:23: get nice
  • 10:24: full-size plots
  • 10:28: in order to look at any individual item
  • 10:32: so we have this whole
  • 10:35: configuration system in fin statement
  • 10:38: where you can update how any item is
  • 10:40: forecasted
  • 10:42: so if you do tab complete on the
  • 10:44: statements object you'll see
  • 10:46: all the different line items so that
  • 10:49: would be
  • 10:50: like the the key for the
  • 10:53: item and you can update it by
  • 10:58: that key and config
  • 11:01: so we can do a config update on sgna
  • 11:05: and the forecast config to make it a
  • 11:07: percentage of
  • 11:08: revenue um if this is a company that
  • 11:12: uh their wages scale uh with their
  • 11:14: product very easily
  • 11:17: and uh we can update the interest
  • 11:20: expense
  • 11:21: to now be forecasted with the mean
  • 11:23: approach because when we look back
  • 11:25: at the and let me just get this running
  • 11:27: because it's going to take some time
  • 11:31: oh whoops i didn't actually run that
  • 11:34: update
  • 11:38: um so when we look back at the interest
  • 11:41: expense
  • 11:42: forecast um
  • 11:46: we can see that
  • 11:50: it is basically picking up some kind of
  • 11:52: seasonality component there but it
  • 11:54: doesn't seem to really
  • 11:56: exist um
  • 11:59: really it looks like an average is is
  • 12:02: probably a reasonable way to go with
  • 12:04: these data because they're kind of just
  • 12:05: going up and down around
  • 12:07: basically an average
  • 12:11: and so we can shift just specifically
  • 12:14: that item to be forecasted
  • 12:16: with the the average or mean approach
  • 12:18: instead of using this auto approach
  • 12:21: so this is you know a typical um
  • 12:24: procedure for this you kind of just
  • 12:27: you know pick a method and and go um or
  • 12:31: even just let it take the defaults for
  • 12:32: everything and go
  • 12:34: uh with the forecast and then you look
  • 12:36: over all the plots and
  • 12:38: you just look through and say does
  • 12:40: anything
  • 12:41: look like maybe the forecast is not
  • 12:43: fitting very well so interest expense
  • 12:45: kind of stands out
  • 12:49: don't worry about the cash and debt
  • 12:51: because those are the plugs so they're
  • 12:53: being adjusted just to make sure that
  • 12:55: uh the balance sheet can balance um but
  • 12:58: just looking through the others
  • 13:00: they seem to generally seem
  • 13:03: fine um
  • 13:07: goodwill's kind of difficult here
  • 13:09: because the last four periods have been
  • 13:11: high
  • 13:11: but that was much higher than the rest
  • 13:12: so it's not too clear maybe the recent
  • 13:15: approach should be better here to just
  • 13:16: keep it flat lined at that level
  • 13:21: and rest seemed to generally look like
  • 13:24: the forecast
  • 13:25: fit pretty well
  • 13:30: let's come down and see if it finished
  • 13:32: yep it finished with the
  • 13:34: adjusted forecast so we have new
  • 13:38: statements there and we can look at the
  • 13:41: plot of
  • 13:43: sg a and interest expense
  • 13:47: um and now we can see
  • 13:51: whereas before um
  • 13:54: and here let me just yeah we can see
  • 13:57: before that
  • 13:58: um the stna forecasts
  • 14:02: was just on its own not a percent of
  • 14:04: anything it's
  • 14:05: it's forecasting the level um but now we
  • 14:08: can see
  • 14:10: because we adjusted the config to make
  • 14:12: it a percentage of revenue
  • 14:14: and we adjusted interest expense to be
  • 14:16: the mean
  • 14:17: now we have sg a expense
  • 14:21: as a percentage of revenue is being
  • 14:23: forecasted
  • 14:25: and the um interest expense is now using
  • 14:29: an average method um
  • 14:33: and even though we switched sgna to be a
  • 14:36: percentage
  • 14:37: method we didn't have to do anything
  • 14:39: else
  • 14:40: fen statement is able to handle
  • 14:42: ultimately translating that back
  • 14:44: into the levels for the forecast
  • 14:50: um and so then it's it's also often the
  • 14:53: case
  • 14:54: that so you've gone through you've
  • 14:58: done the initial forecast you've
  • 15:00: reviewed all the plots you've adjusted
  • 15:02: the methods
  • 15:03: so that now all the plots look good
  • 15:07: but that's still kind of just the
  • 15:09: baseline forecast
  • 15:11: you may want to manually adjust the
  • 15:13: forecast
  • 15:15: based off of information that you have
  • 15:17: about the company which is not reflected
  • 15:19: in the historical financials
  • 15:22: so if you know that the uh maybe they
  • 15:25: just made an acquisition which is going
  • 15:26: to increase the size of the company or
  • 15:28: maybe they're starting a new project
  • 15:30: which is
  • 15:31: uh substantially more risky than their
  • 15:33: previous projects
  • 15:35: there are a lot of different
  • 15:39: pieces of information that could
  • 15:41: ultimately adjust your forecast in the
  • 15:42: future
  • 15:44: um and so in a statement you're able to
  • 15:48: take the existing forecast and make
  • 15:50: adjustments uh to it
  • 15:53: so there's two ways
  • 15:56: you can you do adjustments or
  • 15:59: replacements
  • 16:00: so adjustments going to take the
  • 16:01: forecast that was there and
  • 16:04: tweak it upwards or downwards and
  • 16:06: replacements are actually going to
  • 16:09: change what the forecast value is and
  • 16:11: just drop
  • 16:12: in whatever um you wanted to have
  • 16:15: instead
  • 16:17: so what we're going to do here
  • 16:20: is here first we're adjusting cash
  • 16:24: so uh the cash um
  • 16:28: we're gonna make a list of zeros so zero
  • 16:31: adjustment
  • 16:32: then just set the second period here to
  • 16:35: 40
  • 16:36: increase and so now that is going to
  • 16:39: make it so that
  • 16:40: our second forecasted period of cash is
  • 16:44: going to grow by 40
  • 16:46: and then go back to the regular uh
  • 16:49: forecasting and then
  • 16:53: with the second one uh we're doing that
  • 16:55: on revenue
  • 16:56: and um by default this is gonna adjust
  • 17:00: with growth rates so you can pass
  • 17:01: use levels equals true to for to
  • 17:04: adjust or replace on the level of the
  • 17:06: item
  • 17:07: um and here going to set the second
  • 17:10: period
  • 17:12: uh forecasted revenue to 80 billion
  • 17:15: uh directly just replacing what that
  • 17:17: value was
  • 17:18: so we can do that and then plot it to
  • 17:20: see the
  • 17:21: results of that
  • 17:24: so we can see in the revenue that the
  • 17:27: original forecast was much higher
  • 17:29: now we've replaced it by this 80 billion
  • 17:32: and so that one period just drops down
  • 17:34: before going back to normal
  • 17:37: um and then looking here over here on
  • 17:40: the cache
  • 17:41: we can see after this first period
  • 17:44: then it has this big jump where it's
  • 17:47: growing by
  • 17:48: 40 and then goes back to the
  • 17:52: original forecast
  • 17:55: so um that's a quick overview
  • 17:59: of um
  • 18:02: doing forecasts on complex time series
  • 18:05: with in statement so thanks for
  • 18:08: listening
  • 18:08: and see you next time

Complex Time-Series Forecasting Lab Overview


Notes

  • The exercise here is very similar to the examples we just worked through

Transcript

  • 00:02: hey everyone this is nick duraburtis
  • 00:04: teaching you financial modeling
  • 00:06: today we're just going to be quickly
  • 00:08: going over the
  • 00:09: lab exercise for the
  • 00:12: complex time series forecasting material
  • 00:16: this is part of our lecture segment on
  • 00:18: free cash flow estimation
  • 00:20: and forecasting so
  • 00:23: we finished covering all the complex
  • 00:26: forecasting material
  • 00:27: including the two videos which
  • 00:30: go over how to apply this in python
  • 00:34: using the manual approach with the
  • 00:37: quarterly seasonal trend model as well
  • 00:39: as the automated software approach
  • 00:41: within statement
  • 00:42: and profit and
  • 00:45: now in order to test knowledge of that
  • 00:47: material we have this
  • 00:49: complex forecasting lab so if you go to
  • 00:52: the course site you can download
  • 00:54: caterpillars balance sheet and income
  • 00:57: statement
  • 00:58: and you want to use those to
  • 01:01: forecast uh the next four periods
  • 01:05: which will be one year worth of data
  • 01:08: of the cash and you want to do that with
  • 01:11: both the quarterly seasonal
  • 01:14: trend model as well as the automated
  • 01:17: software approach and you want to plot
  • 01:21: both to see the results
  • 01:23: so really it's going to be very similar
  • 01:26: to
  • 01:27: what we've done in the
  • 01:31: two example videos here
  • 01:34: so you can just take that example
  • 01:36: notebook and i would
  • 01:39: you know recommend playing around with
  • 01:41: it trying to see how it works but then
  • 01:42: you can just kind of take the
  • 01:45: um functions and bring them into your
  • 01:47: own notebook
  • 01:48: um in order to do this with caterpillar
  • 01:52: instead of walmart
  • 01:55: so that's basically what's involved
  • 01:59: in this lab so thanks for listening and
  • 02:02: see you next time

Applying Forecasting to Free Cash Flows


Notes

  • Everything we’ve learned on forecasting thus far is general to anything you want to forecast. Now let’s see what matters for financial statements specically

  • It is generally preferred to forecast statement line items rather than FCFs directly, as FCFs tend to be very noisy and hard to predict from the time-series

  • Do not forecast calculated items. Forecast their components then calculate them

  • Balancing the balance sheet is an additional step unique to financial statement forecasting

  • Almost definitely after doing your initial forecasts, your balance sheet will be significantly off from balancing. But we know from accounting that it has to balance

  • Usually cash or debt are adjusted as “plugs” through an optimization process

  • finstmt makes this happen automatically, but also gives you full control over which line items are used as plugs and how closely to balance it. Balancing closer will take longer.

Transcript

  • 00:02: hey everyone
  • 00:03: this is nick dear burtis teaching you
  • 00:05: financial modeling today
  • 00:07: we're going to be talking about applying
  • 00:09: forecasting
  • 00:10: to free cash flows specifically
  • 00:14: this is part of our lecture series on
  • 00:16: free cash flow estimation
  • 00:17: and forecasting
  • 00:20: so we've had a number of videos going
  • 00:24: over
  • 00:25: general forecasting uh how to forecast
  • 00:28: basically any kind of time
  • 00:29: series whether that be statement line
  • 00:32: items
  • 00:33: free cash flows or whatever else
  • 00:38: but here we're trying to take it to
  • 00:40: specifically
  • 00:42: applying these general forecasting
  • 00:44: techniques
  • 00:45: in the context of future free cash flows
  • 00:52: so we have two general ways to go about
  • 00:55: forecasting these free cash flows one
  • 00:59: is to look at his the historical
  • 01:02: free cash flows and do the forecast on
  • 01:05: those
  • 01:06: and the other is to forecast
  • 01:10: the entire financial statements and then
  • 01:12: calculate
  • 01:13: the future free cash flows from those
  • 01:16: forecasted financial statements
  • 01:21: generally you're almost always going to
  • 01:24: want to
  • 01:25: forecast the financial statements
  • 01:30: with a big reason being that when you
  • 01:33: just forecast the free cash flows you
  • 01:35: don't really have any flexibility
  • 01:37: uh you know you can just adjust it up or
  • 01:39: down but it's not really clear
  • 01:41: um you know how the operations translate
  • 01:44: into the free cash flows directly
  • 01:47: um whereas it's easier to say
  • 01:50: um well the the company is opening a new
  • 01:53: branch
  • 01:55: uh they have 20 branches now they're
  • 01:58: gonna have 21
  • 01:59: so maybe we'll see like up to an
  • 02:00: additional five percent sales bump
  • 02:03: um so you can't easily just
  • 02:06: put that into a free cash flow number
  • 02:08: without doing this
  • 02:10: full forecast of the full financial
  • 02:12: statements
  • 02:15: and the other reason that generally
  • 02:19: forecasting the statements is preferred
  • 02:20: is because free cash flows
  • 02:22: can be very noisy and irregular if you
  • 02:25: look at the history
  • 02:26: it may be that in one year they bought a
  • 02:28: big building and so that year
  • 02:30: has way lower free cash flows than all
  • 02:32: the other years
  • 02:35: and because these large capital
  • 02:37: expenditures can
  • 02:38: really shift the free cash flows it's
  • 02:42: uh a difficult exercise to try and get a
  • 02:45: good look
  • 02:45: at future free cash flows only from
  • 02:48: the historical free cash flows now if
  • 02:51: it's
  • 02:52: been very stable in the past and the
  • 02:54: company doesn't have any
  • 02:56: big plan capital expenditures then it
  • 02:58: might be an okay approach
  • 03:01: um so under those conditions and
  • 03:04: especially
  • 03:05: when you just need to quickly get
  • 03:07: together a model and you don't have time
  • 03:09: to go through this full financial
  • 03:10: statement
  • 03:11: forecasting approach um that can be
  • 03:14: another reason to go with it
  • 03:16: but generally it's not preferred
  • 03:19: um where it is helpful to do that
  • 03:23: free cash flow direct forecast is if
  • 03:25: you've already done your financial
  • 03:26: statement forecast you've already
  • 03:28: calculated
  • 03:29: future free cash flows from that then
  • 03:32: you can just
  • 03:32: also do this as a check on the side well
  • 03:34: what if i just directly forecasted the
  • 03:36: historical free cash flows
  • 03:38: how similar does that look to my new
  • 03:41: calculated ones
  • 03:46: so uh the preferred approach
  • 03:49: as we said is to forecast the entire
  • 03:51: financial statements
  • 03:52: um what line items should you forecast
  • 03:56: out of that um
  • 03:59: so you want to
  • 04:02: focus on items which are not
  • 04:06: calculated um
  • 04:09: so like sales
  • 04:12: should definitely be forecasted cost of
  • 04:14: goods sold
  • 04:15: sg a but not operating profit because
  • 04:19: operating profit
  • 04:20: represents sales minus cogs minus sg
  • 04:24: a minus other operating expenses
  • 04:27: um and so it's completely calculated
  • 04:31: from other items
  • 04:32: and so you just fork forecast those
  • 04:34: component items
  • 04:36: and then you can calculate the operating
  • 04:38: profit
  • 04:39: and the forecast you don't have to
  • 04:40: forecast it directly
  • 04:46: so that means that in your future
  • 04:48: financial statements you're going to
  • 04:49: want to have these items
  • 04:50: calculated so
  • 04:54: you know if you're doing this in excel
  • 04:56: that's as simple as just calculating on
  • 04:58: the historical data having your
  • 04:59: forecasted right next to the
  • 05:01: historical and then just dragging that
  • 05:02: over
  • 05:04: um and then in python with the fin
  • 05:07: statement package
  • 05:09: this is going to be handled
  • 05:10: automatically for you
  • 05:16: and thinking about should i just
  • 05:19: forecast the levels
  • 05:21: or should i forecast a percentage
  • 05:25: um so
  • 05:30: when the two items logically scale
  • 05:32: together
  • 05:33: that's when you want to use a percentage
  • 05:38: so we've talked already about this
  • 05:40: example of
  • 05:41: cost of goods sold is typically a
  • 05:43: percentage of sales
  • 05:44: in the forecast because
  • 05:48: uh if the company sells more they need
  • 05:51: to buy
  • 05:52: more inventory in order to sell it and
  • 05:55: go through that whole um processing
  • 05:58: process of creating the inventory
  • 06:00: in order to sell it and that's the cost
  • 06:03: of goods sold
  • 06:04: so for each additional units sold they
  • 06:06: have to expend
  • 06:07: the cost of selling that and if they
  • 06:11: sell fewer units that's also going to be
  • 06:12: a lower associated cost and so
  • 06:15: those two logically scale directly
  • 06:17: together
  • 06:18: and so the cogs
  • 06:22: should be estimated as a percentage of
  • 06:24: the sales
  • 06:26: here interest expense is another good
  • 06:28: example
  • 06:29: the company pays interest as a
  • 06:32: percentage
  • 06:33: on an amount of debt and so it makes
  • 06:36: sense for the interest expense to be
  • 06:37: forecasted as a percentage
  • 06:39: of the total debt um a long-term debt
  • 06:43: could also be a reasonable
  • 06:45: option there for the percentage
  • 06:50: another thing that we have to think
  • 06:52: about which is really specific
  • 06:54: to financial statement forecasting
  • 06:57: is that we got to keep the balance sheet
  • 06:59: balanced
  • 07:00: we know from accounting that
  • 07:04: we always want to have assets equal to
  • 07:07: liabilities plus equity and we've got to
  • 07:10: make sure that relationship
  • 07:12: stays at least close to true and are
  • 07:16: forecast
  • 07:16: for it to be somewhat accurate
  • 07:20: um and so basically the way that you can
  • 07:24: do this is do your initial forecast
  • 07:27: and then adjust a couple of line items
  • 07:29: to make the balance sheet balance
  • 07:33: and so if your asset side
  • 07:37: ends up much greater than your
  • 07:38: liabilities equity side
  • 07:41: that is um indicative
  • 07:45: of by the way that you've forecasted it
  • 07:48: the company doesn't actually have enough
  • 07:50: funds to finance
  • 07:52: the the assets in the company
  • 07:55: so they need to raise those funds by
  • 07:58: some means and so usually
  • 07:59: increasing debt is going to be the
  • 08:01: solution there
  • 08:02: so you're saying in order to support the
  • 08:05: operations
  • 08:06: in the forecast that i've made the
  • 08:09: company needs to take on additional debt
  • 08:11: in order to finance those assets
  • 08:15: whereas if the reverse is true and
  • 08:17: assets are lower
  • 08:19: than liabilities and equity
  • 08:22: that means that the profit the retained
  • 08:24: earnings that have come through
  • 08:26: or additional debt which is forecasted
  • 08:29: to be taken on
  • 08:30: has not been reflected over on the
  • 08:33: assets side
  • 08:34: that hasn't been deployed into any
  • 08:36: assets
  • 08:38: which means that really cash should be
  • 08:40: increased to account for that
  • 08:42: um so really there if your assets are
  • 08:46: lower you're going to
  • 08:48: increase the cash
  • 08:52: so um to operationally
  • 08:55: make this happen um
  • 08:58: again first run your forecast then
  • 09:01: uh do this balancing adjustment
  • 09:06: and these values the cash and debt that
  • 09:09: we just mentioned
  • 09:10: we usually refer to as plugs uh because
  • 09:13: we
  • 09:14: are uh just plugging in the values that
  • 09:17: make the balance sheet balance so that
  • 09:19: the forecast is valid
  • 09:23: so to go about this in excel
  • 09:27: you have all your forecasted financial
  • 09:29: statements
  • 09:30: and then look at the
  • 09:35: total assets look at the total
  • 09:36: liabilities plus equity
  • 09:38: and take the absolute value of the
  • 09:40: difference and have that as a new
  • 09:41: like a difference row
  • 09:44: and then if you're only forecasting a
  • 09:47: single period in the future
  • 09:48: then you can use goal seek to
  • 09:52: set that difference to zero
  • 09:56: and if you've got a multi-year forecast
  • 09:58: as you probably do
  • 09:59: then uh you want to use solver in order
  • 10:03: to
  • 10:04: make that happen so there are plenty of
  • 10:07: resources out there on solver you can
  • 10:09: feel free to google about that
  • 10:13: but you you have to add that as an excel
  • 10:15: add-in which is built-in
  • 10:17: but then you can use it and you
  • 10:18: basically just say take this entire row
  • 10:22: of these difference values and i want to
  • 10:25: minimize
  • 10:26: that so then it's going to
  • 10:30: minimize the total of all of these uh
  • 10:33: values
  • 10:34: and that's going to and you're even
  • 10:36: going to say
  • 10:37: you know adjust cash adjust debt in
  • 10:40: order to make this happen
  • 10:42: so that it should be able to balance the
  • 10:45: balance sheet for you
  • 10:49: um and in python
  • 10:52: um so it's a similar process only you
  • 10:56: would use
  • 10:56: a scipy's minimize function instead of
  • 11:00: solver but if you're using them
  • 11:03: statement
  • 11:04: then this actually is handled
  • 11:05: automatically for you
  • 11:08: so whenever you write a forecast it
  • 11:11: first forecasts all the lambs and then
  • 11:13: it goes through this
  • 11:14: exact balance sheet balancing process
  • 11:18: and by default it's going to use cash
  • 11:20: and debt
  • 11:21: as the plugs but you actually can change
  • 11:24: what the plugs are
  • 11:25: as well if you just adjust the forecast
  • 11:28: configuration um you can change to have
  • 11:31: different
  • 11:32: line items be the plugs as well
  • 11:35: it also defaults to um
  • 11:39: making sure that the balance sheet is
  • 11:40: balanced within ten thousand
  • 11:42: um and you can pass this bs diff max
  • 11:46: um to the forecast method
  • 11:49: in order to change how accurate it
  • 11:51: should be so if
  • 11:52: uh you know your your statements are in
  • 11:55: billions
  • 11:56: um then um
  • 11:59: 10 000 isn't going to make sense there
  • 12:01: because that would be within 10 trillion
  • 12:03: that gives a ton of flexibility way too
  • 12:06: much flexibility
  • 12:08: in that case you may even want to set it
  • 12:09: to like point zero zero one or something
  • 12:12: um so it does matter what your units are
  • 12:15: um for setting that but if your units
  • 12:18: are in dollars
  • 12:19: um then the default of ten thousand is
  • 12:22: usually a pretty good choice
  • 12:24: um and the lower that you set this the
  • 12:27: more closely it's going to balance the
  • 12:29: balance sheet
  • 12:30: but the longer it's going to take to go
  • 12:32: through that process
  • 12:33: so that's another trade up there if you
  • 12:35: have plenty of time for your forecast
  • 12:37: maybe set it lower if you need to get
  • 12:40: this forecast done
  • 12:41: maybe especially as you're testing
  • 12:42: things out
  • 12:44: in development and you're running a
  • 12:45: bunch of different forecasts maybe set a
  • 12:47: little bit higher
  • 12:49: so the forecast can run quicker
  • 12:53: so that's a quick overview of
  • 12:57: taking this forecasting knowledge that
  • 12:59: we already know and
  • 13:00: applying it specifically to free cash
  • 13:03: flows
  • 13:05: so in the next video we'll come back to
  • 13:07: just uh wrap up the dcf model with the
  • 13:10: last portion about the
  • 13:11: terminal value so thanks for listening
  • 13:14: and see you next time

Calculating a Terminal Value


Notes

  • The last piece of the DCF model we have not covered is the terminal value

  • Because it is not possible and certainly not accurate to forecast many years in the future, we use a terminal value to represent the enterprise value at some future date

  • DCF models are extremely sensitive to the terminal value assumptions, so they should absolutely be included in sensitivity analysis and MC simulations

  • In the exit multiple method, we use current valuation ratios with projected financials to estimate the terminal value

  • In the perpetuity growth method, we assume that the FCFs will have constant growth after the forecast period and take the value of those constantly growing FCFs

  • We include the TV in the final FCF year and take the present value to get the current enterprise value, which can then be converted into equity value and stock price

Transcript

  • 00:02: hey everyone this is nick derbertus
  • 00:04: teaching you financial modeling
  • 00:06: today we're going to be talking about
  • 00:08: calculating a terminal
  • 00:10: value this is part of our lecture series
  • 00:13: on
  • 00:13: free cash flow estimation and
  • 00:15: forecasting
  • 00:16: which is part of a broader goal to build
  • 00:18: out the full discounted cash flow
  • 00:20: valuation of a stock
  • 00:24: so this is the last video in the lecture
  • 00:28: series where after this video we'll have
  • 00:32: everything that we need to be able to
  • 00:33: build the full dcf model
  • 00:36: so the last part that we haven't talked
  • 00:38: about is well now we've
  • 00:40: forecasted all these uh future free cash
  • 00:43: flows
  • 00:44: um and from the previous lecture series
  • 00:47: we've we've got the whack
  • 00:48: as well um and we also know how to
  • 00:51: convert between
  • 00:53: uh enterprise value and equity value and
  • 00:55: what those concepts mean
  • 00:57: so the last thing is just how do we take
  • 01:00: these
  • 01:00: free cash flows and the whack and get to
  • 01:04: an enterprise
  • 01:05: value so
  • 01:09: as we mentioned at the beginning of the
  • 01:12: whack lecture series we can
  • 01:16: value any financial asset any ash
  • 01:19: asset that pays cash flows by taking the
  • 01:22: present value of future cash flows
  • 01:26: so in the dcf model for the company
  • 01:30: we have these free cash flows as the
  • 01:33: cash flows
  • 01:34: and the discount rate is going to be the
  • 01:36: whack that we already calculated
  • 01:42: and we
  • 01:45: can forecast out of the future for some
  • 01:48: number of years
  • 01:50: but forecasts
  • 01:53: get less and less accurate the further
  • 01:56: that you go into the future
  • 01:58: and so you really should be uh
  • 02:02: suspicious of any forecast
  • 02:03: which is going out further than five
  • 02:05: years for financial data
  • 02:07: i mean even even five years um
  • 02:11: unless it's a very stable company it's
  • 02:13: it's fairly unlikely you'll be anywhere
  • 02:15: close to the actual numbers
  • 02:17: by five years
  • 02:20: so what about after five years uh if
  • 02:23: even five years is
  • 02:24: suspect what about 15 20 years in the
  • 02:28: future
  • 02:29: the company's still around they're still
  • 02:30: earning free cash flows
  • 02:32: that should be factored into the
  • 02:33: valuation so how do we account for that
  • 02:36: when we know that our forecasts are not
  • 02:39: going to have
  • 02:40: any reasonable degree of accuracy
  • 02:44: what we can do is calculate a terminal
  • 02:47: value
  • 02:48: for the company and that terminal value
  • 02:51: is saying
  • 02:52: at the end of our forecast period how
  • 02:55: much could we
  • 02:56: sell the company for um basically it's
  • 03:00: it's the enterprise value of the company
  • 03:03: at the end of the forecast forecast
  • 03:05: period
  • 03:07: and we can use that instead of
  • 03:10: having to predict cash flows
  • 03:13: all the way out into infinity
  • 03:17: um instead we can have a forecast period
  • 03:21: where we actually have the forecasted
  • 03:23: values and then at the end of that
  • 03:25: we have the terminal value in order to
  • 03:27: say
  • 03:28: um well if we just sold the company then
  • 03:32: how much would we get and if we sell the
  • 03:34: company
  • 03:35: then that's at that point reflective of
  • 03:37: the present value of all
  • 03:39: further future free cash flows so that
  • 03:41: the free cash flows
  • 03:43: starting from year six in this example
  • 03:46: and going out into infinity
  • 03:49: all that is brought into the terminal
  • 03:52: value as
  • 03:53: present value at year five
  • 03:56: and then we have those five years of
  • 03:58: free cash flows along with this terminal
  • 04:00: value which represents the entire future
  • 04:02: and that allows us to have the entire
  • 04:05: feature
  • 04:05: in our present value calculation
  • 04:12: so now how do we get that terminal value
  • 04:16: because
  • 04:17: you just heard me mention that okay this
  • 04:19: is an enterprise value
  • 04:21: at the end of the forecast period but
  • 04:24: we're getting this terminal value in
  • 04:26: order to try to calculate the current
  • 04:28: enterprise value so that in order to get
  • 04:32: the terminal
  • 04:32: value don't we then need an even later
  • 04:35: enterprise value
  • 04:36: like a a terminal value of that terminal
  • 04:39: values
  • 04:40: time period and then in order to get
  • 04:42: that one we're going to do the same
  • 04:43: thing
  • 04:44: and so if we try to go with the same
  • 04:46: approach we would end up with this
  • 04:48: kind of infinitely nested dcf model and
  • 04:51: you would never have a solution
  • 04:55: for your ultimate stock price
  • 04:58: um also we know that basically any
  • 05:01: forecasts
  • 05:02: which are going out beyond this five
  • 05:04: year period are just gonna be junk
  • 05:06: anyway
  • 05:06: so why bother even trying to go through
  • 05:09: that process even if it was solvable
  • 05:12: so we've got to have a different
  • 05:13: approach to get the terminal value
  • 05:18: and there are two approaches which are
  • 05:20: commonly used
  • 05:22: and those are classified into
  • 05:25: x and multiple approaches and the
  • 05:27: perpetuity growth
  • 05:29: method so we'll look at both methods
  • 05:34: and the difference is that the exit
  • 05:36: multiple approach
  • 05:37: the concept there is well let's take
  • 05:40: some
  • 05:41: valuation ratio uh
  • 05:44: from the current data um
  • 05:47: you know price times earnings or
  • 05:49: something like that
  • 05:51: and then take our future forecasted
  • 05:53: financials
  • 05:54: apply that same current valuation ratio
  • 05:57: to the future financials
  • 05:59: and that will get us our future
  • 06:03: valuation or the terminal value
  • 06:08: whereas the perpetuity growth method um
  • 06:11: says well let's take the last free cash
  • 06:13: flow and apply a growth rate on it
  • 06:16: and say they're just going to grow at a
  • 06:18: constant rate after the forecast period
  • 06:20: and then
  • 06:21: take the present value of that
  • 06:26: so looking more specifically at the exit
  • 06:29: multiple approach
  • 06:30: so there are some common valuation
  • 06:34: ratios that are used for this
  • 06:37: so you do have to have
  • 06:41: some kind of price
  • 06:44: component in it in order to
  • 06:47: use this approach that can be either
  • 06:50: directly the price
  • 06:51: or it can be the enterprise value um
  • 06:55: and so we have four common ones here
  • 06:58: based off the enterprise value
  • 07:00: enterprise value to abbott to ebitda
  • 07:03: to sales uh to free cash flows
  • 07:08: um and then we also have this
  • 07:12: uh one common one which is based off the
  • 07:14: price the price to earnings ratio
  • 07:18: so again basic idea
  • 07:21: take the current ratio forecast the
  • 07:24: financials
  • 07:25: apply the current ratio to the future
  • 07:27: financials to get the future
  • 07:29: valuation
  • 07:32: and you're going to get different
  • 07:34: results depending on which ratio
  • 07:37: that you use so it's very common
  • 07:41: for people to not just report one stock
  • 07:43: price from a gcf model
  • 07:46: but to give a stock price range based on
  • 07:49: the different approaches for the
  • 07:50: terminal value
  • 07:52: so people will usually look at multiple
  • 07:54: different ratios as well
  • 07:55: as the perp-duty growth method and
  • 07:58: establish a valuation range
  • 08:00: based upon that
  • 08:04: so for these enterprise value based
  • 08:06: ratios
  • 08:07: you're going to
  • 08:10: take the um
  • 08:13: ratio and you're going to take the
  • 08:17: future
  • 08:18: um forecasted
  • 08:21: um value whatever
  • 08:24: value is there in the ratio let's say
  • 08:26: we're working with uh
  • 08:28: ev to ebbit so you're going to take your
  • 08:31: ev the ebbit ratio which you have from
  • 08:33: the current data
  • 08:34: and you're going to multiply that by
  • 08:37: your
  • 08:38: last forecasted periods ebit and that
  • 08:41: will get you
  • 08:43: the enterprise value
  • 08:47: for the final period
  • 08:52: and then for the um
  • 08:55: price to earnings then you need to go
  • 08:58: through a similar approach
  • 09:00: take the current ratio multiply it by
  • 09:03: the final forecasted period net income
  • 09:07: and that will get you instead of an
  • 09:09: enterprise value it will get an equity
  • 09:11: value
  • 09:12: and so then you just need to add that
  • 09:14: final periods uh
  • 09:16: forecasted debt onto that and subtract
  • 09:18: the
  • 09:19: cash and that's going to get you that
  • 09:21: final period enterprise value
  • 09:23: which you can use as the terminal value
  • 09:27: and looking at the perpetuity growth
  • 09:31: method so this perpetuity growth method
  • 09:35: actually uses the same math as
  • 09:38: the dividend discount model because
  • 09:41: conceptually
  • 09:42: what we're doing in both models is the
  • 09:45: same
  • 09:47: in the dividend discount model we say
  • 09:50: that the dividends are going to grow at
  • 09:52: a constant rate
  • 09:53: same here we're going to say that the
  • 09:55: free cash flows are going to grow at a
  • 09:56: constant rate and in both cases we're
  • 09:58: trying to find the present value
  • 10:00: um so the structure of the formula
  • 10:04: looks just like the structure of the
  • 10:06: dividend discount formula
  • 10:07: where there we have the last period
  • 10:10: dividend times one plus the growth rate
  • 10:12: over the rate of return on the stock
  • 10:14: minus the growth rate
  • 10:16: here it's the same thing just instead of
  • 10:18: the dividend we have the free cash flow
  • 10:20: and instead of the
  • 10:24: rate of return on the stock we have the
  • 10:26: weighted average cost of capital
  • 10:28: so you do that you do that with your
  • 10:30: final
  • 10:31: final period free cash flow
  • 10:34: and that will get you the terminal value
  • 10:37: now you do have to pick a growth rate
  • 10:39: which is going to go into that
  • 10:43: and the valuation is
  • 10:46: extremely sensitive to the choice of
  • 10:49: that growth rate
  • 10:51: so whenever you use the perpetuity
  • 10:53: growth method
  • 10:54: it is uh even standard to do at least a
  • 10:58: sensitivity analysis
  • 10:59: on it because that assumption matters so
  • 11:02: much
  • 11:03: for the final stock price people want to
  • 11:06: see
  • 11:06: well what does the stock price look with
  • 11:08: a range of different
  • 11:10: terminal growth rates and
  • 11:14: um it would be a good idea to do a monte
  • 11:16: carlo simulation as well to understand
  • 11:18: uh in more detail how much uh
  • 11:22: the stock price is going to move around
  • 11:24: based upon
  • 11:25: your uh assessment of the standard
  • 11:27: deviation
  • 11:28: of the growth rate
  • 11:33: and if you want to know what to plug in
  • 11:35: um
  • 11:36: so two three percent are you know maybe
  • 11:39: up to four like kind of two to four
  • 11:41: percent is
  • 11:42: the typical range here um
  • 11:45: you shouldn't have it be really
  • 11:49: much more than gdp at all
  • 11:52: because this is supposed to be a growth
  • 11:55: rate which is going to last
  • 11:56: forever and so if a company
  • 12:01: grew faster than the overall economy
  • 12:04: forever
  • 12:05: it would at some point become actually
  • 12:08: much much much larger than everything
  • 12:10: else in the economy
  • 12:12: such that this company would become the
  • 12:15: entire economy
  • 12:16: so you can't just throw a 10 terminal
  • 12:18: growth rate in there
  • 12:19: that makes absolutely no sense that
  • 12:21: would say you know
  • 12:23: maybe in 20 30 40 years that this
  • 12:26: company
  • 12:26: would be the entire economy which is
  • 12:28: probably not
  • 12:30: um what you're trying to model so
  • 12:33: because this is uh such a long-term
  • 12:36: growth rate uh
  • 12:38: you need to be fairly conservative here
  • 12:40: even if the last few years of growth
  • 12:42: have been seven ten percent
  • 12:44: you need to pick a much lower rate
  • 12:45: because this is supposed to last
  • 12:47: indefinitely
  • 12:51: um so now
  • 12:54: we have the terminal value we have the
  • 12:56: free cash flows we have the whack
  • 12:59: so what do we do to wrap up the dcf
  • 13:01: model
  • 13:02: um so we have to
  • 13:05: use those free cash flows in conjunction
  • 13:08: with the terminal value
  • 13:09: in order to get the current
  • 13:13: enterprise value so
  • 13:17: the terminal value is going to happen
  • 13:20: during the final forecast period
  • 13:23: so if you're forecasting out of five
  • 13:25: years then your year five
  • 13:27: uh free the year five cash flow that
  • 13:29: you're going to use in the present value
  • 13:31: calculation
  • 13:32: is your original free cash flow for that
  • 13:35: year
  • 13:36: plus the terminal value so you'll have
  • 13:40: you know all the preceding years in the
  • 13:43: five year example you have years one two
  • 13:45: three four
  • 13:46: um with their estimated free cash flow
  • 13:49: value
  • 13:50: and then you'll have year five with that
  • 13:52: free cash flow value
  • 13:53: plus the terminal value and then you're
  • 13:56: going to take the net present value
  • 13:57: of all of that using the whack as the
  • 14:01: discount rate um so that will yield you
  • 14:05: the current
  • 14:06: enterprise value and then we talked
  • 14:10: at the beginning of the prior electric
  • 14:12: series on the whack about how we can
  • 14:14: take an enterprise value
  • 14:15: and convert it into an equity value and
  • 14:17: convert that into a stock price
  • 14:19: which is ultimately what we want to get
  • 14:21: out of the dcf
  • 14:22: model so with that then
  • 14:25: we have everything that we need in order
  • 14:28: to do the entire dcf
  • 14:30: model
  • 14:33: so then in order just to test
  • 14:36: understanding
  • 14:37: of this terminal value material we have
  • 14:40: a lab exercise
  • 14:41: on that as well
  • 14:45: so here you have
  • 14:48: four different ratios that you want to
  • 14:50: use with the
  • 14:52: exit multiple approach and then you also
  • 14:54: want to use the perpetuity growth method
  • 14:57: um and the numbers are basically given
  • 14:59: to you for all these things
  • 15:01: um so you have you know constant free
  • 15:03: cash flow for the next five years
  • 15:06: you have the values of all the ratios uh
  • 15:09: you have these
  • 15:12: these values which you need to use for
  • 15:16: the x and multiple approach for the
  • 15:17: final forecasted period
  • 15:20: you have the current
  • 15:24: financial statement items that you uh
  • 15:27: will use to
  • 15:28: get to a stock price
  • 15:31: um and
  • 15:34: shares outstanding also the stock price
  • 15:36: whack for taking the present value
  • 15:38: terminal growth rate for the perpetrated
  • 15:40: growth method
  • 15:41: um and ultimately what you want to get
  • 15:45: is stock prices
  • 15:46: so you should have five different stock
  • 15:48: prices coming out of this one
  • 15:49: corresponding to each ratio
  • 15:51: and one corresponding to the perpetuity
  • 15:54: growth method
  • 15:55: and all those answers are there provided
  • 15:57: for you to ensure that
  • 15:59: you can get through this all
  • 16:01: appropriately
  • 16:04: so that wraps up our dual lecture series
  • 16:08: related to the discounted cash flow
  • 16:12: valuation of the stock which is
  • 16:15: the capstone model here in the
  • 16:18: basic financial modeling class um
  • 16:22: so i hope everyone enjoyed uh learning
  • 16:25: about this
  • 16:26: and we'll come back in the next lecture
  • 16:29: series
  • 16:30: to kind of give a road map on
  • 16:33: what else we can learn in this financial
  • 16:35: modeling space so we'll start to look at
  • 16:37: more advanced topics
  • 16:39: and do just a very brief rush on each
  • 16:42: topic area to discuss
  • 16:44: what direction you can go in for future
  • 16:46: learning
  • 16:47: so thanks for listening and see you next
  • 16:51: time