Open tpemartin opened 1 year ago
def ces_para(sigma,alpha):
def ces(x, y):
return (alpha*x**(-sigma)+(1-alpha)*y**(-sigma))**(-1/sigma)
return ces
ces=ces_para(0.5,0.7)
ces(1,2)
def CES(sigma, alpha):
def ces(x, y):
return (alpha * x ** (-sigma) + (1-alpha) * y ** (-sigma)) ** (-1/ sigma)
return ces
ces = CES(0.2, 0.8)
ces(10,20)
class CES:
def __init__(self, sigma, alpha):
self.sigma=sigma
self.alpha=alpha
def utility(self, x, y):
return (self.alpha*x**(-self.sigma)+(1-self.alpha)*y**(-self.sigma))**(-1/self.sigma)
ces=CES(0.5, 0.7)
ces.utility(10, 20)