LLef                 package:JLLprod                 R Documentation

_H_o_m_o_t_h_e_t_i_c _P_r_o_d_u_c_t_i_o_n _F_u_n_c_t_i_o_n: _M_o_s_t _E_f_f_i_c_i_e_n_t _E_s_t_i_m_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     This function implements the most efficient version of Lewbel &
     Linton's (2005) estimator. In general it estimates the model
     Y=r(x,z)+e, imposing the following structure
     r(x,z)=E[Y|X=x,Z=z]=h[g(x,z)], and g(bx,bz)=b*g(x,z). The unknown
     function g is assumed to be smooth and h is assumed to be a
     strictly monotonic smooth function.

_U_s_a_g_e:

     LLef(xx, zz, yy, LLob, h0 = NULL, kernel0=NULL , kernel = NULL)

_A_r_g_u_m_e_n_t_s:

      xx: Numerical: Nx1 vector.

      zz: Numerical: Nx1 vector.

      yy: Numerical: Nx1 vector.

    LLob: LL object

      h0: Numerical: Bandwidth for smoothing. Default is the
          Silverman's rule of thumb. 

 kernel0: Kernel function for smoothing. Default is `gauss'.

  kernel: Kernel function for all steps. Default is `gauss'.

_D_e_t_a_i_l_s:

     User may choose a variety of kernel functions. For example
     `uniform', `triangular', `quartic', `epanech', `triweight' or
     `gauss', see Yatchew (2003), pp 33. Another choice may be
     `order34', `order56' or `order78', which are third, fifth and
     seventh (gauss based) order kernel functions, see Pagan and Ullah
     (1999), pp 55.

_V_a_l_u_e:

     gef: N x 1 vector: Efficient Nonparametric component g (see above)
          evaluated at data points, i.e. g(xxi,zzi).

     hef: N x 1 vector: Efficient Nonparametric component h (see above)
          evaluated at data points, i.e. h[g(xxi,zzi)].

    hdef: N x 1 vector: Efficient Nonparametric first derivative of h
          (see above) evaluated at data points, i.e. h'[g(xxi,zzi)].

_A_u_t_h_o_r(_s):

     David Toms Jacho-Chvez

_R_e_f_e_r_e_n_c_e_s:

     Lewbel, A., and Linton, O.B. (2005) Nonparametric Matching and
     Efficient Estimation of Homothetically Separable Functions.
     Unpublished manuscript.

     Yatchew, A. (2003) Semiparametric Regression for the Applied
     Econometrician. Cambridge University Press.

     Pagan, A. and Ullah, A. (1999) Nonparametric Econometrics.
     Cambridge Universtiy Press.

_S_e_e _A_l_s_o:

     'JLL', 'LL' , 'locpoly', 'Blocc'

_E_x_a_m_p_l_e_s:

     data(ecu)
     ##This part simply does some data sorting & trimming
     xlnK <- ecu$lnk
     xlnL <- ecu$lnl
     xlnY <- ecu$lny
     xqKL <- quantile(exp(xlnK)/exp(xlnL),  probs=c(2.5,97.5)/100)
     yx <- cbind(xlnY,xlnK,xlnL)
     tlnklnl <- yx[((exp(yx[,2])/exp(yx[,3]))>=xqKL[1]) 
                   & ((exp(yx[,2])/exp(yx[,3]))<=xqKL[2]),]
     Y<-tlnklnl[,1]
     K<-exp(tlnklnl[,2])/median(exp(tlnklnl[,2]))
     L<-exp(tlnklnl[,3])/median(exp(tlnklnl[,3]))

     LLb<-LL(xx=K,zz=L,yy=Y,xxo=median(K),zzo=median(L),k=80,j=100)
     LLbef <- LLef(xx=K,zz=L,yy=Y,h0=1,LLob=LLb)

     #win.graph()
     nf <- layout(matrix(c(1,2,1,2),2,2, byrow=TRUE),respect=TRUE)
     plot(log(K)-log(L),log(LLbef$gef)-log(L),pch=3,xlab="ln(K/L)"
          ,ylab="ln(g(K/L,1))",main="Homogeneous Component g")
     plot(log(LLbef$gef),LLbef$hef,xlab="ln(g)",pch=3,ylab="h(g)"
          ,main="Nonhomogeneous Component h",ylim=c(min(min(LLbef$hef)
          ,min(LLb$r)),max(max(LLbef$hef),max(LLb$r))))
     points(log(LLbef$gef),LLb$r,type="p",pch=1,col="blue",lwd=2)
     legend(-0.5,15.6,c("Nonparametric","Kernel Regression")
            ,merge=TRUE,lty=c(1,-1),pch=c(3,1),lwd=c(1,2)
            ,col=c("black","blue"),cex=0.95)

