Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE] NaN values in PVGO #129

Closed
giraffeingreen opened this issue Apr 2, 2024 · 7 comments
Closed

[IMPROVE] NaN values in PVGO #129

giraffeingreen opened this issue Apr 2, 2024 · 7 comments

Comments

@giraffeingreen
Copy link

For the following code snippet:

from financetoolkit import Toolkit

toolkit = Toolkit(["NVDA", "AAPL","BRK.B"], api_key=API_KEY, start_date="2000-01-01")

pvgo = toolkit.models.get_present_value_of_growth_opportunities()

I get the following result:

AAPL BRK.B NVDA
2000 0.4451 207.172 1.3462
2001 0.3214 98.699 5.283
2002 0.2313 114.778 1.0905
2003 0.3125 20.3332 1.677
2004 nan 5.1102 1.6264
2005 nan -25.3974 1.8248
2006 nan 3.8913 nan
2007 nan -39.0508 nan
2008 nan 81.6841 nan
2009 nan 48.8492 4.3185
2010 nan 31.844 3.6831
2011 nan -113.76 -2.3902
2012 nan 32.7019 1.6914
2013 10.6612 91.6904 3.0434
2014 10.24 75.3026 3.5505
2015 -197.63 -482.481 -16.096
2016 7.5209 57.8841 24.4573
2017 30.7936 110.427 46.3468
2018 93.9601 248.859 44.3535
2019 64.6675 90.3009 56.1368
2020 113.997 109.681 125.633
2021 159.81 89.0447 290.602
2022 155.176 209.412 154.967
2023 170.215 102.937 491.612
2024 nan nan 815.209

Does the FMP API miss something?

@JerBouma
Copy link
Owner

JerBouma commented Apr 2, 2024

Solved! Total Debt was 0 for Apple which is why you see the NaNs. Please update to v1.8.5.

image

@JerBouma JerBouma closed this as completed Apr 2, 2024
@giraffeingreen
Copy link
Author

NVDA still exhibit a NaN value for 2008? Is this the anticipated behavior?

@JerBouma
Copy link
Owner

JerBouma commented Apr 5, 2024

Ah I see, probably because interest expense is NaN in that case. I'll adjust this later.

@JerBouma JerBouma reopened this Apr 5, 2024
@giraffeingreen
Copy link
Author

Is that because we use WACC instead of the cost of equity, I can implement a flag to swap between using WACC or cost of equity.

@JerBouma
Copy link
Owner

JerBouma commented Apr 5, 2024

Feel free to do so! Makes sense to have both.

@giraffeingreen
Copy link
Author

I also talked to one of my finance teachers, and we figured it'd be better to go with the estimatedNetIncomeAvg from https://site.financialmodelingprep.com/developer/docs/analyst-estimates-api instead of using earnings from current period.

@JerBouma
Copy link
Owner

JerBouma commented Apr 21, 2024

That's indeed also a good option, note that this is obtainable directly from the Finance Toolkit as well: https://www.jeroenbouma.com/projects/financetoolkit/docs#get_analyst_estimates (but I think you are aware of that 😉 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants