Forecasting Financial Statements with finstmt

Note: The plots are not coming through and the formatting of the statements is off in the web view. Download the Jupyter notebook for the full experience.

First import the necessary classes and pandas.

import os
os.chdir('..')
from finstmt import FinancialStatements, IncomeStatements, BalanceSheets
import pandas as pd

Load Financial Statements

root_folder = os.path.sep.join(['..', 'tests', 'sources', 'stockrow', 'CAT'])

inc_path = os.path.join(root_folder, 'annual_income.csv')
bs_path = os.path.join(root_folder, 'annual_bs.csv')

inc_df = pd.read_csv(inc_path, index_col=0)
bs_df = pd.read_csv(bs_path, index_col=0)

bs = BalanceSheets.from_df(bs_df)
inc = IncomeStatements.from_df(inc_df)
stmts = FinancialStatements(inc, bs)
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(
/home/runner/work/py-finstmt/py-finstmt/finstmt/findata/period_data.py:116: UserWarning: Previously had ebit extracted from "Operating Income". Replacing with value from "EBIT"
  warnings.warn(

View Existing Statements

stmts

Income Statement

12/31/2009 12/31/2010 12/31/2011 12/31/2012 12/31/2013 12/31/2014 12/31/2015 12/31/2016 12/31/2017 12/31/2018
Revenue $32,396,000,000 $42,588,000,000 $60,138,000,000 $65,875,000,000 $55,656,000,000 $55,184,000,000 $47,011,000,000 $38,537,000,000 $45,462,000,000 $54,722,000,000
Cost of Goods Sold $24,931,000,000 $31,281,000,000 $44,404,000,000 $47,852,000,000 $41,454,000,000 $41,342,000,000 $34,133,000,000 $28,640,000,000 $31,906,000,000 $37,719,000,000
Gross Profit $7,465,000,000 $11,307,000,000 $15,734,000,000 $18,023,000,000 $14,202,000,000 $13,842,000,000 $12,878,000,000 $9,897,000,000 $13,556,000,000 $17,003,000,000
SG&A Expense $3,645,000,000 $4,248,000,000 $5,203,000,000 $5,919,000,000 $5,547,000,000 $6,529,000,000 $4,951,000,000 $4,383,000,000 $4,999,000,000 $5,478,000,000
Interest Expense $389,000,000 $343,000,000 $396,000,000 $467,000,000 $465,000,000 $484,000,000 $507,000,000 $505,000,000 $531,000,000 $404,000,000
Income Tax Expense $-270,000,000 $968,000,000 $1,720,000,000 $2,528,000,000 $1,319,000,000 $692,000,000 $916,000,000 $192,000,000 $3,339,000,000 $1,698,000,000
R&D Expense $1,421,000,000 $1,905,000,000 $2,297,000,000 $2,466,000,000 $2,046,000,000 $2,380,000,000 $2,119,000,000 $1,853,000,000 $1,842,000,000 $1,850,000,000
Depreciation & Amortization Expense - - - - - - - - - -
Other Operating Expenses - - - - - - - - - -
Gain on Sale of Investments - - - - - - - - - -
Gain on Sale of Assets - - - - - - - - - -
Impairment Expense - - - - - - - - - -
Operating Expense $6,888,000,000 $7,344,000,000 $8,581,000,000 $9,450,000,000 $8,574,000,000 $10,528,000,000 $9,093,000,000 $8,735,000,000 $9,096,000,000 $8,710,000,000
Earnings Before Interest and Taxes $1,014,000,000 $4,011,000,000 $7,044,000,000 $8,676,000,000 $5,573,000,000 $3,628,000,000 $3,935,000,000 $630,000,000 $4,624,000,000 $8,249,000,000
Earnings Before Tax $625,000,000 $3,668,000,000 $6,648,000,000 $8,209,000,000 $5,108,000,000 $3,144,000,000 $3,428,000,000 $125,000,000 $4,093,000,000 $7,845,000,000
Net Income $895,000,000 $2,700,000,000 $4,928,000,000 $5,681,000,000 $3,789,000,000 $2,452,000,000 $2,512,000,000 $-67,000,000 $754,000,000 $6,147,000,000

Balance Sheet

12/31/2009 12/31/2010 12/31/2011 12/31/2012 12/31/2013 12/31/2014 12/31/2015 12/31/2016 12/31/2017 12/31/2018
Cash and Cash Equivalents $4,867,000,000 $3,592,000,000 $3,057,000,000 $5,490,000,000 $6,081,000,000 $7,341,000,000 $6,460,000,000 $7,168,000,000 $8,261,000,000 $7,857,000,000
Short-Term Investments - - - - - - - - - -
Cash and Short-Term Investments $4,867,000,000 $3,592,000,000 $3,057,000,000 $5,490,000,000 $6,081,000,000 $7,341,000,000 $6,460,000,000 $7,168,000,000 $8,261,000,000 $7,857,000,000
Receivables $27,162,000,000 $28,849,000,000 $30,803,000,000 $33,911,000,000 $33,499,000,000 $32,772,000,000 $30,507,000,000 $29,088,000,000 $30,725,000,000 $31,899,000,000
Inventory $6,360,000,000 $9,587,000,000 $14,544,000,000 $15,547,000,000 $12,625,000,000 $12,205,000,000 $9,700,000,000 $8,614,000,000 $10,018,000,000 $11,529,000,000
Deferred Tax Assets, Current - - - - - - - - - -
Other Current Assets - - - - - - - - - -
Total Current Assets $27,217,000,000 $31,810,000,000 $37,900,000,000 $42,138,000,000 $38,335,000,000 $38,867,000,000 $33,508,000,000 $31,967,000,000 $36,244,000,000 $38,603,000,000
Gross Property, Plant & Equipment - - - - - - - - - -
Accumulated Depreciation - - - - - - - - - -
Net Property, Plant & Equipment $12,386,000,000 $12,539,000,000 $14,395,000,000 $16,461,000,000 $17,075,000,000 $16,577,000,000 $16,090,000,000 $15,322,000,000 $14,155,000,000 $13,574,000,000
Goodwill and Intangible Assets $2,734,000,000 $3,419,000,000 $11,448,000,000 $10,958,000,000 $10,552,000,000 $9,770,000,000 $9,436,000,000 $8,369,000,000 $8,311,000,000 $8,114,000,000
Long-Term Investments $105,000,000 $164,000,000 $133,000,000 $272,000,000 $272,000,000 $257,000,000 - - - -
Deferred Tax Assets, Long-Term $3,930,000,000 $3,424,000,000 $3,737,000,000 $3,558,000,000 $2,147,000,000 $3,143,000,000 $2,489,000,000 $2,790,000,000 $1,693,000,000 $1,439,000,000
Other Long-Term Assets - - - - - - - - - -
Total Non-Current Assets $32,821,000,000 $32,210,000,000 $43,318,000,000 $46,832,000,000 $46,561,000,000 $45,814,000,000 $44,834,000,000 $42,737,000,000 $40,718,000,000 $39,906,000,000
Total Assets $60,038,000,000 $64,020,000,000 $81,218,000,000 $88,970,000,000 $84,896,000,000 $84,681,000,000 $78,342,000,000 $74,704,000,000 $76,962,000,000 $78,509,000,000
Payables $2,993,000,000 $5,856,000,000 $8,161,000,000 $6,753,000,000 $6,560,000,000 $6,515,000,000 $5,023,000,000 $4,614,000,000 $6,487,000,000 $7,051,000,000
Short-Term Debt $9,784,000,000 $7,981,000,000 $9,648,000,000 $12,391,000,000 $11,031,000,000 $11,501,000,000 $12,844,000,000 $13,965,000,000 $11,031,000,000 $11,553,000,000
Current Portion of Long-Term Debt - - - - - - - - - -
Tax Liabilities, Short-Term - - - - - - - - - -
Other Current Liabilities - - - - - - - - - -
Total Current Liabilities $18,975,000,000 $22,020,000,000 $28,357,000,000 $29,415,000,000 $27,297,000,000 $27,877,000,000 $26,242,000,000 $26,132,000,000 $26,931,000,000 $28,218,000,000
Long-Term Debt $21,847,000,000 $20,437,000,000 $24,944,000,000 $27,752,000,000 $26,719,000,000 $27,784,000,000 $25,169,000,000 $22,818,000,000 $23,847,000,000 $25,000,000,000
Total Debt $31,631,000,000 $28,418,000,000 $34,592,000,000 $40,143,000,000 $37,750,000,000 $39,285,000,000 $38,013,000,000 $36,783,000,000 $34,878,000,000 $36,553,000,000
Deferred Revenue - - - - - - - - - -
Tax Liabilities, Long-Term - - - - - - - - - -
Deposit Liabilities $1,217,000,000 $1,831,000,000 $2,487,000,000 $2,638,000,000 $2,360,000,000 $1,697,000,000 $1,146,000,000 $1,167,000,000 $1,426,000,000 $1,243,000,000
Other Long-Term Liabilities - - - - - - - - - -
Total Non-Current Liabilities $31,763,000,000 $30,675,000,000 $39,459,000,000 $41,973,000,000 $36,721,000,000 $39,978,000,000 $37,215,000,000 $35,359,000,000 $36,265,000,000 $36,211,000,000
Total Liabilities $50,738,000,000 $52,695,000,000 $67,816,000,000 $71,388,000,000 $64,018,000,000 $67,855,000,000 $63,457,000,000 $61,491,000,000 $63,196,000,000 $64,429,000,000
Common Stock - - - - - - - - - -
Other Comprehensive Income $-3,764,000,000 $-4,051,000,000 $-6,328,000,000 $-6,433,000,000 $-3,898,000,000 $-6,431,000,000 $-2,035,000,000 $-2,039,000,000 $-1,192,000,000 $-1,684,000,000
Retained Earnings $19,711,000,000 $21,384,000,000 $25,219,000,000 $29,558,000,000 $31,854,000,000 $33,887,000,000 $29,246,000,000 $27,377,000,000 $26,301,000,000 $30,427,000,000
Minority Interest - - - - - - - - - -
Total Stockholder's Equity $8,740,000,000 $10,824,000,000 $12,883,000,000 $17,532,000,000 $20,811,000,000 $16,746,000,000 $14,809,000,000 $13,213,000,000 $13,766,000,000 $14,080,000,000
Total Liabilities and Equity $59,478,000,000 $63,519,000,000 $80,699,000,000 $88,920,000,000 $84,829,000,000 $84,601,000,000 $78,266,000,000 $74,704,000,000 $76,962,000,000 $78,509,000,000
Net Working Capital $30,529,000,000 $32,580,000,000 $37,186,000,000 $42,705,000,000 $39,564,000,000 $38,462,000,000 $35,184,000,000 $33,088,000,000 $34,256,000,000 $36,377,000,000


Copy the Statements

To set up for running multiple forecasts off the same data, you can make a copy of it using stmts.copy(). Then any adjustments to the configuration will only be in the original object and not the copy.

stmts2 = stmts.copy()

Run a Forecast

Set the Default Method

This is not a necessary step, but this is the way to change the default forecast method. The default is already cagr and so this doesn’t actually have an effect.

stmts.config.update_all(['forecast_config', 'method'], 'cagr')

View the Forecast Assumptions

All the assumptions going into the forecast are in forecast_assumptions:

stmts.forecast_assumptions
Method % of Cap Floor Plug
Revenue cagr None None None False
Cost of Goods Sold cagr revenue None None False
SG&A Expense cagr None None None False
Interest Expense cagr total_debt None None False
Income Tax Expense cagr ebt None None False
R&D Expense cagr None None None False
Cash and Cash Equivalents cagr None None None True
Receivables cagr revenue None None False
Inventory cagr revenue None None False
Net Property, Plant & Equipment cagr None None None False
Goodwill and Intangible Assets cagr None None None False
Long-Term Investments cagr None None None False
Deferred Tax Assets, Long-Term cagr None None None False
Payables cagr revenue None None False
Short-Term Debt cagr total_debt None None False
Long-Term Debt cagr None None None True
Deposit Liabilities cagr None None None False
Other Comprehensive Income cagr None None None False
Retained Earnings cagr None None None False


Run the First Forecast

Forecasts are run using .forecast() and produce ForecastedFinancialStatements. It is usually good practice to first run a forecast, then view the results, then adjust as needed.

fcst = stmts.forecast()
  0%|          | 0/16 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Income Tax Expense as y_0 is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 16/16 [00:00<00:00, 349.27it/s]

  0%|          | 0/38 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Long-Term Investments as y_T is 0. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Other Comprehensive Income as y_0 is negative, y_T is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 38/38 [00:00<00:00, 409.19it/s]
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
Note: Warnings are raised because CAGR is the default method but it

is not suitable for items which begin with 0

Now view the forecast.

fcst

Income Statement

12/31/2019 12/31/2020 12/31/2021 12/31/2022 12/31/2023
Revenue $57,667,220,438 $60,770,957,074 $64,041,741,490 $67,488,564,448 $71,120,900,608
Cost of Goods Sold $39,313,545,944 $40,975,500,271 $42,707,712,625 $44,513,153,118 $46,394,917,421
Gross Profit $18,353,674,493 $19,795,456,804 $21,334,028,865 $22,975,411,330 $24,725,983,186
SG&A Expense $5,705,772,841 $5,943,016,376 $6,190,124,394 $6,447,507,055 $6,715,591,574
Interest Expense $415,740,590 $418,147,270 $421,436,796 $425,677,315 $430,948,096
Income Tax Expense $2,236,447,584 $2,485,650,525 $2,753,182,973 $3,040,236,677 $3,348,074,638
R&D Expense $1,899,457,118 $1,950,236,402 $2,002,373,198 $2,055,903,797 $2,110,865,460
Depreciation & Amortization Expense - - - - -
Other Operating Expenses - - - - -
Gain on Sale of Investments - - - - -
Gain on Sale of Assets - - - - -
Impairment Expense - - - - -
Operating Expense $7,605,229,959 $7,893,252,778 $8,192,497,592 $8,503,410,852 $8,826,457,034
Earnings Before Interest and Taxes $10,748,444,535 $11,902,204,025 $13,141,531,274 $14,472,000,479 $15,899,526,152
Earnings Before Tax $10,332,703,944 $11,484,056,756 $12,720,094,478 $14,046,323,164 $15,468,578,056
Net Income $8,096,256,360 $8,998,406,230 $9,966,911,505 $11,006,086,487 $12,120,503,417

Balance Sheet

12/31/2019 12/31/2020 12/31/2021 12/31/2022 12/31/2023
Cash and Cash Equivalents $8,341,327,471 $8,755,400,920 $9,198,171,321 $9,671,573,612 $10,177,696,618
Short-Term Investments - - - - -
Cash and Short-Term Investments $8,341,327,471 $8,755,400,920 $9,198,171,321 $9,671,573,612 $10,177,696,618
Receivables $32,415,938,592 $32,941,254,423 $33,475,083,248 $34,017,563,025 $34,568,833,947
Inventory $12,235,594,949 $12,985,496,033 $13,781,357,418 $14,625,995,942 $15,522,401,082
Deferred Tax Assets, Current - - - - -
Other Current Assets - - - - -
Total Current Assets $52,992,861,012 $54,682,151,376 $56,454,611,986 $58,315,132,579 $60,268,931,647
Gross Property, Plant & Equipment $13,698,894,523 $13,824,938,203 - $14,080,515,420 $14,210,070,397
Accumulated Depreciation - - $13,952,141,611 - -
Net Property, Plant & Equipment $13,698,894,523 $13,824,938,203 $13,952,141,611 $14,080,515,420 $14,210,070,397
Goodwill and Intangible Assets $9,046,459,697 $10,086,077,526 $11,245,168,084 $12,537,461,160 $13,978,264,368
Long-Term Investments - - - - -
Deferred Tax Assets, Long-Term $1,301,450,391 $1,177,048,729 $1,064,538,241 $962,782,286 $870,752,872
Other Long-Term Assets - - - - -
Total Non-Current Assets $24,046,804,611 $25,088,064,457 $26,261,847,936 $27,580,758,866 $29,059,087,638
Total Assets $77,039,665,624 $79,770,215,833 $82,716,459,922 $85,895,891,445 $89,328,019,285
Payables $7,681,837,474 $8,369,114,590 $9,117,880,879 $9,933,637,642 $10,822,378,370
Short-Term Debt $12,042,329,141 $12,268,514,671 $12,524,772,010 $12,814,230,760 $13,140,492,951
Current Portion of Long-Term Debt - - - - -
Tax Liabilities, Short-Term - - - - -
Other Current Liabilities - - - - -
Total Current Liabilities $19,724,166,615 $20,637,629,260 $21,642,652,889 $22,747,868,402 $23,962,871,321
Long-Term Debt $25,976,778,901 $26,381,226,925 $26,847,240,522 $27,380,905,350 $27,989,231,332
Total Debt $38,019,108,042 $38,649,741,596 $39,372,012,532 $40,195,136,110 $41,129,724,283
Deferred Revenue - - - - -
Tax Liabilities, Long-Term - - - - -
Deposit Liabilities $1,245,630,357 $1,248,266,280 $1,250,907,780 $1,253,554,871 $1,256,207,563
Other Long-Term Liabilities - - - - -
Total Non-Current Liabilities $27,222,409,258 $27,629,493,205 $28,098,148,303 $28,634,460,221 $29,245,438,895
Total Liabilities $46,946,575,873 $48,267,122,465 $49,740,801,191 $51,382,328,623 $53,208,310,216
Common Stock - - - - -
Other Comprehensive Income $-1,684,000,000 $-1,684,000,000 $-1,684,000,000 $-1,684,000,000 $-1,684,000,000
Retained Earnings $31,777,094,255 $33,187,094,333 $34,659,658,352 $36,197,562,372 $37,803,705,632
Minority Interest - - - - -
Total Stockholder's Equity $30,093,094,255 $31,503,094,333 $32,975,658,352 $34,513,562,372 $36,119,705,632
Total Liabilities and Equity $77,039,670,128 $79,770,216,798 $82,716,459,543 $85,895,890,995 $89,328,015,849
Net Working Capital $36,969,696,068 $37,557,635,866 $38,138,559,787 $38,709,921,325 $39,268,856,659


And the plot:

fcst.plot()
<Figure size 1500x2100 with 19 Axes>

It is also possible to plot a subset. Let’s focus on only a few items for sake of example.

fcst.plot(subset=['revenue', 'cogs', 'cash'])
<Figure size 1500x300 with 3 Axes>

Change Methods and Re-Run Forecast

After viewing the plots, the appropriate methods for forecasting each item should be chosen. Then they can be updated.

stmts.config.update('revenue', ['forecast_config', 'method'], 'trend')
stmts.config.update('cogs', ['forecast_config', 'method'], 'mean')

Now re-run the forecast.

fcst = stmts.forecast()
  0%|          | 0/16 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Income Tax Expense as y_0 is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 16/16 [00:00<00:00, 398.93it/s]

  0%|          | 0/38 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Long-Term Investments as y_T is 0. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Other Comprehensive Income as y_0 is negative, y_T is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 38/38 [00:00<00:00, 464.03it/s]
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

And plot the results:

fcst.plot(subset=['revenue', 'cogs', 'cash'])
<Figure size 1500x300 with 3 Axes>

Now the methods for those forecasts has been updated.

Adjusting an Existing Forecast

While it is possible to use the manual forecast type and pass in the desired growth rates or levels from the beginning, it is often more convenient to first run the forecast, then simply adjust it. The .to_manual method of the forecast was added for this purpose.

Either adjustments or replacements can be passed while updating, and either the level of the item or the growth in the item can be used for the new manual forecast. For either one, a dictionary where the keys are the index of the period and values are the adjustment/replacement or a list containing all the adjustment/replacements can be used.

fcst.forecasts['cash'].to_manual(adjustments={0: 0.4})  # boost first forecast period cash growth by 40%
fcst.forecasts['cogs'].to_manual(use_levels=True, replacements=[0.85 for _ in range(5)])  # use 85% of sales for full COGS forecast
fcst.forecasts['revenue'].to_manual(use_levels=True, replacements={1: 8e10})  # set second forecast period revenue to 80,000,000,000
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

Then just run the forecast again to get everything updated in the statements. Then you can view the plots:

fcst = stmts.forecast()
fcst.plot(subset=['revenue', 'cogs', 'cash'])
  0%|          | 0/16 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Income Tax Expense as y_0 is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 16/16 [00:00<00:00, 472.75it/s]

  0%|          | 0/38 [00:00<?, ?it/s]/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Long-Term Investments as y_T is 0. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:39: UserWarning: CAGR not an appropriate method for Other Comprehensive Income as y_0 is negative, y_T is negative. Setting to 0 growth (recent value forecast)
  warnings.warn(message)
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/cagr.py:94: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  self.result_df = past_df.append(future_df).sort_index()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

100%|##########| 38/38 [00:00<00:00, 462.42it/s]
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:72: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
  return pd.date_range(
/home/runner/work/py-finstmt/py-finstmt/finstmt/forecast/models/base.py:39: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  return pd.Series()

<Figure size 1500x300 with 3 Axes>

A Second Forecast

Since we earlier did a deepcopy of the stmts object, that still has the original forecast assumptions and can be used for a separate forecast.

stmts2.forecast_assumptions
Method % of Cap Floor Plug
Revenue cagr None None None False
Cost of Goods Sold cagr revenue None None False
SG&A Expense cagr None None None False
Interest Expense cagr total_debt None None False
Income Tax Expense cagr ebt None None False
R&D Expense cagr None None None False
Cash and Cash Equivalents cagr None None None True
Receivables cagr revenue None None False
Inventory cagr revenue None None False
Net Property, Plant & Equipment cagr None None None False
Goodwill and Intangible Assets cagr None None None False
Long-Term Investments cagr None None None False
Deferred Tax Assets, Long-Term cagr None None None False
Payables cagr revenue None None False
Short-Term Debt cagr total_debt None None False
Long-Term Debt cagr None None None True
Deposit Liabilities cagr None None None False
Other Comprehensive Income cagr None None None False
Retained Earnings cagr None None None False


Total running time of the script: ( 0 minutes 44.582 seconds)

Gallery generated by Sphinx-Gallery