7.7 Odds and Ends


7.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 15683 gintestpl and 15686 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 15689 gamfit makes use of the auxiliary quantlet 15692 gamout .


7.7.2 Estimation on Principal Component by PCAD


{jhat, g, mhat} = 15753 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
15757 XAGgam14.xpl

The quantlet 15762 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.