Economics and Finance (economics-finance-ai999x)
Economics and Finance covers time value of money, loans and annuities, bonds, stocks and options, portfolio theory, risk measures, actuarial mathematics, microeconomics, macroeconomics and econometrics: 105 calculations in 15 topics, each with its formula, its steps and its units, and a plain reason instead of a number when an input is missing or out of range. One compiled engine, four ways to use it: the desktop app, the command line, the browser and Python. Everything runs on your own computer, offline.
Four ways to use it
| Desktop app (Windows, Linux) | Windows · Linux |
Command line economics-finance (Windows, Linux) |
Windows · Linux |
| Browser (any device) | Try it on the model page |
| Python 3.10+ | pip install economics-finance-ai999x: on Windows and Linux (x86-64) pip installs the same compiled engine; on other systems (macOS, ARM) it installs a pure-Python build that gives the same answers |
See it
From the Economics and Finance desktop app: every scene and chart is drawn from the computed answer.
Charts:
![]() Loan payment (amortizing loan) |
![]() Internal rate of return |
![]() Black-Scholes option prices |
![]() Bond price from its yield |
Ask in words: 15 examples
Each question below was asked on this release; the comment under it is the line it printed.
import economics_finance_ai999x as economics_finance
a = economics_finance.ask(
"Find the discounted payback period with rate = 10%, cash flows = "
"[-1000, 300, 400, 500, 200]."
)
print(a.outcome, a.values)
# SOLVED {'discounted_payback': 3.154000000000001}
a = economics_finance.ask(
"Find the compound annual growth rate with begin value = 1000, end "
"value = 2000, years = 5."
)
print(a.outcome, a.values)
# SOLVED {'cagr': 0.1486983549970351, 'total_growth': 1.0}
a = economics_finance.ask(
"Find the life expectancy with mortality rates = [0.1, 0.3, 0.6, "
"1]."
)
print(a.outcome, a.values)
# SOLVED {'curtate': 1.782, 'complete': 2.282}
a = economics_finance.ask(
"Find the equivalent annual annuity with rate = 10%, cash flows = "
"[-1000, 300, 400, 500]."
)
print(a.outcome, a.values)
# SOLVED {'eaa': -8.459214501510571, 'npv': -21.036814425244188}
a = economics_finance.ask(
"Find the maximum drawdown with prices = [100, 120, 90, 110, 80, "
"130]."
)
print(a.outcome, a.values)
# SOLVED {'max_drawdown': 0.33333333333333337}
a = economics_finance.ask(
"Find the compound interest with principal = 1000, rate = 5%, "
"years = 2."
)
print(a.outcome, a.values)
# SOLVED {'amount': 1102.5, 'interest': 102.5}
a = economics_finance.ask(
"Find the convexity with face = 1000, coupon rate = 5%, years = "
"10, ytm = 6%, frequency = 2."
)
print(a.outcome, a.values)
# SOLVED {'convexity': 71.78539801290005, 'price': 925.6126256977227}
a = economics_finance.ask(
"Find the internal rate of return with cash flows = [-1000, 300, "
"400, 500]."
)
print(a.outcome, a.values)
# SOLVED {'irr': 0.08896339469334996}
a = economics_finance.ask(
"Find the Durbin-Watson statistic with residuals = [0.5, -0.3, "
"0.2, -0.4, 0.1]."
)
print(a.outcome, a.values)
# SOLVED {'durbin_watson': 2.7272727272727275}
a = economics_finance.ask(
"Find the amount with continuous compounding with principal = "
"1000, rate = 5%, years = 10."
)
print(a.outcome, a.values)
# SOLVED {'amount': 1648.7212707001281, 'interest': 648.7212707001281}
a = economics_finance.ask(
"Find the forward rate with s1 = 4%, t1 = 1, s2 = 5%, t2 = 2."
)
print(a.outcome, a.values)
# SOLVED {'forward_rate': 0.060096153846153744}
a = economics_finance.ask(
"Find the number of payments with present value = 10000, payment = "
"500, rate = 1%."
)
print(a.outcome, a.values)
# SOLVED {'periods': 22.425741878036437}
a = economics_finance.ask(
"Find the cross-price elasticity with p1 = 2, q1 = 100, p2 = 2.5, "
"q2 = 120."
)
print(a.outcome, a.values)
# SOLVED {'elasticity': 0.8181818181818182, 'relationship': 'substitutes'}
a = economics_finance.ask("Find the doubling time with rate = 6%.")
print(a.outcome, a.values)
# SOLVED {'periods': 11.895661045941875, 'rule_of_72': 12.0}
a = economics_finance.ask(
"Find the temporary annuity value with mortality rates = [0.01, "
"0.02, 0.03], interest rate = 4%, term = 3, payment = 1000."
)
print(a.outcome, a.values)
# SOLVED {'apv': 2848.9275147928993}
Command line: 15 examples
Each command below was run with economics-finance of this release; the lines under it are the answer it printed (the full answer goes on with the method, every input in SI units and the conditions it assumes).
$ economics-finance solve financial_ratios sales=500000 net_income=40000 total_assets=400000 total_equity=160000 current_assets=150000 current_liabilities=100000 inventory=60000
current_ratio = 1.5
quick_ratio = 0.9
debt_ratio = 0.6
debt_to_equity = 1.5
net_profit_margin = 0.08
asset_turnover = 1.25
$ economics-finance solve endowment_insurance "mortality_rates=[0.01, 0.02, 0.03]" interest_rate=0.04 term=3 benefit=1000
apv = 890.4258648
term_part = 53.79672565
pure_endowment = 836.6291392
$ economics-finance solve bond_price_change face=1000 coupon_rate=0.05 years=10 ytm=0.06 yield_change=0.01 frequency=2
duration_estimate = -70.94863318
duration_convexity_estimate = -67.62635965
actual_change = -67.73665872
new_price = 857.875967
price = 925.6126257
$ economics-finance solve discounted_payback rate=0.1 "cash_flows=[-1000, 300, 400, 500, 200]"
discounted_payback = 3.154
$ economics-finance solve credit_card_finance_charge opening_balance=1500 apr=0.18 billing_days=30 rate_basis=daily "transaction_days=[11, 21]" "transaction_amounts=[-500, 200]"
average_daily_balance = 1233.333333
finance_charge = 18.24657534
cycle_rate = 0.01479452055
closing_balance = 1200
new_balance = 1218.246575
$ economics-finance solve log_log_elasticity "prices=[1, 2, 4, 8]" "quantities=[100, 50, 25, 12.5]"
elasticity = -1
intercept = 4.605170186
r_squared = 1
$ economics-finance solve comparative_advantage a_good_x=6 a_good_y=3 b_good_x=1 b_good_y=2 basis=output
opportunity_cost_x_a = 0.5
opportunity_cost_y_a = 2
opportunity_cost_x_b = 2
opportunity_cost_y_b = 0.5
comparative_advantage_x = country A
comparative_advantage_y = country B
$ economics-finance solve loan_cumulative_interest principal=200000 annual_rate=0.06 years=30 payments_made=12
cumulative_interest = 11933.18918
principal_repaid = 2456.023425
$ economics-finance solve inflation_adjustment "price_levels=[100, 103, 107.12]" amount=1000
total_inflation = 0.0712
average_inflation = 0.03498792263
real_value = 933.5324869
$ economics-finance solve break_even fixed_costs=10000 price=50 variable_cost=30
quantity = 500
revenue = 25000
contribution_margin = 20
contribution_margin_ratio = 0.4
$ economics-finance solve mean_returns "returns=[0.1, -0.05, 0.2]"
arithmetic_mean = 0.08333333333
geometric_mean = 0.07836515339
cumulative_return = 0.254
$ economics-finance solve historical_var "returns=[-0.02, 0.01, -0.035, 0.004, 0.012, -0.01, 0.02, -0.005, 0.007, 0.001, -0.015]" confidence=0.9
var = 0.02
cvar = 0.0275
tail_observations = 2
$ economics-finance solve capm risk_free=0.03 beta=1.2 market_return=0.09
expected_return = 0.102
market_risk_premium = 0.06
risk_premium = 0.072
$ economics-finance solve binomial_option spot=100 strike=100 time=1 rate=0.05 volatility=0.2 steps=3
price = 11.04387109
delta = 0.6140855606
up_factor = 1.122400902
probability_up = 0.5437765964
$ economics-finance solve cagr begin_value=1000 end_value=2000 years=5
cagr = 0.148698355
total_growth = 1
Guides
- Desktop app guide: the window, every calculation, scenes and charts: PDF · HTML · Markdown
- Python guide: every calculation with a Python example: PDF · HTML · Markdown
- Command-line guide: every calculation with the command and what it printed: PDF · HTML · Markdown
Every calculation, with its formula, a worked example and its figures: Economics and Finance on ai999x.com. Install guides for the app and the command line: https://www.ai999x.com/desktop-cli/.
Version 1.6.7 · License: Apache-2.0 · Author: Ibnul Jaif Farabi · Organization: AI999X · Contact: [email protected] · Support the project
The Future Is Self-Improving.
- Downloads last month
- 286
Collections including AI999X/economics-finance-ai999x
Evaluation results
- identical on every platform on Golden answers (453 documented questions, Windows + Linux Python 3.10-3.14)self-reported1.000













