Skip to content

Commit

Permalink
dcf the first cash flow should be discounted by 0 periods
Browse files Browse the repository at this point in the history
  • Loading branch information
tamilselvanarjun committed Mar 17, 2024
1 parent 484c7c2 commit 740644a
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build/lib/finmodels/dcf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# financial_models/dcf.py
def calculate_dcf(cash_flows, discount_rate):
"""
Calculate the Discounted Cash Flow (DCF) valuation.
Expand All @@ -10,5 +9,5 @@ def calculate_dcf(cash_flows, discount_rate):
Returns:
- DCF value
"""
dcf_value = sum(cf / (1 + discount_rate) ** (i + 1) for i, cf in enumerate(cash_flows))
return dcf_value
dcf_value = sum(cf / (1 + discount_rate) ** i for i, cf in enumerate(cash_flows))
return dcf_value
Binary file removed dist/finmodels-2.0.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/finmodels-2.0.1.tar.gz
Binary file not shown.
Binary file added dist/finmodels-2.0.2-py3-none-any.whl
Binary file not shown.
Binary file added dist/finmodels-2.0.2.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion finmodels.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: finmodels
Version: 2.0.1
Version: 2.0.2
Summary: finmodels is a Python package that provides various financial models for analysis and optimization.
Home-page: https://github.com/arjunlimat/finmodels
Author: Tamilselvan_Arjunan
Expand Down
5 changes: 2 additions & 3 deletions finmodels/dcf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# financial_models/dcf.py
def calculate_dcf(cash_flows, discount_rate):
"""
Calculate the Discounted Cash Flow (DCF) valuation.
Expand All @@ -10,5 +9,5 @@ def calculate_dcf(cash_flows, discount_rate):
Returns:
- DCF value
"""
dcf_value = sum(cf / (1 + discount_rate) ** (i + 1) for i, cf in enumerate(cash_flows))
return dcf_value
dcf_value = sum(cf / (1 + discount_rate) ** i for i, cf in enumerate(cash_flows))
return dcf_value
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='finmodels',
version='2.0.1',
version='2.0.2',
packages=find_packages(),
install_requires=[
'numpy',
Expand Down

0 comments on commit 740644a

Please sign in to comment.