translogHessian: Hessian matrix of a translog function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/translogHessian.R

Description

Calculate the Hessian matrices of a translog function.

Usage

1
2
   translogHessian( xNames, data, coef, yName = NULL,
   dataLogged = FALSE, bordered = FALSE )

Arguments

xNames

a vector of strings containing the names of the independent variables.

data

dataframe containing the data.

coef

vector containing all coefficients.

yName

an optional string containing the name of the dependent variable. If it is NULL, the dependent variable is calculated from the independent variables and the coefficients.

dataLogged

logical. Are the values in data already logged?

bordered

logical. Should the bordered Hessians be returned?

Value

a list containing following the (bordered) Hessian matrices at each data point.

Author(s)

Arne Henningsen

See Also

translogEst, translogDeriv and translogCalc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
   data( germanFarms )
   # output quantity:
   germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput
   # quantity of variable inputs
   germanFarms$qVarInput <- germanFarms$vVarInput / germanFarms$pVarInput
   # a time trend to account for technical progress:
   germanFarms$time <- c(1:20)

   # estimate a quadratic production function
   estResult <- translogEst( "qOutput", c( "qLabor", "land", "qVarInput", "time" ),
      germanFarms )

   # compute the Hessian matrices (with "fitted" output)
   hessians <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ),
      germanFarms, coef( estResult ) )
   hessians[[ 1 ]]

   # compute the Hessian matrices (with observed output)
   hessiansObs <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ),
      germanFarms, coef( estResult ), "qOutput" )
   hessiansObs[[ 1 ]]

   # compute the bordered Hessian matrices
   borderedHessians <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ),
      germanFarms, coef( estResult ), bordered = TRUE )
   borderedHessians[[ 1 ]]

Example output

If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
https://r-forge.r-project.org/projects/micecon/
            [,1]        [,2]         [,3]        [,4]
[1,] 27959.37971 1467.128231 -55.91241396 -988.366735
[2,]  1467.12823   21.892525  -1.47398467  -10.776912
[3,]   -55.91241   -1.473985   0.05330022    3.183619
[4,]  -988.36673  -10.776912   3.18361923 -394.215222
            [,1]        [,2]         [,3]        [,4]
[1,] 28023.54428 1470.495175 -56.04072855 -990.634959
[2,]  1470.49518   21.942767  -1.47736735  -10.801644
[3,]   -56.04073   -1.477367   0.05342254    3.190925
[4,]  -990.63496  -10.801644   3.19092539 -395.119915
            [,1]        [,2]        [,3]         [,4]        [,5]
[1,]    0.000000  6137.01012  163.844242  -7.04371591  208.283709
[2,] 6137.010120 27959.37971 1467.128231 -55.91241396 -988.366735
[3,]  163.844242  1467.12823   21.892525  -1.47398467  -10.776912
[4,]   -7.043716   -55.91241   -1.473985   0.05330022    3.183619
[5,]  208.283709  -988.36673  -10.776912   3.18361923 -394.215222

micEcon documentation built on Jan. 7, 2021, 3:01 p.m.