cesCalc function

Calculate CES function

Calculate CES function

Calculate the endogenous variable of a Constant Elasticity of Substitution (CES) function.

The original CES function with two explanatory variables is

[REMOVE_ME]y=γexp(λt)(δx1ρ+(1δ)x2ρ)νρ y = \gamma \: \exp ( \lambda \: t ) \:( \delta \: x_1^{-\rho} + ( 1 - \delta ) \: x_2^{-\rho} )^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *( delta * x1^(-rho) + ( 1 - delta ) * x2^(-rho) )^(-nu/rho) [REMOVE_ME_2]

and the non-nested CES function with NN explanatory variables is

[REMOVE_ME]y=γexp(λt)(i=1Nδixiρ)νρ y = \gamma \: \exp ( \lambda \: t ) \:\left( \sum_{i=1}^N \delta_i \: x_i^{-\rho} \right)^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *( sum(i=1 to N) delta_i * x_i^(-rho) )^(-nu/rho) [REMOVE_ME_2]

where in the latter case sum(i=1toN)deltai=1sum(i=1 to N) delta_i = 1.

In both cases, the elesticity of substitution is s=1/(1+rho)s = 1 / ( 1 + rho ).

The nested CES function with 3 explanatory variables proposed by Sato (1967) is

[REMOVE_ME]y=γexp(λt)[δ(δ1x1ρ1+(1δ1)x2ρ1)ρρ1+(1δ)x3ρ]νρ y = \gamma \: \exp ( \lambda \: t ) \: \left[\delta \:\left( \delta_1 \: x_1^{-\rho_1} +( 1 - \delta_1 ) x_2^{-\rho_1} \right)^{\frac{\rho}{\rho_1}} +( 1 - \delta ) x_3^{-\rho}\right]^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) * [ delta *( delta_1 * x_1^(-rho_1) + ( 1 - delta_1 ) * x_2^(-rho_1) )^(rho / rho_1) +( 1 - delta ) * x_3^(-rho)]^(-nu / rho) [REMOVE_ME_2]

and the nested CES function with 4 explanatory variables (a generalisation of the version proposed by Sato, 1967) is

[REMOVE_ME]y=γexp(λt)[δ(δ1x1ρ1+(1δ1)x2ρ1)ρρ1+(1δ)(δ2x3ρ2+(1δ2)x4ρ2)ρρ2]νρ y = \gamma \: \exp ( \lambda \: t ) \: \left[ \delta \cdot\left( \delta_1 \: x_1^{-\rho_1} +( 1 - \delta_1 ) x_2^{-\rho_1} \right)^{\frac{\rho}{\rho_1}} +( 1 - \delta ) \cdot\left( \delta_2 \: x_3^{-\rho_2} +( 1 - \delta_2 ) x_4^{-\rho_2} \right)^{\frac{\rho}{\rho_2}}\right]^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *[ delta ( delta_1 * x_1^(-rho_1) + ( 1 - delta_1 ) * x_2^(-rho_1) )^(rho / rho_1) +( 1 - delta ) ( delta_2 * x_3^(-\rho_2) + ( 1 - delta_2 ) * x_4^(-rho_2) )^(rho / rho_2)]^(-nu / rho) [REMOVE_ME_2]

Description

Calculate the endogenous variable of a Constant Elasticity of Substitution (CES) function.

The original CES function with two explanatory variables is

y=γexp(λt)(δx1ρ+(1δ)x2ρ)νρ y = \gamma \: \exp ( \lambda \: t ) \:( \delta \: x_1^{-\rho} + ( 1 - \delta ) \: x_2^{-\rho} )^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *( delta * x1^(-rho) + ( 1 - delta ) * x2^(-rho) )^(-nu/rho)

and the non-nested CES function with NN explanatory variables is

y=γexp(λt)(i=1Nδixiρ)νρ y = \gamma \: \exp ( \lambda \: t ) \:\left( \sum_{i=1}^N \delta_i \: x_i^{-\rho} \right)^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *( sum(i=1 to N) delta_i * x_i^(-rho) )^(-nu/rho)

where in the latter case sum(i=1toN)deltai=1sum(i=1 to N) delta_i = 1.

In both cases, the elesticity of substitution is s=1/(1+rho)s = 1 / ( 1 + rho ).

The nested CES function with 3 explanatory variables proposed by Sato (1967) is

y=γexp(λt)[δ(δ1x1ρ1+(1δ1)x2ρ1)ρρ1+(1δ)x3ρ]νρ y = \gamma \: \exp ( \lambda \: t ) \: \left[\delta \:\left( \delta_1 \: x_1^{-\rho_1} +( 1 - \delta_1 ) x_2^{-\rho_1} \right)^{\frac{\rho}{\rho_1}} +( 1 - \delta ) x_3^{-\rho}\right]^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) * [ delta *( delta_1 * x_1^(-rho_1) + ( 1 - delta_1 ) * x_2^(-rho_1) )^(rho / rho_1) +( 1 - delta ) * x_3^(-rho)]^(-nu / rho)

