Skip to contents

Semiparametric Klein & Vella estimation

Usage

klein_vella_semiparametric(
  data,
  y1_var = "Y1",
  y2_var = "Y2",
  x_vars = NULL,
  bandwidth_method = "cv.aic",
  kernel_type = "gaussian",
  max_iter = .hetid_const("MAX_ITERATIONS_KLEIN_VELLA"),
  tol = .hetid_const("EPSILON_TOLERANCE"),
  verbose = TRUE
)

Arguments

data

Data frame containing Y1, Y2, and X variables

y1_var

Name of first endogenous variable (default: "Y1")

y2_var

Name of second endogenous variable (default: "Y2")

x_vars

Names of exogenous variables (default: auto-detect)

bandwidth_method

Method for bandwidth selection ("cv.aic", "cv.ls", "rule.of.thumb")

kernel_type

Kernel type for nonparametric regression

max_iter

Maximum iterations for the nested optimization

tol

Convergence tolerance

verbose

Whether to print progress information

Value

List containing estimation results

Details

Implements the semiparametric version of Klein & Vella (2010) using nonparametric estimation of the conditional variance functions.

Requires the 'np' package for nonparametric regression.

Examples

if (FALSE) { # \dontrun{
# Requires np package
if (requireNamespace("np", quietly = TRUE)) {
  config <- create_klein_vella_config(
    n = .hetid_const("N_SMALL"),
    beta1 = c(0.5, 1.5),
    beta2 = c(1.0, -1.0),
    gamma1 = -0.8,
    rho = 0.6,
    delta1 = c(0.1, 0.3),
    delta2 = c(0.2, -0.2)
  )
  data <- generate_klein_vella_data(config)
  results <- klein_vella_semiparametric(data)
  print(results)
}
} # }