Compare commits

..

2 Commits

Author SHA1 Message Date
Chris Diesch
ce94312099 Take the downpayment as a number from 0-1 2025-04-06 16:18:12 -06:00
Chris Diesch
8c9ef5ced8 Take the downpayment as a number from 0-1 2025-04-06 16:15:42 -06:00

View File

@ -69,7 +69,13 @@ def get_risk_pool_health() -> float:
def compute_mre(home_value: float, def compute_mre(home_value: float,
down_payment: float, down_payment: float,
consumer_fico: int) -> float: consumer_fico: int) -> float:
if down_payment < 0 or down_payment > 1:
raise ValueError('The down_payment must be between 0 and 1')
if consumer_fico < 620 or consumer_fico > 850:
raise ValueError('The consumer_fico must between 620 and 850')
down_payment *= home_value
investor_value = home_value - down_payment investor_value = home_value - down_payment
loan_to_value = float(investor_value/home_value) loan_to_value = float(investor_value/home_value)
# the monthly payment is made on the value from the investors # the monthly payment is made on the value from the investors