7. Odds and Ends


7.1 Special Properties of GAM Quantlib Quantlets

This part of the chapter describes some features which may be interesting for special problems. The gam quantlib automatically loads the quantlibs xplore, glm and gplm, if not yet active. The quantlets 2224 gintestpl and 2227 intestpl perform the estimation on an internal grid if the number of observations exceeds 50 and 40, respectively. They interpolate the estimated additive functions for the explanatory variable t, or, if given, for the grid tg. For graphical output 2230 gamfit makes use of the auxiliary quantlet 2233 gamout.


7.2 Estimation on Principal Component by PCAD


{jhat, g, mhat} = 2242 pcad(x, xg, y, h, bn)
estimates the additive components, the significant directions and the regression on principal components

  library("gam")
  n = 100
  v =uniform(n,4)
  x =v[,2:4]
  y =x[,1]^2+0.1*x[,2]+normal(n)
  h =0.5
  bn=0.02
  gest=pcad(x,x,y,h,bn)
  gest.jhat
  gest.g
  gest.mhat
2246 gam14.xpl

The quantlet 2251 pcad estimates the additive components, the significant directions and the regression function on principal components. It accepts only one-dimensional y. The standard call is:


Input parameters:

x
$ n\times p$ design matrix
xg
$ ng \times p$ matrix, the grid on which we will estimate
y
$ n\times 1$ vector, the response variable
h
$ p\times 1$ bandwidth vector
bn
scalar, threshold for choosing significant directions
The quantlet returns
jhat
A $ q\times 1$ vector, the set of significant directions.
g
A $ ng\times q$ matrix, the function estimates of the significant directions.
mhat
A $ ng\times 1$ vector, the estimate of the regression using the significant directions.


Method and Data Technologies   MD*TECH Method and Data Technologies
  http://www.mdtech.de  mdtech@mdtech.de