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 |
Print or return a numeric matrix of the estimated parameters from an object of class 'gnr'.
## S3 method for class 'gnr' coef(object, ...)
## S3 method for class 'gnr' coef(object, ...)
object |
an object of class 'gnr'. |
... |
currently not used. |
the named vector of parameter estimates contained in an object of class 'gnr'.
Plant-level production data for the food products industry (International Standard Industrial Classification code 311) in Colombia.
colombian
colombian
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.
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.
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).
gnrflex(output, fixed, flex, share, id, time, data, control)
gnrflex(output, fixed, flex, share, id, time, data, control)
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 |
|
control |
an optional list of convergence settings. See |
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.
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.
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))
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))
gnrflex
Allows the user to modify convergence parameters of Gauss Newton algorithm used in the gnrflex
function.
gnrflex.control(degree = 3, maxit = 100, reltol = 1e-5, initial_step = 100, min_factor = 1e-5)
gnrflex.control(degree = 3, maxit = 100, reltol = 1e-5, initial_step = 100, min_factor = 1e-5)
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. |
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. |
a list containing five elements: degree
, maxit
, reltol
, initial_step
, and min_factor
.
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).
gnriv(object, control, ...)
gnriv(object, control, ...)
object |
object of class 'gnrflex'. |
control |
an optional list of convergence settings. See |
... |
additional optional arguments passed to optim. |
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.
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.
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)
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)
gnriv
Allows the user to modify convergence parameters of Gauss Newton algorithm used in the gnriv
function
gnriv.control(degree_w = 3, degree_tau = -1, method = "BFGS", ...)
gnriv.control(degree_w = 3, degree_tau = -1, method = "BFGS", ...)
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 |
... |
additional optional control parameters passed to |
a list containing degree
and method
and any additional parameters in ...
.
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.
gnrprod(output, fixed, flex, share, in_price = NULL, out_price = NULL, id, time, data, B = NULL, fs_control = NULL, ss_control = NULL, ...)
gnrprod(output, fixed, flex, share, in_price = NULL, out_price = NULL, id, time, data, B = NULL, fs_control = NULL, ss_control = NULL, ...)
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 |
out_price |
optional (required if |
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 |
|
B |
number of bootstrap repetitions to retrieve standard errors of elasticity estimates. By default, |
fs_control |
an optional list of convergence settings of the first stage. See |
ss_control |
an optional list of convergence settings of the second stage. See |
... |
additional optional arguments to be passed to |
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.
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.
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))
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))
Print estimates of the parameters in a gross output function and names of the output, input, and data from gnrprod
.
## S3 method for class 'gnr' print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'gnr' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
an object of class 'gnr'. |
digits |
the number of significant figures to use for printing. |
... |
currently not used. |
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.
Print estimate of the flexible input elasticity, the sum of squared residuals, and convergence status from gnrflex
.
## S3 method for class 'gnrflex' print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'gnrflex' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
an object of class 'gnrflex'. |
digits |
the number of significant figures to use for printing. |
... |
currently not used. |
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.
Print estimates of the fixed input elasticities, productivity, objective function value, and convergence status from gnriv
.
## S3 method for class 'gnriv' print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'gnriv' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
an object of class 'gnriv'. |
digits |
the number of significant figures to use for printing. |
... |
currently not used. |
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.
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.
## S3 method for class 'summary.gnr' print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'summary.gnr' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
an object of class 'summary.gnr'. |
digits |
the number of significant figures to use for printing. |
... |
currently not used. |
print.gnr
has no return value and only prints the elements contained in an object of class 'summary.gnr' as described in the description.
Return a summary of the estimation routine for gross output functions from gnrprod
.
## S3 method for class 'gnr' summary(object, ...)
## S3 method for class 'gnr' summary(object, ...)
object |
an object of class 'gnr'. |
... |
currently not used. |
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.