imnlmreg.fit: Nonlinear ICM-IV Regression

View source: R/dCovReg.R

imnlmreg.fitR Documentation

Nonlinear ICM-IV Regression

Description

imnlmreg.fit runs a generic possibly non-linear integrated moment regression allowing for different kernels. This variant uses centred instruments in the meat of the sandwich matrix

Usage

imnlmreg.fit(
  strtpar,
  u.fun,
  Xg.fun,
  Y,
  X,
  Z,
  Intercept = F,
  weights = NULL,
  Kern = "Euclid",
  cluster = NULL,
  clus.est.type = "A"
)

Arguments

strtpar

vector of starting values; use list() to specify lower and upper bounds for line search if the parameter is a scalar

u.fun

function generating the parameterised error

Xg.fun

function generating the derivative of u.fun()

Y

outcome variable

X

matrix of covariates.

Z

matrix of instruments

Intercept

logical for include intercept u.fun() is non-linear in the intercept

weights

a vector of length n of weights for observations

Kern

type of kernel. See Details for available kernels

cluster

vector of length n with cluster assignments of observations.

clus.est.type

options are "A" and "B". "A" sets K(Z_i,Z_j)=0 for i,j in the same cluster while option "B" only does so for i=j.

Details

The (i,j)'th elements of available kernel methods are

"Euclid"

Euclidean distance between two vectors: ||Z_i-Z_j||

"Gauss.W"

The weighted Gaussian kernel: exp(-0.5(Z_i-Z_j)'V^-1(Z_i-Z_j)) where V is the variance of V

"Gauss"

The unweighted Gaussian kernel: exp(-||Z_i-Z_j||^2)

"DL"

The kernel of Dominguez & Lobato 2004: 1/n\sum{l=1}^n I(Z_i\le Z_l)I(Z_j\le Z_l)

"Esc6"

The projected version of the DL in Escanciano 2006.

"WMD"

The kernel used in Antoine & Lavergne 2014. See page 60 of paper.

"WMDF"

The Fuller (1977)-like modification of the kernel in Antoine & Lavergne 2014. See page 64 of paper.

Value

an IV regression object which also contains coefficients, standard errors, etc.

Examples

## Generate data and run regression
n=200; set.seed(12); X = rnorm(n,1,1); er = rchisq(n,df=1)/sqrt(2); Z=X
Y1 = X*(5/4)^2 + (5/4)*(X^2) + er
u.fun = function(theta,Y,X) Y - X*(theta^2) - (X^2)*theta
Xg.fun = function(theta,X) -2*X*theta - X^2
imnlmreg.fit(list(a=-3.0,b=3.0),u.fun,Xg.fun,Y1,X,Z)

Y2 = exp(X*(5/4) + 1) + er
u.fun2<- function(par0,Y,X){Y - exp(X%*%par0)}
Xg.fun2<- function(par0,X){X*c(exp(X%*%par0))}
imnlmreg.fit(c(1,1),u.fun2,Xg.fun2,Y2,X,Z,Intercept=T)

estsyawo/bayesprdopt documentation built on Feb. 10, 2025, 1:50 p.m.