Library: | gam |
See also: | intestpl gintest gintestpl pcad gamfit |
Macro: | intest | |
Description: | estimation of the univariate additive functions in a separable additive model using Nad.Watson, local linear or local quadratic |
Usage: | gest = intest(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 p columns | |
y | n x q matrix , the observed response variables | |
h | p(pg) 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 pg vector, a grid for continuous part. 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 of the additive components in the first p columns, the derivatives in the followings, so pp = pg*(loc+1) |
library("gam") randomize(1234) t = uniform(50,2)*2-1 g1 = 2*t[,1] g2 = t[,2]^2 g2 = g2 - mean(g2) y = g1 + g2 + normal(50,1) * sqrt(0.25) h = #(1.2, 1.0) g = #(1.4, 1.2) loc = 1 gest = intest(t,y,h,g,loc) gest bild = createdisplay(1,2) dat11 = t[,1]~g1 dat12 = t[,1]~gest[,1] dat21 = t[,2]~g2 dat22 = t[,2]~gest[,2] setmaskp(dat12,4,4,8) setmaskp(dat22,4,4,8) show(bild,1,1,dat11,dat12) show(bild,1,2,dat21,dat22)
the marginal integration estimates of the additive functions and its derivatives, using local polynomials, see Severance-Lossin & Sperlich (1995)
Library: | gam |
See also: | intestpl gintest gintestpl pcad gamfit |