Library: | gam |
See also: | intestpl gintest gintestpl pcad gamfit |
Quantlet: | intest2d | |
Description: | estimation of a bivariate joint influence function and its derivatives in a model with possible interaction. When loc.lin.smoother is chosen you get the function estimate and the first derivatives in the first and second direction, when loc.quadr.smoother is chosen you get the function and the mixed derivative estimate. |
Usage: | gest = intest2d(t,y,h,g,loc{,opt}) | |
Input: | ||
t | n x p matrix , the observed explanatory variable where the directions of interest have to be the first and second column | |
y | n x q matrix , the observed response variables | |
h | 2 x 1 or 1 x 1 matrix , chosen bandwidth for the directions of interest | |
g | p x 1 or 1 x 1 matrix , chosen bandwidth for the directions not of interest | |
loc | dummy, for loc=0 local constant (Nad. Wats.), for loc=1 local linear and for loc=2 local quadratic estimator will be used | |
opt.tg | ng x 2 vector, a grid for direction of interest. If tg is given, the nonparametric function will be computed on this grid. | |
opt.shf | integer, (show-how-far) if exists and =1, an output is produced which indicates how the iteration is going on (additive function / point of estimation / number of iteration). | |
Output: | ||
gest | n(ng) x pp x q matrix, containing the marginal integration estimates |
library("gam") randomize(12345) t = grid(#(-0.9,-0.9),#(0.2,0.2),#(10,10)) n = rows(t) t = t~(uniform(n)*2-1) g3 = sin(2*t[,3]) g12 = t[,1].*t[,2]^2 y = g3 + g12 + normal(n)*sqrt(0.5) h = #(1.0, 1.0) g = #(1.1, 1.1, 1.2) loc = 1 gest = intest2d(t,y,h,g,loc) library("graphic") pic = createdisplay(1,2) dat11 = grsurface(t[,1:2]~g12) dat12 = grsurface(t[,1:2]~gest[,1]) gc = grcube( dat11|dat12 ) show(pic,1,1,dat11,gc.box,gc.x,gc.y,gc.z,gc.c) show(pic,1,2,dat12,gc.box,gc.x,gc.y,gc.z,gc.c) setheadline(pic, 1, 1, "Original function") setheadline(pic, 1, 2, "Estimated function")
the marginal integration estimates of the joint influences, using local polynomials, see Sperlich, Tjostheim and Yang (1997)
Library: | gam |
See also: | intestpl gintest gintestpl pcad gamfit |