finmodeling 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/.gitignore +0 -0
  2. data/Gemfile +2 -0
  3. data/README.md +289 -269
  4. data/Rakefile +12 -0
  5. data/TODO.txt +113 -20
  6. data/examples/{dump_report.rb → dump_latest_10k.rb} +1 -1
  7. data/examples/list_disclosures.rb +50 -0
  8. data/examples/lists/nasdaq-mid-to-mega-tech-symbols.txt +0 -0
  9. data/examples/show_report.rb +112 -32
  10. data/examples/show_reports.rb +162 -33
  11. data/finmodeling.gemspec +4 -1
  12. data/lib/finmodeling/annual_report_filing.rb +97 -18
  13. data/lib/finmodeling/array_with_stats.rb +0 -0
  14. data/lib/finmodeling/assets_calculation.rb +12 -3
  15. data/lib/finmodeling/assets_item.rb +0 -0
  16. data/lib/finmodeling/assets_item_vectors.rb +0 -0
  17. data/lib/finmodeling/balance_sheet_analyses.rb +19 -4
  18. data/lib/finmodeling/balance_sheet_calculation.rb +52 -37
  19. data/lib/finmodeling/calculation_summary.rb +119 -14
  20. data/lib/finmodeling/can_cache_classifications.rb +0 -0
  21. data/lib/finmodeling/can_cache_summaries.rb +0 -0
  22. data/lib/finmodeling/can_choose_successive_periods.rb +15 -0
  23. data/lib/finmodeling/can_classify_rows.rb +0 -0
  24. data/lib/finmodeling/capm.rb +80 -0
  25. data/lib/finmodeling/cash_change_calculation.rb +3 -3
  26. data/lib/finmodeling/cash_change_item.rb +0 -0
  27. data/lib/finmodeling/cash_change_item_vectors.rb +0 -0
  28. data/lib/finmodeling/cash_change_summary_from_differences.rb +36 -0
  29. data/lib/finmodeling/cash_flow_statement_analyses.rb +36 -0
  30. data/lib/finmodeling/cash_flow_statement_calculation.rb +28 -52
  31. data/lib/finmodeling/classifiers.rb +2 -0
  32. data/lib/finmodeling/company.rb +0 -0
  33. data/lib/finmodeling/company_filing.rb +30 -7
  34. data/lib/finmodeling/company_filing_calculation.rb +16 -6
  35. data/lib/finmodeling/company_filings.rb +112 -46
  36. data/lib/finmodeling/comprehensive_income_calculation.rb +60 -0
  37. data/lib/finmodeling/comprehensive_income_statement_calculation.rb +74 -0
  38. data/lib/finmodeling/comprehensive_income_statement_item.rb +20 -0
  39. data/lib/finmodeling/comprehensive_income_statement_item_vectors.rb +235 -0
  40. data/lib/finmodeling/config.rb +0 -0
  41. data/lib/finmodeling/debt_cost_of_capital.rb +14 -0
  42. data/lib/finmodeling/equity_change_calculation.rb +43 -0
  43. data/lib/finmodeling/equity_change_item.rb +25 -0
  44. data/lib/finmodeling/equity_change_item_vectors.rb +156 -0
  45. data/lib/finmodeling/factory.rb +0 -0
  46. data/lib/finmodeling/fama_french_cost_of_equity.rb +119 -0
  47. data/lib/finmodeling/float_helpers.rb +14 -8
  48. data/lib/finmodeling/forecasted_reformulated_balance_sheet.rb +55 -0
  49. data/lib/finmodeling/forecasted_reformulated_income_statement.rb +110 -0
  50. data/lib/finmodeling/forecasts.rb +4 -4
  51. data/lib/finmodeling/has_string_classifer.rb +0 -0
  52. data/lib/finmodeling/income_statement_analyses.rb +23 -17
  53. data/lib/finmodeling/income_statement_calculation.rb +46 -43
  54. data/lib/finmodeling/income_statement_item.rb +1 -1
  55. data/lib/finmodeling/income_statement_item_vectors.rb +24 -13
  56. data/lib/finmodeling/invalid_filing_error.rb +4 -0
  57. data/lib/finmodeling/liabs_and_equity_calculation.rb +18 -8
  58. data/lib/finmodeling/liabs_and_equity_item.rb +1 -1
  59. data/lib/finmodeling/liabs_and_equity_item_vectors.rb +24 -24
  60. data/lib/finmodeling/linear_trend_forecasting_policy.rb +23 -0
  61. data/lib/finmodeling/net_income_calculation.rb +23 -10
  62. data/lib/finmodeling/net_income_summary_from_differences.rb +51 -0
  63. data/lib/finmodeling/paths.rb +0 -0
  64. data/lib/finmodeling/period_array.rb +8 -4
  65. data/lib/finmodeling/quarterly_report_filing.rb +9 -4
  66. data/lib/finmodeling/rate.rb +8 -0
  67. data/lib/finmodeling/ratio.rb +0 -0
  68. data/lib/finmodeling/reformulated_balance_sheet.rb +47 -88
  69. data/lib/finmodeling/reformulated_cash_flow_statement.rb +18 -41
  70. data/lib/finmodeling/reformulated_income_statement.rb +44 -206
  71. data/lib/finmodeling/reformulated_shareholder_equity_statement.rb +50 -0
  72. data/lib/finmodeling/reoi_valuation.rb +104 -0
  73. data/lib/finmodeling/shareholder_equity_statement_calculation.rb +34 -0
  74. data/lib/finmodeling/string_helpers.rb +18 -1
  75. data/lib/finmodeling/time_series_estimator.rb +25 -0
  76. data/lib/finmodeling/trailing_avg_forecasting_policy.rb +23 -0
  77. data/lib/finmodeling/version.rb +1 -1
  78. data/lib/finmodeling/weighted_avg_cost_of_capital.rb +35 -0
  79. data/lib/finmodeling/yahoo_finance_helpers.rb +20 -0
  80. data/lib/finmodeling.rb +33 -2
  81. data/spec/annual_report_filing_spec.rb +81 -45
  82. data/spec/assets_calculation_spec.rb +7 -4
  83. data/spec/assets_item_spec.rb +9 -14
  84. data/spec/balance_sheet_analyses_spec.rb +13 -13
  85. data/spec/balance_sheet_calculation_spec.rb +45 -51
  86. data/spec/calculation_summary_spec.rb +113 -21
  87. data/spec/can_classify_rows_spec.rb +0 -0
  88. data/spec/cash_change_calculation_spec.rb +1 -10
  89. data/spec/cash_change_item_spec.rb +10 -18
  90. data/spec/cash_flow_statement_calculation_spec.rb +10 -24
  91. data/spec/company_beta_spec.rb +53 -0
  92. data/spec/company_filing_calculation_spec.rb +39 -49
  93. data/spec/company_filing_spec.rb +0 -0
  94. data/spec/company_filings_spec.rb +75 -25
  95. data/spec/company_spec.rb +37 -47
  96. data/spec/comprehensive_income_statement_calculation_spec.rb +54 -0
  97. data/spec/comprehensive_income_statement_item_spec.rb +56 -0
  98. data/spec/debt_cost_of_capital_spec.rb +19 -0
  99. data/spec/equity_change_calculation_spec.rb +33 -0
  100. data/spec/equity_change_item_spec.rb +58 -0
  101. data/spec/factory_spec.rb +2 -2
  102. data/spec/forecasts_spec.rb +2 -2
  103. data/spec/income_statement_analyses_spec.rb +23 -21
  104. data/spec/income_statement_calculation_spec.rb +17 -49
  105. data/spec/income_statement_item_spec.rb +17 -29
  106. data/spec/liabs_and_equity_calculation_spec.rb +6 -3
  107. data/spec/liabs_and_equity_item_spec.rb +14 -22
  108. data/spec/linear_trend_forecasting_policy_spec.rb +37 -0
  109. data/spec/matchers/custom_matchers.rb +79 -0
  110. data/spec/mocks/calculation.rb +0 -0
  111. data/spec/mocks/income_statement_analyses.rb +0 -0
  112. data/spec/mocks/sec_query.rb +0 -0
  113. data/spec/net_income_calculation_spec.rb +16 -10
  114. data/spec/period_array.rb +0 -0
  115. data/spec/quarterly_report_filing_spec.rb +21 -38
  116. data/spec/rate_spec.rb +0 -0
  117. data/spec/ratio_spec.rb +0 -0
  118. data/spec/reformulated_balance_sheet_spec.rb +56 -33
  119. data/spec/reformulated_cash_flow_statement_spec.rb +18 -10
  120. data/spec/reformulated_income_statement_spec.rb +16 -15
  121. data/spec/reformulated_shareholder_equity_statement_spec.rb +43 -0
  122. data/spec/reoi_valuation_spec.rb +146 -0
  123. data/spec/shareholder_equity_statement_calculation_spec.rb +59 -0
  124. data/spec/spec_helper.rb +4 -1
  125. data/spec/string_helpers_spec.rb +15 -13
  126. data/spec/time_series_estimator_spec.rb +61 -0
  127. data/spec/trailing_avg_forecasting_policy_spec.rb +37 -0
  128. data/spec/weighted_avg_cost_of_capital_spec.rb +32 -0
  129. data/tools/create_equity_change_training_vectors.rb +49 -0
  130. data/tools/time_specs.sh +7 -0
  131. metadata +182 -36
  132. data/lib/finmodeling/constant_forecasting_policy.rb +0 -23
  133. data/lib/finmodeling/generic_forecasting_policy.rb +0 -19
  134. data/spec/constant_forecasting_policy_spec.rb +0 -37
  135. data/spec/generic_forecasting_policy_spec.rb +0 -33
