Package 'gnrprod'

Title: Estimates Gross Output Functions
Description: Estimation of gross output production functions and productivity in the presence of numerous fixed (nonflexible) and a single flexible input using the nonparametric identification strategy specified in Gandhi, Navarro, and Rivers (2020) <doi:10.1086/707736>. Monte Carlo evidence from the paper demonstrates high performance in estimating production function elasticities.
Authors: David J. Jin [aut, cre]
Maintainer: David J. Jin <[email protected]>
License: GPL-3
Version: 1.1.2
Built: 2024-12-06 06:29:42 UTC
Source: CRAN

Help Index


Print gross output function estimates

Description

Print or return a numeric matrix of the estimated parameters from an object of class 'gnr'.

Usage

## S3 method for class 'gnr'
coef(object, ...)

Arguments

object

an object of class 'gnr'.

...

currently not used.

Value

the named vector of parameter estimates contained in an object of class 'gnr'.


Colombian plant-level production data

Description

Plant-level production data for the food products industry (International Standard Industrial Classification code 311) in Colombia.

Usage

colombian

Format

A data frame with seven variables:

share

log intermediate input's revenue share

id

firm id

year

the last two digits of a year between 1981 and 1991

RGO

log of real gross output with base year 1981

L

log labor in level employee years

K

log real capital stock with base year 1981

RI

log real intermediate inputs with base year 1981

For a complete listing of data, see doi:10.1086/707736.

References

Gandhi, Amit, Salvador Navarro, and David Rivers. 2020. "On the Identification of Gross Output Production Functions." Journal of Political Economy, 128(8): 2973-3016. doi:10.1086/707736.


Estimate flexible input elasticity: Gandhi, Navarro, Rivers (GNR) share regression; first stage

Description

The gnrflex function implements the first stage (share regression) of the GNR production function estimation routine, nonparametrically identifying the flexible input elasticity of the production function. This function is called within the main wrapper function gnrprod. If the production-related inputs are characters, a data.frame must be specified under data. Alternatively, matrices/vectors may be directly specified without specifying data. gnrprod currently supports only one flexible input. The parameters are optimized using the Gauss-Newton algorithm. gnrflex currently supports only one flexible input.

For details, see Gandhi, Navarro, and Rivers (2020).

Usage

gnrflex(output, fixed, flex, share, id, time, data, control)

Arguments

output

name (character) of variable of log gross output in data or a numeric vector.

fixed

name (character or character vector) of variables of log fixed inputs in data or a numeric matrix.

flex

name (character) of variable of log flexible input in data or a numeric vector.

share

name (character) of variable of log intermediate input's revenue share in data or a numeric vector.

id

name (character) of variable of firm id in data or a numeric vector.

time

name (character) of variable of time in data or a numeric vector.

data

data.frame containing all variables with names specified by arguments above (left empty if arguments above are vector/matrix rather than strings).

control

an optional list of convergence settings. See gnrflex.control for listing.

Value

a list of class 'gnrflex' containing three elements:

elas: a list containing six elements describing the share regression:

  • flex_elas: a numeric vector of the estimated flexible input elasticity for each observation.

  • coefficients: a numeric vector of the coefficients of the estimator scaled by a constant. See Gandhi, Navarro, and Rivers (2020, p. 2994, equation (21)).

  • residuals: a numeric vector of the residuals.

  • SSR: sum of squared residuals.

  • iterations: number of iterations performed.

  • convergence: boolean indicating whether convergence was achieved.

arg: a list containing eight elements to be passed to the second stage function gnriv:

  • input: a numeric matrix (S3: poly) of the polynomial expansion of all inputs.

  • input_degree: a numeric matrix corresponding to input denoting each vector's degree.

  • all_input: a numeric matrix of the inputs without polynomial expansion.

  • big_Y: a numeric vector of persistent productivity minus the constant of integration. See Gandhi, Navarro, and Rivers (2020, p. 2991, equation (16)).

  • D_coef: a numeric vector equaling coef divided by an estimate of the constant.

  • id: a numeric vector of the firm ids.

  • time: a numeric vector of time.

  • degree: the degree of the share regression.

  • fixed_names: the names of fixed inputs. To be used in the second stage.

control: the list of convergence control parameters. See gnrflex.control for available parameters.

References

Gandhi, Amit, Salvador Navarro, and David Rivers. 2020. "On the Identification of Gross Output Production Functions." Journal of Political Economy, 128(8): 2973-3016. doi:10.1086/707736.

Davidson, Russell, James G. MacKinnon. 1993. "The Gauss-Newton Regression." In Estimation and Inference in Econometrics, 176-207. New York: Oxford University Press.

Examples

