imnlmreg.fit | R Documentation |
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
imnlmreg.fit(
strtpar,
u.fun,
Xg.fun,
Y,
X,
Z,
Intercept = F,
weights = NULL,
Kern = "Euclid",
cluster = NULL,
clus.est.type = "A"
)
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 |
Kern |
type of kernel. See Details for available kernels |
cluster |
vector of length |
clus.est.type |
options are "A" and "B". "A" sets |
The (i,j)
'th elements of available kernel methods are
Euclidean distance between two vectors: ||Z_i-Z_j||
The weighted Gaussian kernel: exp(-0.5(Z_i-Z_j)'V^-1(Z_i-Z_j)) where V is the variance of V
The unweighted Gaussian kernel: exp(-||Z_i-Z_j||^2)
The kernel of Dominguez & Lobato 2004: 1/n\sum{l=1}^n I(Z_i\le Z_l)I(Z_j\le Z_l)
The projected version of the DL in Escanciano 2006.
The kernel used in Antoine & Lavergne 2014. See page 60 of paper.
The Fuller (1977)-like modification of the kernel in Antoine & Lavergne 2014. See page 64 of paper.
an IV regression object which also contains coefficients, standard errors, etc.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.