data/README.md CHANGED
@@ -1,292 +1,312 @@
1
1
  ## Overview
2
2
 
3
- FinModeling is a set of tools for manipulating financial data from SEC Edgar (in [XBRL](http://en.wikipedia.org/wiki/XBRL) format).
3
+ FinModeling is an equity valuation framework. It can retrieve and parse [XBRL](http://en.wikipedia.org/wiki/XBRL)-based filings from SEC Edgar. As of March 2013, it can successfully parse the last 2-5 years of quarterly and annual filings from 52% of the Nasdaq 100 companies. (The remainder fail due to a long-tail distribution of filing formatting peculiarities for which I haven't yet written special-case code to handle.)
4
4
 
5
5
  ## Features
6
6
 
7
- - Pulls annual (10-k) and quarterly (10-q) financial reports from SEC
7
+ - Pulls annual (10-k) and quarterly (10-q) financial reports from SEC Edgar
8
8
  - Uses Naive Bayes Classifiers to classify financial statement items
9
9
  - trained on medium-to-large NASDAQ tech companies
10
10
  - Reformulates GAAP statements to better highlight enterprise value
11
11
  - Generates forecasts based on analysis of historical performance
12
+ - Calculates cost of capital using either [CAPM](http://en.wikipedia.org/wiki/Capital_asset_pricing_model) or [Fama/French](http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model) cost of equity, and [WACC](http://en.wikipedia.org/wiki/Weighted_average_cost_of_capital)
13
+ - Performs residual operating income-based valuation.
12
14
 
13
- ## Example 1: Forecasting Oracle's Financials Based
15
+ ## Example 1: Valuing Oracle's Common Equity, Based on 4 Quarters of History and 2 Quarters of Forecasts
14
16
 
15
17
  After running "rake install" (to build and install the 'finmodeling' gem), you can run:
16
18
 
17
- lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_reports.rb --num-forecasts 2 orcl 2011-02-01
19
+ $ ./examples/show_reports.rb --num-forecasts 2 --do-valuation orcl 2012-02-01
18
20
  Forecasting 2 periods
21
+ Doing valuation
19
22
  company name: ORACLE CORP
20
-
21
- 2011-02-28 2011-05-31 2011-08-31 2011-11-30 2012-02-29E 2012-05-29E
22
- NOA ($MM) 28,172.0 28,282.0 25,235.0 27,055.0 27,342.0 29,107.0
23
- NFA ($MM) 8,445.0 11,494.0 15,657.0 14,865.0 16,899.0 17,593.0
24
- CSE ($MM) 36,617.0 39,776.0 40,892.0 41,920.0 44,241.0 46,700.0
25
- Composition Ratio 3.3359 2.4605 1.6117 1.8200 1.6179 1.6545
26
- NOA Growth 0.0155 -0.3638 0.3222 0.0431 0.2888
27
- CSE Growth 0.3886 0.1160 0.1047 0.2412 0.2452
28
-
29
- NOA growth: a:-0.1619, b:0.1533, r:0.4461, var:0.0787
30
-
31
- 2011-02-28 2011-05-31 2011-08-31 2011-11-30 2012-02-29E 2012-05-29E
32
- Revenue ($MM) 8,764.0 10,775.0 8,374.0 8,792.0 9,360.0 9,964.0
33
- Core OI ($MM) 2,318.0 3,413.0 2,056.0 2,327.0 2,483.0 2,644.0
34
- OI ($MM) 2,238.0 3,332.0 1,978.0 2,290.0
35
- FI ($MM) -122.0 -123.0 -138.0 -98.0 -163.0 -185.0
36
- NI ($MM) 2,116.0 3,209.0 1,840.0 2,192.0 2,321.0 2,459.0
37
- Gross Margin 0.5858 0.6040 0.5679 0.5845
38
- Sales PM 0.2644 0.3167 0.2454 0.2646 0.2653 0.2653
39
- Operating PM 0.2553 0.3092 0.2361 0.2604
40
- FI / Sales -0.0139 -0.0114 -0.0164 -0.0111 -0.0173 -0.0185
41
- NI / Sales 0.2414 0.2978 0.2197 0.2493 0.2479 0.2467
42
- Sales / NOA 1.5298 1.1843 1.3936 1.3837 1.4576
43
- FI / NFA -0.0581 -0.0479 -0.0250 -0.0437 -0.0437
44
- Revenue Growth 1.2695 -0.6321 0.2157 0.2852 0.2888
45
- Core OI Growth 3.6455 -0.8661 0.6443 0.2974 0.2888
46
- OI Growth 3.8474 -0.8737 0.8006
47
- ReOI ($MM) 2,647.0 1,290.0 1,683.0 1,833.0 1,993.0
48
-
49
- operating pm: a:0.2739, b:-0.0057, r:-0.2398, var:0.0007
50
- asset turnover: a:1.4374, b:-0.0681, r:-0.3914, var:0.0201
51
- revenue growth: a:0.8112, b:-0.5268, r:-0.5530, var:0.6050
52
- fi / nfa: a:-0.0602, b:0.0165, r:0.9765, var:0.0001
53
-
54
- Unknown... 2011-05-31 2011-08-31 2011-11-30
55
- C ($MM) -17.0 5,421.0 1,255.0
56
- I ($MM) -8,380.0 -13,091.0 -9,191.0
57
- d ($MM) 8,688.0 8,568.0 8,956.0
58
- F ($MM) -291.0 -898.0 -1,020.0
59
- FCF ($MM) -8,397.0 -7,670.0 -7,936.0
60
- NI / C -188.7647 0.3394 1.7466
61
-
62
- ## Example 2: A Summary of Adobe's Filings Since 2010-11-01
63
-
64
- lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_reports.rb adbe 2010-11-01
65
- company name: ADOBE SYSTEMS INC
66
-
67
- 2010-12-03 2011-03-04 2011-06-03 2011-09-02 2011-12-02
68
- NOA (000's) 4,269,074.0 4,374,531.0 4,334,056.0 4,428,947.0 4,458,509.0
69
- NFA (000's) 923,313.0 1,050,876.0 1,055,359.0 1,135,011.0 1,324,604.0
70
- CSE (000's) 5,192,387.0 5,425,407.0 5,389,415.0 5,563,958.0 5,783,113.0
71
- Composition Ratio 4.6236 4.1627 4.1067 3.9021 3.3659
72
- NOA Growth 0.1028 -0.0365 0.0907 0.0270
73
- CSE Growth 0.1925 -0.0263 0.1363 0.1676
74
-
75
- NOA growth: a:0.0610, b:-0.0100, r:-0.2006, var:0.0031
76
-
77
- Unknown... 2011-03-04 2011-06-03 2011-09-02 2011-12-02
78
- Revenue (000's) 1,027,706.0 1,023,179.0 1,013,212.0 1,152,161.0
79
- Core OI (000's) 251,831.0 247,172.0 215,630.0 251,253.0
80
- OI (000's) 245,152.0 240,798.0 206,405.0 182,137.0
81
- FI (000's) -10,561.0 -11,362.0 -11,304.0 -8,418.0
82
- NI (000's) 234,591.0 229,436.0 195,101.0 173,719.0
83
- Gross Margin 0.8952 0.8932 0.8967 0.8989
84
- Sales PM 0.2450 0.2415 0.2128 0.2180
85
- Operating PM 0.2385 0.2353 0.2037 0.1580
86
- FI / Sales -0.0102 -0.0111 -0.0111 -0.0073
87
- NI / Sales 0.2282 0.2242 0.1925 0.1507
88
- Sales / NOA 0.2338 0.2337 0.2601
89
- FI / NFA -0.0108 -0.0107 -0.0074
90
- Revenue Growth -0.0175 -0.0385 0.6744
91
- Core OI Growth -0.0721 -0.4216 0.8464
92
- OI Growth -0.0693 -0.4610 -0.3944
93
- ReOI (000's) 135,604.0 102,185.0 75,635.0
94
-
95
- operating pm: a:0.2498, b:-0.0273, r:-0.9434, var:0.0010
96
- asset turnover: a:0.2294, b:0.0131, r:0.8641, var:0.0001
97
- revenue growth: a:-0.1398, b:0.3459, r:0.8528, var:0.1097
98
-
99
- Unknown... 2011-03-04 2011-06-03 2011-09-02 2011-12-02
100
- C (000's) 332,102.0 397,743.0 320,434.0 334,399.0
101
- I (000's) -226,787.0 -229,749.0 -391,441.0 -385,261.0
102
- d (000's) -20,966.0 196,511.0 164,509.0 48,818.0
103
- F (000's) -84,349.0 -364,505.0 -93,502.0 2,044.0
104
- FCF (000's) 105,315.0 167,994.0 -71,007.0 -50,862.0
105
- NI / C 0.7063 0.5768 0.6088 0.5194
106
-
107
- ## Example 3: A Detailed View of Adobe's Second-to-Last 10-Q
108
-
109
- lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_report.rb adbe 10-q -2
110
- company name: ADOBE SYSTEMS INC
111
- url: http://www.sec.gov/Archives/edgar/data/796343/000079634311000006/0000796343-11-000006-index.htm
112
- Balance Sheet (2011-03-04)
113
- Assets (loc_Assets_1)
114
- [fa] Cash And Cash Equivalents At Carrying Value 900,156,000.0
115
- [fa] Short Term Investments 1,736,679,000.0
116
- [oa] Accounts Receivable Net Current 533,353,000.0
117
- [fa] Deferred Tax Assets Net Current 66,928,000.0
118
- [oa] Prepaid Expenses Other Assets 113,682,000.0
119
- [oa] Property Plant And Equipment Net 453,497,000.0
120
- [oa] Goodwill 3,686,073,000.0
121
- [oa] Finite Lived Intangible Assets Net 447,616,000.0
122
- [fa] Investment In Lease Receivable 207,239,000.0
123
- [oa] Other Assets Noncurrent 164,801,000.0
124
- Total 8,310,024,000.0
125
-
126
- Liabilities and Stockholders' Equity (loc_LiabilitiesAndStockholdersEquity_1)
127
- [ol] Accrued Restructuring Current 6,759,000.0
128
- [fl] Accrued Income Taxes Current 57,096,000.0
129
- [ol] Capital Lease Obligations Current 8,900,000.0
130
- [ol] Accrued Liabilities Current 458,463,000.0
131
- [ol] Accounts Payable Current 54,742,000.0
132
- [ol] Deferred Revenue Current 399,572,000.0
133
- [fl] Long Term Debt And Capital Lease Obligations 1,511,553,000.0
134
- [ol] Deferred Revenue Noncurrent 43,826,000.0
135
- [ol] Accrued Restructuring Noncurrent 7,307,000.0
136
- [fl] Liability For Uncertain Tax Positions Noncurrent 170,721,000.0
137
- [fl] Deferred Tax Liabilities Noncurrent 120,756,000.0
138
- [ol] Other Liabilities Noncurrent 44,922,000.0
139
- [cse] Treasury Stock Value -3,178,769,000.0
140
- [cse] Accumulated Other Comprehensive Income Loss Net Of Tax 28,695,000.0
141
- [cse] Retained Earnings Accumulated Deficit 6,045,631,000.0
142
- [cse] Additional Paid In Capital 2,529,789,000.0
143
- [cse] Common Stock Value 61,000.0
144
- [fl] Preferred Stock Value 0.0
145
- Total 8,310,024,000.0
146
-
23
+
24
+ 2012-02-29 2012-05-31 2012-08-31 2012-11-30 2013-02-28E 2013-05-28E
25
+ NOA ($MM) 29,250.0 32,172.0 29,172.0 31,703.0 31,072.0 33,307.0
26
+ NFA ($MM) 14,016.0 11,915.0 14,564.0 11,707.0 14,672.0 15,375.0
27
+ Minority Interest 393.0 399.0 407.0 427.0 0.0 0.0
28
+ ($MM)
29
+ CSE ($MM) 42,873.0 43,688.0 43,329.0 42,983.0 45,743.0 48,682.0
30
+ Composition Ratio 2.0869 2.7001 2.0030 2.7080 2.1177 2.1663
31
+ NOA Growth 0.4590 -0.3218 0.3961 -0.0783 0.3296
32
+ CSE Growth 0.0775 -0.0322 -0.0316 0.2871 0.2909
33
+
34
+
35
+ 2012-02-29 2012-05-31 2012-08-31 2012-11-30 2013-02-28E 2013-05-28E
36
+ Revenue ($MM) 9,039.0 10,916.0 8,181.0 9,094.0 9,748.0 10,450.0
37
+ Core OI ($MM) 2,674.0 3,636.0 2,076.0 2,712.0 2,870.0 3,076.0
38
+ OI ($MM) 2,608.0 3,590.0 2,149.0 2,705.0
39
+ FI ($MM) -110.0 -138.0 -115.0 -124.0 -110.0 -137.0
40
+ NI ($MM) 2,498.0 3,452.0 2,034.0 2,581.0 2,760.0 2,939.0
41
+ Gross Margin 0.6008 0.6238 0.5941 0.6077
42
+ Sales PM 0.2958 0.3330 0.2537 0.2981 0.2943 0.2943
43
+ Operating PM 0.2885 0.3288 0.2626 0.2974
44
+ FI / Sales -0.0121 -0.0126 -0.0140 -0.0136 -0.0112 -0.0131
45
+ NI / Sales 0.2763 0.3162 0.2486 0.2838 0.2831 0.2812
46
+ Sales / NOA 1.4806 1.0199 1.2642 1.2610 1.3949
47
+ FI / NFA -0.0390 -0.0387 -0.0345 -0.0383 -0.0388
48
+ Revenue Growth 1.1139 -0.6815 0.5286 0.3254 0.3296
49
+ Core OI Growth 2.3835 -0.8918 1.9216 0.2582 0.3296
50
+ OI Growth 2.5532 -0.8693 1.5169
51
+ ReOI ($MM) 2,879.0 1,367.0 2,004.0 2,116.0 2,346.0
52
+
53
+
54
+ Unknown... 2012-05-31 2012-08-31 2012-11-30
55
+ C ($MM) 4,057.0 5,431.0 677.0
56
+ I ($MM) -10,966.0 -7,304.0 -11,021.0
57
+ d ($MM) 9,358.0 4,662.0 13,363.0
58
+ F ($MM) -2,449.0 -2,789.0 -3,019.0
59
+ FCF ($MM) -6,909.0 -1,873.0 -10,344.0
60
+ NI / C 0.8508 0.3745 3.8124
61
+
62
+ Cost of Capital
63
+ 2013-03-10
64
+ Market Value of 169,100.0
65
+ Equity ($MM)
66
+ Market Value of 23,663.0
67
+ Debt ($MM)
68
+ Cost of Equity (%) 7.30
69
+ Cost of Debt (%) 3.20
70
+ Weighted Avg Cost 6.79
71
+ of Capital (%)
72
+
73
+ ReOI Valuation
74
+ 2012-11-30 2013-02-28 2013-05-28E
75
+ ReOI ($MM) 2,352.0 2,574.0
76
+ PV(ReOI) ($MM) 2,356.0
77
+ CV ($MM) 37,886.0
78
+ PV(CV) ($MM) 37,954.0
79
+ Book Value of 42,983.0
80
+ Common Equity
81
+ ($MM)
82
+ Enterprise Value 83,293.0
83
+ ($MM)
84
+ NFA ($MM) 11,707.0
85
+ Value of Common 95,000.0
86
+ Equity ($MM)
87
+ # Shares (MM) 4,735.0
88
+ Value / Share ($) 20.06
89
+
90
+ ## Example 2: More Detailed Analysis of Apple's Financials Since 2012-02-01
91
+
92
+ $ ./examples/show_reports.rb --balance-detail --income-detail --show-regressions aapl 2012-02-01
93
+ Balance sheet detail is enabled
94
+ Net income detail is enabled
95
+ Showing regressions
96
+ company name: APPLE INC
97
+
98
+ 2012-03-31 2012-06-30 2012-09-29 2012-12-29
99
+ A ($MM) 150,934.0 162,896.0 176,064.0 196,088.0
100
+ L ($MM) 48,436.0 51,150.0 57,854.0 68,742.0
101
+ NOA ($MM) -9,931.0 -7,784.0 -5,624.0 -12,661.0
102
+ OA ($MM) 38,505.0 43,366.0 52,230.0 56,081.0
103
+ OL ($MM) 48,436.0 51,150.0 57,854.0 68,742.0
104
+ NFA ($MM) 112,429.0 119,530.0 123,834.0 140,007.0
105
+ FA ($MM) 112,429.0 119,530.0 123,834.0 140,007.0
106
+ FL ($MM) 0.0 0.0 0.0 0.0
107
+ Minority Interest 0.0 0.0 0.0 0.0
108
+ ($MM)
109
+ CSE ($MM) 102,498.0 111,746.0 118,210.0 127,346.0
110
+ Composition Ratio -0.0883 -0.0651 -0.0454 -0.0904
111
+ NOA Δ ($MM) 2,147.0 2,160.0 -7,037.0
112
+ CSE Δ ($MM) 9,248.0 6,464.0 9,136.0
113
+ NOA Growth -0.6235 -0.7284 24.9157
114
+ CSE Growth 0.4140 0.2530 0.3479
115
+
116
+ NOA growth: a:-4.9150, b:12.7696, r:0.8642, var:145.5436
117
+
118
+ 2012-03-31 2012-06-30 2012-09-29 2012-12-29
119
+ Revenue ($MM) 39,186.0 35,023.0 35,966.0 54,512.0
120
+ COGS ($MM) -20,622.0 -20,029.0 -21,565.0 -33,452.0
121
+ GM ($MM) 18,564.0 14,994.0 14,401.0 21,060.0
122
+ OE ($MM) -3,180.0 -3,421.0 -3,457.0 -3,850.0
123
+ OISBT ($MM) 15,384.0 11,573.0 10,944.0 17,210.0
124
+ Core OI ($MM) 11,526.0 8,637.0 8,256.0 12,778.0
125
+ OI ($MM) 11,526.0 8,637.0 8,256.0 12,778.0
126
+ FI ($MM) 96.0 187.0 -33.0 300.0
127
+ NI ($MM) 11,622.0 8,824.0 8,223.0 13,078.0
128
+ Gross Margin 0.4737 0.4281 0.4004 0.3863
129
+ Sales PM 0.2941 0.2466 0.2295 0.2344
130
+ Operating PM 0.2941 0.2466 0.2295 0.2344
131
+ FI / Sales 0.0024 0.0053 -0.0009 0.0055
132
+ NI / Sales 0.2965 0.2519 0.2286 0.2399
133
+ Sales / NOA -14.3024 -18.5327 -39.3094
134
+ FI / NFA 0.0067 -0.0011 0.0098
135
+ Revenue Growth -0.3626 0.1124 4.3013
136
+ Core OI Growth -0.6856 -0.1653 4.7648
137
+ OI Growth -0.6856 -0.1653 4.7648
138
+ ReOI ($MM) 8,876.0 8,443.0 12,913.0
139
+
140
+ operating pm: a:0.2806, b:-0.0196, r:-0.8581, var:0.0006
141
+ sales / noa: a:-11.5447, b:-12.5035, r:-0.9341, var:119.4351
142
+ revenue growth: a:-0.9816, b:2.3320, r:0.9085, var:4.3917
143
+ fi / nfa: a:0.0036, b:0.0015, r:0.2729, var:2.1244e-05
144
+
145
+ Unknown... 2012-06-30 2012-09-29 2012-12-29
146
+ C ($MM) 10,189.0 9,136.0 23,426.0
147
+ I ($MM) -2,971.0 -3,493.0 -2,791.0
148
+ d ($MM) -7,163.0 -6,109.0 -18,631.0
149
+ F ($MM) -55.0 466.0 -2,004.0
150
+ FCF ($MM) 7,218.0 5,643.0 20,635.0
151
+ NI / C 0.8660 0.9000 0.5582
152
+
153
+ ## Example 3: Raw Numbers From Nike's Last 10-Q, Including Disclosures
154
+
155
+ $ ./examples/show_report.rb --show-disclosures NKE 10-q 0
156
+ Showing disclosures
157
+ company name: NIKE INC
158
+ url: http://www.sec.gov/Archives/edgar/data/320187/000119312513008172/0001193125-13-008172-index.htm
159
+ Balance Sheet (2012-11-30)
160
+ Assets (us-gaap_Assets_1)
161
+ [fa] Cash And Cash Equivalents At Carrying Value 2,291,000,000.0
162
+ [fa] Available For Sale Securities Current 1,234,000,000.0
163
+ [oa] Accounts Receivable Net Current 3,188,000,000.0
164
+ [oa] Inventory Finished Goods Net Of Reserves 3,318,000,000.0
165
+ [fa] Deferred Tax Assets Net Current 327,000,000.0
166
+ [oa] Prepaid Expense And Other Assets Current 733,000,000.0
167
+ [oa] Assets Of Disposal Group Including Discontinued 344,000,000.0
168
+ Operation Current
169
+ [oa] Property Plant And Equipment Gross 5,310,000,000.0
170
+ [oa] Accumulated Depreciation Depletion And Amortization -3,052,000,000.0
171
+ Property Plant And Equipment
172
+ [oa] Intangible Assets Net Excluding Goodwill 374,000,000.0
173
+ [oa] Goodwill 131,000,000.0
174
+ [fa] Deferred Income Taxes And Other Assets Noncurrent 973,000,000.0
175
+ Total 15,171,000,000.0
176
+
177
+ Liabilities And Stockholders Equity (us-gaap_LiabilitiesAndStockholdersEquity_1)
178
+ [fl] Long Term Debt Current 58,000,000.0
179
+ [fl] Short Term Borrowings 100,000,000.0
180
+ [ol] Accounts Payable Current 1,519,000,000.0
181
+ [ol] Accrued Liabilities Current 1,879,000,000.0
182
+ [fl] Accrued Income Taxes Current 45,000,000.0
183
+ [ol] Liabilities Of Disposal Group Including Discontinued 198,000,000.0
184
+ Operation Current
185
+ [fl] Long Term Debt Noncurrent 170,000,000.0
186
+ [fl] Deferred Income Taxes And Other Liabilities Noncurrent 1,188,000,000.0
187
+ [ol] Commitments And Contingencies 0.0
188
+ [fl] Temporary Equity Carrying Amount Attributable To Parent 0.0
189
+ [cse] Stockholders Equity 10,014,000,000.0
190
+ Total 15,171,000,000.0
191
+
147
192
  Net Operational Assets
148
- OA 5,399,022,000.0
149
- OL -1,024,491,000.0
150
- Total 4,374,531,000.0
151
-
193
+ OA 10,346,000,000.0
194
+ OL -3,596,000,000.0
195
+ Total 6,750,000,000.0
196
+
152
197
  Net Financial Assets
153
- FA 2,911,002,000.0
154
- FL -1,860,126,000.0
155
- Total 1,050,876,000.0
156
-
198
+ FA 4,825,000,000.0
199
+ FL -1,561,000,000.0
200
+ Total 3,264,000,000.0
201
+
157
202
  Common Shareholders' Equity
158
- NOA 4,374,531,000.0
159
- NFA 1,050,876,000.0
160
- Total 5,425,407,000.0
161
-
162
- Income Statement (2010-12-04 to 2011-03-04)
163
- Net Income (Loss) Attributable to Parent (loc_NetIncomeLoss_0)
164
- [or] Sales Revenue Goods Net 842,689,000.0
165
- [or] Sales Revenue Services Net 78,846,000.0
166
- [or] Subscription Revenue 106,171,000.0
167
- [cogs] Cost Of Goods Sold -30,717,000.0
168
- [cogs] Cost Of Services -29,044,000.0
169
- [cogs] Cost Of Goods Sold Subscription -47,878,000.0
170
- [oe] Research And Development Expense Software Excluding ... -178,400,000.0
171
- [oe] Selling And Marketing Expense -328,078,000.0
172
- [oe] General And Administrative Expense -100,979,000.0
173
- [oibt] Restructuring Charges -41,000.0
174
- [oibt] Amortization Of Intangible Assets -10,235,000.0
175
- [fibt] Other Nonoperating Income -817,000.0
176
- [fibt] Interest Expense -17,020,000.0
177
- [fibt] Gain Loss On Investments 1,590,000.0
178
- [tax] Income Tax Expense Benefit -51,496,000.0
179
- Total 234,591,000.0
180
-
203
+ NOA 6,750,000,000.0
204
+ NFA 3,264,000,000.0
205
+ MI -0.0
206
+ Total 10,014,000,000.0
207
+
208
+ Income Statement (2012-09-01 to 2012-11-30)
209
+ Net Income Loss (us-gaap_NetIncomeLoss_3)
210
+ [or] Sales Revenue Net 5,955,000,000.0
211
+ [cogs] Cost Of Goods Sold -3,425,000,000.0
212
+ [oe] Marketing And Advertising Expense -613,000,000.0
213
+ [oe] General And Administrative Expense -1,223,000,000.0
214
+ [fibt] Interest Income Expense Nonoperating Net 1,000,000.0
215
+ [fibt] Other Nonoperating Income Expense 17,000,000.0
216
+ [tax] Income Tax Expense Benefit -191,000,000.0
217
+ [fiat] Income Loss From Discontinued Operations Net Of Tax -137,000,000.0
218
+ Total 384,000,000.0
219
+
181
220
  Gross Revenue
182
- Operating Revenues (OR) 1,027,706,000.0
183
- Cost of Goods Sold (COGS) -107,639,000.0
184
- Total 920,067,000.0
185
-
221
+ Operating Revenues (OR) 5,955,000,000.0
222
+ Cost of Goods Sold (COGS) -3,425,000,000.0
223
+ Total 2,530,000,000.0
224
+
186
225
  Operating Income from sales, before tax (OISBT)
187
- Gross Margin (GM) 920,067,000.0
188
- Operating Expense (OE) -607,457,000.0
189
- Total 312,610,000.0
190
-
226
+ Gross Margin (GM) 2,530,000,000.0
227
+ Operating Expense (OE) -1,836,000,000.0
228
+ Total 694,000,000.0
229
+
191
230
  Operating Income from sales, after tax (OISAT)
192
- Operating income from sales (before tax) 312,610,000.0
193
- Reported taxes -51,496,000.0
194
- Taxes on net financing income -5,686,450.0
195
- Taxes on other operating income -3,596,600.0
196
- Total 251,830,950.0
197
-
231
+ Operating income from sales (before tax) 694,000,000.0
232
+ Reported taxes -191,000,000.0
233
+ Taxes on net financing income 6,300,000.0
234
+ Taxes on other operating income 0.0
235
+ Total 509,300,000.0
236
+
198
237
  Operating income, after tax (OI)
199
- Operating income after sales, after tax (OISAT) 251,830,950.0
200
- Other operating income, before tax (OIBT) -10,276,000.0
201
- Tax on other operating income 3,596,600.0
202
- Other operating income, after tax (OOIAT) 0.0
203
- Total 245,151,550.0
204
-
238
+ Operating income after sales, after tax (OISAT) 509,300,000.0
239
+ Other operating income, before tax (OIBT) 0.0
240
+ Tax on other operating income -0.0
241
+ Other operating income, after tax (OOIAT) 0.0
242
+ Total 509,300,000.0
243
+
205
244
  Net financing income, after tax (NFI)
206
- Financing income, before tax (FIBT) -16,247,000.0
207
- Tax effect (FIBT_TAX_EFFECT) 5,686,450.0
208
- Financing income, after tax (FIAT) 0.0
209
- Total -10,560,550.0
210
-
211
- Comprehensive (CI)
212
- Operating income, after tax (OI) 245,151,550.0
213
- Net financing income, after tax (NFI) -10,560,550.0
214
- Total 234,591,000.0
215
-
216
- Cash Flow Statement (2010-12-04 to 2011-03-04)
217
- Cash and Cash Equivalents, Period Increase (Decrease) (loc_CashAndCashEquivalentsPeriodIncreaseDecrease_2)
218
- [c] Adjustments Noncash Items To Reconcile Net Income Los... 2,703,000.0
219
- [c] Net Income Loss 234,591,000.0
220
- [c] Depreciation And Amortization 66,286,000.0
221
- [c] Share Based Compensation 70,992,000.0
222
- [c] Deferred Income Taxes And Tax Credits 28,645,000.0
223
- [c] Unrealized Gain Loss On Investments -1,330,000.0
224
- [c] Increase Decrease In Receivables 20,605,000.0
225
- [c] Increase Decrease In Prepaid Deferred Expense And Oth... -2,716,000.0
226
- [c] Increase Decrease In Accounts Payable 2,310,000.0
227
- [c] Increase Decrease In Accrued Liabilities -110,084,000.0
228
- [c] Other Increase Decrease In Provision For Restructuring -2,526,000.0
229
- [c] Increase Decrease In Accrued Income Taxes Payable 8,905,000.0
230
- [c] Increase Decrease In Deferred Revenue 13,721,000.0
231
- [d] Purchases Long Term Investments Other Assets -5,389,000.0
232
- [i] Payments To Acquire Short Term Investments -375,077,000.0
233
- [d] Proceeds From Maturities Of Short Term Investments 134,296,000.0
234
- [i] Proceeds From Sale Of Short Term Investments 217,407,000.0
235
- [i] Payments To Acquire Property Plant And Equipment -32,421,000.0
236
- [i] Payments To Acquire Businesses Net Of Cash Acquired -36,572,000.0
237
- [d] Proceeds From Sale Of Available For Sale Securities E... 2,755,000.0
238
- [i] Payments For Proceeds From Other Investing Activities -124,000.0
239
- [f] Payments For Repurchase Of Common Stock -125,000,000.0
240
- [f] Proceeds From Sale Of Treasury Stock 40,651,000.0
241
- [d] Repayments Of Long Term Debt And Capital Securities -2,169,000.0
242
- [d] Effect Of Exchange Rate On Cash And Cash Equivalents -194,000.0
243
- Total 150,265,000.0
244
-
245
- Cash from operations
246
- [c] Adjustments Noncash Items To Reconcile Net Income Los... 2,703,000.0
247
- [c] Net Income Loss 234,591,000.0
248
- [c] Depreciation And Amortization 66,286,000.0
249
- [c] Share Based Compensation 70,992,000.0
250
- [c] Deferred Income Taxes And Tax Credits 28,645,000.0
251
- [c] Unrealized Gain Loss On Investments -1,330,000.0
252
- [c] Increase Decrease In Receivables 20,605,000.0
253
- [c] Increase Decrease In Prepaid Deferred Expense And Oth... -2,716,000.0
254
- [c] Increase Decrease In Accounts Payable 2,310,000.0
255
- [c] Increase Decrease In Accrued Liabilities -110,084,000.0
256
- [c] Other Increase Decrease In Provision For Restructuring -2,526,000.0
257
- [c] Increase Decrease In Accrued Income Taxes Payable 8,905,000.0
258
- [c] Increase Decrease In Deferred Revenue 13,721,000.0
259
- Total 332,102,000.0
260
-
261
- Cash investments in operations
262
- [i] Payments To Acquire Short Term Investments -375,077,000.0
263
- [i] Proceeds From Sale Of Short Term Investments 217,407,000.0
264
- [i] Payments To Acquire Property Plant And Equipment -32,421,000.0
265
- [i] Payments To Acquire Businesses Net Of Cash Acquired -36,572,000.0
266
- [i] Payments For Proceeds From Other Investing Activities -124,000.0
267
- Total -226,787,000.0
268
-
269
- Payments to debtholders
270
- [d] Purchases Long Term Investments Other Assets -5,389,000.0
271
- [d] Proceeds From Maturities Of Short Term Investments 134,296,000.0
272
- [d] Proceeds From Sale Of Available For Sale Securities E... 2,755,000.0
273
- [d] Repayments Of Long Term Debt And Capital Securities -2,169,000.0
274
- [d] Effect Of Exchange Rate On Cash And Cash Equivalents -194,000.0
275
- [d] Investment in Cash and Equivalents -150,265,000.0
276
- Total -20,966,000.0
277
-
278
- Payments to stockholders
279
- [f] Payments For Repurchase Of Common Stock -125,000,000.0
280
- [f] Proceeds From Sale Of Treasury Stock 40,651,000.0
281
- Total -84,349,000.0
282
-
283
- Free Cash Flow
284
- Cash from Operations (C) 332,102,000.0
285
- Cash Investment in Operations (I) -226,787,000.0
286
- Total 105,315,000.0
287
-
288
- Financing Flows
289
- Payments to debtholders (d) -20,966,000.0
290
- Payments to stockholders (F) -84,349,000.0
291
- Total -105,315,000.0
292
-
245
+ Financing income, before tax (FIBT) 18,000,000.0
246
+ Tax effect (FIBT_TAX_EFFECT) -6,300,000.0
247
+ Financing income, after tax (FIAT) -137,000,000.0
248
+ Total -125,300,000.0
249
+
250
+ Comprehensive income (CI)
251
+ Operating income, after tax (OI) 509,300,000.0
252
+ Net financing income, after tax (NFI) -125,300,000.0
253
+ Total 384,000,000.0
254
+
255
+ WARNING: cash flow statement period is nil!
256
+ WARNING: reformulated cash flow statement period is nil!
257
+ Disclosures
258
+ Disclosure Identifiable Intangible Asset Balances (http://www.nikeinc.com/taxonomy/role/DisclosureIdentifiableIntangibleAssetBalances)
259
+ Finite Lived Intangible Assets Gross 169,000,000.0
260
+ Finite Lived Intangible Assets Accumulated Amortization 78,000,000.0
261
+ Indefinite Lived Trademarks 283,000,000.0
262
+ Total 530,000,000.0
263
+
264
+ Disclosure Accrued Liabilities (http://www.nikeinc.com/taxonomy/role/DisclosureAccruedLiabilities)
265
+ Accrued Compensation And Benefits Excluding Taxes Current 502,000,000.0
266
+ Accrued Taxes Other Than Income Taxes Current 238,000,000.0
267
+ Accrued Endorsement Liabilities Current 212,000,000.0
268
+ Dividends Payable Current 188,000,000.0
269
+ Accrued Marketing Costs Current 137,000,000.0
270
+ Accrued Import And Logistics Costs Current 124,000,000.0
271
+ Derivative Liabilities Current 83,000,000.0
272
+ Other Accrued Liabilities Current 395,000,000.0
273
+ Total 1,879,000,000.0
274
+
275
+ Disclosure Financial Assets And Liabilities Measured At Fair Value On Recurring Basis (http://www.nikeinc.com/taxonomy/role/DisclosureFinancialAssetsAndLiabilitiesMeasuredAtFairValueOnRecurringBasis)
276
+ Derivative Fair Value Of Derivative Asset 129,000,000.0
277
+ Total 129,000,000.0
278
+
279
+ Disclosure Reconciliation From Basic Earnings Per Share To Diluted Earnings Per Share (http://www.nikeinc.com/taxonomy/role/DisclosureReconciliationFromBasicEarningsPerShareToDilutedEarningsPerShare)
280
+ Income Loss From Continuing Operations Per Basic Share 0.58
281
+ Income Loss From Discontinued Operations Net Of Tax Per -0.15
282
+ Basic Share
283
+ Income Loss From Continuing Operations Per Diluted Share 0.57
284
+ Income Loss From Discontinued Operations Net Of Tax Per -0.15
285
+ Diluted Share
286
+ Weighted Average Number Of Shares Outstanding Basic 897,000,000.0
287
+ Incremental Common Shares Attributable To Share Based 16,100,000.0
288
+ Payment Arrangements
289
+ Total 913,100,000.85
290
+
291
+ Disclosure Components Of Assets And Liabilities Classified As Held For Sale (http://www.nikeinc.com/taxonomy/role/DisclosureComponentsOfAssetsAndLiabilitiesClassifiedAsHeldForSale)
292
+ Disposal Group Including Discontinued Operation Accounts 129,000,000.0
293
+ Notes And Loans Receivable Net
294
+ Disposal Group Including Discontinued Operation Inventory 130,000,000.0
295
+ Disposal Group Including Discontinued Operation Deferred 32,000,000.0
296
+ Income Taxes And Other Assets
297
+ Disposal Group Including Discontinued Operation Property 53,000,000.0
298
+ Plant And Equipment Net
299
+ Disposal Group Including Discontinued Operation Intangible 0.0
300
+ Assets Net
301
+ Disposal Group Including Discontinued Operation Accounts 39,000,000.0
302
+ Payable
303
+ Disposal Group Including Discontinued Operation Accrued 127,000,000.0
304
+ Liabilities
305
+ Disposal Group Including Discontinued Operation Deferred 32,000,000.0
306
+ Income Taxes Payable And Other Liabilities
307
+ Total 542,000,000.0
308
+
309
+ Disclosure Information By Operating Segments (http://www.nikeinc.com/taxonomy/role/DisclosureInformationByOperatingSegments)
310
+ Earnings Before Interest And Taxes 711,000,000.0
311
+ Interest Income Expense Nonoperating Net 1,000,000.0
312
+ Total 712,000,000.0