and the nested CES function with 4 explanatory variables (a generalisation of the version proposed by Sato, 1967) is

y=γexp(λt)[δ(δ1x1ρ1+(1δ1)x2ρ1)ρρ1+(1δ)(δ2x3ρ2+(1δ2)x4ρ2)ρρ2]νρ y = \gamma \: \exp ( \lambda \: t ) \: \left[ \delta \cdot\left( \delta_1 \: x_1^{-\rho_1} +( 1 - \delta_1 ) x_2^{-\rho_1} \right)^{\frac{\rho}{\rho_1}} +( 1 - \delta ) \cdot\left( \delta_2 \: x_3^{-\rho_2} +( 1 - \delta_2 ) x_4^{-\rho_2} \right)^{\frac{\rho}{\rho_2}}\right]^{-\frac{\nu}{\rho}}%y = gamma * exp( lambda * t ) *[ delta ( delta_1 * x_1^(-rho_1) + ( 1 - delta_1 ) * x_2^(-rho_1) )^(rho / rho_1) +( 1 - delta ) ( delta_2 * x_3^(-\rho_2) + ( 1 - delta_2 ) * x_4^(-rho_2) )^(rho / rho_2)]^(-nu / rho)
cesCalc( xNames, data, coef, tName = NULL, nested = FALSE, rhoApprox = 5e-6 )

Arguments

  • xNames: a vector of strings containing the names of the explanatory variables.

  • data: data frame containing the explanatory variables.

  • coef: numeric vector containing the coefficients of the CES: if the vector is unnamed, the order of the coefficients must be gammagamma, eventuelly lambdalambda, deltadelta, rhorho, and eventually nunu

    in case of two expanatory variables, gammagamma, eventuelly lambdalambda, delta1delta_1, , deltaNdelta_N, rhorho, and eventually nunu

    in case of the non-nested CES with N>2N>2 explanatory variables, gammagamma, eventuelly lambdalambda, delta1delta_1, deltadelta, rho1rho_1, rhorho, and eventually nunu

    in case of the nested CES with 3 explanatory variables, and gammagamma, eventuelly lambdalambda, delta1delta_1, delta2delta_2, deltadelta, rho1rho_1, rho2rho_2, rhorho, and eventually nunu

    in case of the nested CES with 4 explanatory variables, where in all cases the nunu is only required if the model has variable returns to scale. If the vector is named, the names must be "gamma", "delta", "rho", and eventually "nu"

    in case of two expanatory variables, "gamma", "delta_1", , "delta_N", "rho", and eventually "nu"

    in case of the non-nested CES with N>2N>2 explanatory variables, and "gamma", "delta_1", "delta_2", "rho_1", "rho_2", "rho", and eventually "nu"

    in case of the nested CES with 4 explanatory variables, where the order is irrelevant in all cases.

  • tName: optional character string specifying the name of the time variable (tt).

  • nested: logical. ; if FALSE (the default), the original CES for nn inputs proposed by Kmenta (1967) is used; if TRUE, the nested version of the CES for 3 or 4 inputs proposed by Sato (1967) is used.

  • rhoApprox: if the absolute value of the coefficient rhorho, rho1rho_1, or rho2rho_2

    is smaller than or equal to this argument, the endogenous variable is calculated using a first-order Taylor series approximation at the point rhorho = 0 (for non-nested CES functions) or a linear interpolation (for nested CES functions), because this avoids large numerical inaccuracies that frequently occur in calculations with non-linear CES functions if rhorho, rho1rho_1, or rho2rho_2

    have very small values (in absolute terms).

Returns

A numeric vector with length equal to the number of rows of the data set specified in argument data.

References

Kmenta, J. (1967): On Estimation of the CES Production Function. International Economic Review 8, p. 180-189.

Sato, K. (1967): A Two-Level Constant-Elasticity-of-Substitution Production Function. Review of Economic Studies 43, p. 201-218.

See Also

cesEst.

Author(s)

Arne Henningsen and Geraldine Henningsen

Examples

data( germanFarms, package = "micEcon" ) # output quantity: germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput # quantity of intermediate inputs germanFarms$qVarInput <- germanFarms$vVarInput / germanFarms$pVarInput ## Estimate CES: Land & Labor with fixed returns to scale cesLandLabor <- cesEst( "qOutput", c( "land", "qLabor" ), germanFarms ) ## Calculate fitted values cesCalc( c( "land", "qLabor" ), germanFarms, coef( cesLandLabor ) ) # variable returns to scale cesLandLaborVrs <- cesEst( "qOutput", c( "land", "qLabor" ), germanFarms, vrs = TRUE ) ## Calculate fitted values cesCalc( c( "land", "qLabor" ), germanFarms, coef( cesLandLaborVrs ) )
  • Maintainer: Arne Henningsen
  • License: GPL (>= 2)
  • Last published: 2023-01-06