Class: FinModeling::IncomeStatementAnalyses
Instance Attribute Summary
#header_row, #key_width, #max_decimals, #rows, #title, #totals_row_enabled, #val_width
Instance Method Summary
collapse
#+, #auto_scale!, #filter_by_type, #insert_column_before, #num_value_columns, #print, #total, #totals, #write_constructor
Constructor Details
Returns a new instance of IncomeStatementAnalyses.
6
7
8
9
10
11
12
13
14
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 6
def initialize(calc_summary)
@title = calc_summary.title
@rows = calc_summary.rows
@header_row = calc_summary.
@key_width = calc_summary.key_width
@val_width = calc_summary.val_width
@max_decimals = calc_summary.max_decimals
@totals_row_enabled = false
end
|
Instance Method Details
#fi_over_nfa_row ⇒ Object
70
71
72
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 70
def fi_over_nfa_row
find_row_by_key('FI / NFA')
end
|
#find_row_by_key(key) ⇒ Object
74
75
76
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 74
def find_row_by_key(key)
self.rows.find{ |x| x.key == key }
end
|
#operating_pm_row ⇒ Object
62
63
64
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 62
def operating_pm_row
find_row_by_key('Operating PM')
end
|
#print_regressions ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 16
def print_regressions
if revenue_growth_row && revenue_growth_row.valid_vals.any?
lr = revenue_growth_row.valid_vals.linear_regression
puts "\t\trevenue growth: "+
"a:#{lr.a.to_s.cap_decimals(4)}, "+
"b:#{lr.b.to_s.cap_decimals(4)}, "+
"r²:#{lr.r2.to_s.cap_decimals(4)}, "+
"σ²:#{revenue_growth_row.valid_vals.variance.to_s.cap_decimals(4)}, " +
( (lr.r2 > 0.6) ? "strong fit" : ( (lr.r2 < 0.2) ? "weak fit [**]" : "avg fit") )
end
if sales_over_noa_row && sales_over_noa_row.valid_vals.any?
lr = sales_over_noa_row.valid_vals.linear_regression
puts "\t\tsales / noa: "+
"a:#{lr.a.to_s.cap_decimals(4)}, "+
"b:#{lr.b.to_s.cap_decimals(4)}, "+
"r²:#{lr.r2.to_s.cap_decimals(4)}, "+
"σ²:#{sales_over_noa_row.valid_vals.variance.to_s.cap_decimals(4)}, " +
( (lr.r2 > 0.6) ? "strong fit" : ( (lr.r2 < 0.2) ? "weak fit [**]" : "avg fit") )
end
if operating_pm_row && operating_pm_row.valid_vals.any?
lr = operating_pm_row.valid_vals.linear_regression
puts "\t\toperating pm: "+
"a:#{lr.a.to_s.cap_decimals(4)}, "+
"b:#{lr.b.to_s.cap_decimals(4)}, "+
"r²:#{lr.r2.to_s.cap_decimals(4)}, "+
"σ²:#{operating_pm_row.valid_vals.variance.to_s.cap_decimals(4)}, " +
( (lr.r2 > 0.6) ? "strong fit" : ( (lr.r2 < 0.2) ? "weak fit [**]" : "avg fit") )
end
if fi_over_nfa_row && fi_over_nfa_row.valid_vals.any?
lr = fi_over_nfa_row.valid_vals.linear_regression
puts "\t\tfi / nfa: "+
"a:#{lr.a.to_s.cap_decimals(4)}, "+
"b:#{lr.b.to_s.cap_decimals(4)}, "+
"r²:#{lr.r2.to_s.cap_decimals(4)}, "+
"σ²:#{fi_over_nfa_row.valid_vals.variance.to_s.cap_decimals(4)}, " +
( (lr.r2 > 0.6) ? "strong fit" : ( (lr.r2 < 0.2) ? "weak fit [**]" : "avg fit") )
end
end
|
#revenue_growth_row ⇒ Object
58
59
60
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 58
def revenue_growth_row
find_row_by_key('Revenue Growth')
end
|
#sales_over_noa_row ⇒ Object
66
67
68
|
# File 'lib/finmodeling/income_statement_analyses.rb', line 66
def sales_over_noa_row
find_row_by_key('Sales / NOA')
end
|