Reference 〉Class

CES( list[str]|dict{str:num} goods, num elast )

A subclass of Utility representing a constant elasticity of substitution utility function U=(∑n βn1/σGn(σ-1)/σ)σ/(σ-1). The elasticity of substitution is identical and constant between all pairs of goods, otherwise there is no fully general form.

Initialization Parameters

  • goods list[str]|dict{str:num}, required

    Either a list of goods, in which case all coefficients will be set to 1, or a dict where the keys are the goods and the values are the corresponding coefficients. The list may, but does not have to, correspond to the goods registered in model.addGood().

  • elast num, required

    The elasticity of substitution (σ in the formula above).


Click a method name for more detailed documentation.

  • demand( income, prices )

    Calculates the total demand for the various goods given some income. See the derivation from the utility function here.

  • mrs( good1, q1, good2, … )

    Calculates the marginal rate of substitution between two goods.

  • mu( quantities )

    Calculates the marginal utilities of the goods in question on the basis of the entered quantities. The CES function is such that the quantities of all goods are necessary to calculate the marginal utility of any good.

  • calculate( quantities )

    Calculates the agent's utility on the basis of the quantities entered.


  • elast num

    Stores the elasticity of substitution.

  • coeffs dict{str:num}

    Stores the coefficients on the goods (β in the formula above).

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.