require(gnrprod)
data <- colombian
industry_311_flex <- gnrflex(output = "RGO", fixed = c("L", "K"),
                             flex = "RI", share = "share", id = "id",
                             time = "year", data = data,
                             control = list(degree = 2, maxit = 200))

Control parameters in gnrflex

Description

Allows the user to modify convergence parameters of Gauss Newton algorithm used in the gnrflex function.

Usage

gnrflex.control(degree = 3, maxit = 100, reltol = 1e-5,
                       initial_step = 100, min_factor = 1e-5)

Arguments

degree

degree of share regression polynomial. Defaults to 3.

maxit

maximum number of iterations. Defaults to 100.

reltol

relative convergence tolerance. Defaults to 1e-5.

initial_step

a scaling parameter specifying the initial step-size factor used in each iteration of the Gauss-Newton algorithm. initial_step is halved in each convergence step.

min_factor

the minimum value that the step-size factor can take on in the convergence step of any iteration of the Gauss-Newton algorithm.

Value

a list containing five elements: degree, maxit, reltol, initial_step, and min_factor.


Estimate fixed input elasticity and total productivity: Gandhi, Navarro, Rivers (GNR) lags as instruments; second stage

Description

The gnriv function implements the second stage of the GNR production function estimation routine, nonparametrically identifying the fixed input elasticities of the production function and total productivity. This function accepts an object of class 'gnrflex'. The parameters are optimized using the function optim.

For details, see Gandhi, Navarro, and Rivers (2020).

Usage

gnriv(object, control, ...)

Arguments

object

object of class 'gnrflex'.

control

an optional list of convergence settings. See gnriv.control for listing.

...

additional optional arguments passed to optim.

Value

a list of class 'gnriv' containing three elements:

fixed_elas: a numeric matrix of estimated elasticities of fixed inputs for each observation.

productivity: a numeric vector of estimated total productivity.

control: the list of convergence control parameters. See gnriv.control for available parameters.

References

Gandhi, Amit, Salvador Navarro, and David Rivers. 2020. "On the Identification of Gross Output Production Functions." Journal of Political Economy, 128(8): 2973-3016. doi:10.1086/707736.

Examples

require(gnrprod)
data <- colombian
## Not run: 
industry_311_flex <- gnrflex(output = "RGO", fixed = c("L", "K"),
                             flex = "RI", share = "share", id = "id",
                             time = "year", data = data,
                             control = list(degree_w = 2, maxit = 200))

industry_311_fixed <- gnriv(industry_311_flex,
                            control = list(trace = 1))
## End(Not run)

Control parameters in gnriv

Description

Allows the user to modify convergence parameters of Gauss Newton algorithm used in the gnriv function

Usage

gnriv.control(degree_w = 3, degree_tau = -1, method = "BFGS", ...)

Arguments

degree_w

degree of Markov process for persistent productivity. Defaults to 3.

degree_tau

degree of expansion for constant of integration. Defaults to the degree of first stage.

method

the method of optimization passed to optim. Defaults to "BFGS." See optim under 'Details' for listing of available methods.

...

additional optional control parameters passed to optim. See optim for available parameters.

Value

a list containing degree and method and any additional parameters in ....


Estimate production functions and productivity: Gandhi, Navarro, and Rivers (2020)

Description

The gnrprod function is the front end of the gnrprod package. It estimates production functions and productivity in two stages: gnrflex (estimate flexible input elasticity) and gnriv (estimate fixed input elasticities and productivity). If the production-related inputs are characters, a data.frame must be specified under data. Alternatively, matrices/vectors may be directly specified without specifying data. gnrprod currently supports only one flexible input.

Usage

gnrprod(output, fixed, flex, share, in_price = NULL,
               out_price = NULL, id, time, data, B = NULL,
               fs_control = NULL, ss_control = NULL, ...)

Arguments

output

name (character) of variable of log gross output in data or a numeric vector.

fixed

name (character or character vector) of variables of log fixed inputs in data or a numeric matrix.

flex

name (character) of variable of log flexible input in data or a numeric vector.

share

name (character) of variable of log intermediate input's revenue share in data or a numeric vector.

in_price

optional (required if share is not specified) name (character) of variable of common flexible input price or a numeric vector.

out_price

optional (required if share is not specified) name (character) of variable of common output price or a numeric vector.

id

name (character) of variable of firm ID in data or a numeric vector.

time

name (character) of variable of time in data or a numeric vector.

data

data.frame containing all variables with names specified by arguments above (left empty if arguments above are vector/matrix rather than strings).

B

number of bootstrap repetitions to retrieve standard errors of elasticity estimates. By default, gnrprod does not bootstrap, i.e., B = NULL. Setting B > 1 will output bootstrapped standard errors.

fs_control

an optional list of convergence settings of the first stage. See gnrflex.control for listing.

ss_control

an optional list of convergence settings of the second stage. See gnriv.control for listing.

...

additional optional arguments to be passed to optim in the second stage.

Value

a list of class 'gnr' with five elements:

estimates: a list with two elements: elas the parameter estimates and std_errors the standard errors.

data: a data.frame containing: output, fixed, flex, share, id, time, estimated elasticities for each observation, estimated productivity, and first stage residuals.

first_stage: a list containing five elements describing the share regression (first stage):

  • coefficients: a numeric vector of the coefficients of the first stage estimator scaled by a constant. See Gandhi, Navarro, and Rivers (2020, p. 1994, equation (21)).

  • SSR: sum of squared residual.

  • iterations: number of iterations performed.

  • convergence: boolean indicating whether convergence was achieved.

  • control: list of convergence control parameters (see gnrflex.control).

second_stage: a list containing four elements describing the second stage:

  • optim_method: the method for optimization. Defaults to 'BFGS'. See optim for a listing of available methods.

  • optim_info: the returned list of the optim function estimating the coefficients of the constant of integration. See Gandhi, Navarro, and Rivers (2020, p. 1994, equation (21)).

  • optim_control: the list of control parameters passed to optim.

  • degree_w: degree of Markov process for persistent productivity.

  • degree_tau: degree of expansion for constant of integration.

call: the function call.

References

Gandhi, Amit, Salvador Navarro, and David Rivers. 2020. "On the Identification of Gross Output Production Functions." Journal of Political Economy, 128(8): 2973-3016. doi:10.1086/707736.

Examples

require(gnrprod)
data <- colombian
industry_311 <- gnrprod(output = "RGO", fixed = c("L", "K"),
                        flex = "RI", share = "share", id = "id",
                        time = "year", data = data,
                        fs_control = list(degree = 2, maxit = 200),
                        ss_control = list(trace = 1))

Printing gross output function estimates

Description

Print estimates of the parameters in a gross output function and names of the output, input, and data from gnrprod.

Usage

## S3 method for class 'gnr'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

an object of class 'gnr'.

digits

the number of significant figures to use for printing.

...

currently not used.

Value

print.gnr has no return value and only prints a brief overview of elements contained in an object of class 'gnr' as described in the description.


Printing first stage estimate

Description

Print estimate of the flexible input elasticity, the sum of squared residuals, and convergence status from gnrflex.

Usage

## S3 method for class 'gnrflex'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

an object of class 'gnrflex'.

digits

the number of significant figures to use for printing.

...

currently not used.

Value

print.gnrflex has no return value and only prints a brief overview of elements contained in an object of class 'gnrflex' as described in the description.


Printing second stage estimates

Description

Print estimates of the fixed input elasticities, productivity, objective function value, and convergence status from gnriv.

Usage

## S3 method for class 'gnriv'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

an object of class 'gnriv'.

digits

the number of significant figures to use for printing.

...

currently not used.

Value

print.gnriv has no return value and only prints a brief overview of elements contained in an object of class 'gnriv' as described in the description.


Printing a summary of gross output function estimation

Description

Print a summary of the gross output function estimation routine from gnrprod: names of output and inputs, summary statistics of the estimated productivity, the function estimates and standard errors if applicable, and convergence information.

Usage

## S3 method for class 'summary.gnr'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

an object of class 'summary.gnr'.

digits

the number of significant figures to use for printing.

...

currently not used.

Value

print.gnr has no return value and only prints the elements contained in an object of class 'summary.gnr' as described in the description.


Summarizing gross output function estimates

Description

Return a summary of the estimation routine for gross output functions from gnrprod.

Usage

## S3 method for class 'gnr'
summary(object, ...)

Arguments

object

an object of class 'gnr'.

...

currently not used.

Value

a list of class 'summary.gnr' containing 14 elements:

  • output_name: the name of the output variable.

  • fixed_names: a vector of the names of fixed input variables.

  • flex_name: the name of the flexible input variable.

  • data: data returned by gnrprod.

  • data_name: the name of data.

  • fs_conv: a boolean indicating if convergence was achieved in the first stage.

  • ss_conv: the convergence code of optim used in the second stage.

  • productivity: matrix of the estimated total productivity.

  • fs_iter: the number of iterations in the first stage.

  • fs_SSR: sum of squared residuals in the first stage.

  • ss_iter: the number of iterations in the second stage.

  • ss_val: the value of the objective function in the second stage.

  • ss_iter: the number of iterations in the second stage.

  • ss_mes: the convergence message in the second stage.