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
gintestpl
and
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
gamfit
makes use of the auxiliary quantlet
gamout.
7.2 Estimation on Principal Component by PCAD
- {jhat, g, mhat} =
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
The quantlet
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
design matrix
- xg
-
matrix, the grid on which we will
estimate
- y
vector, the response variable
- h
bandwidth vector
- bn
- scalar, threshold for choosing significant directions
The quantlet returns
- jhat
- A
vector, the set of significant
directions.
- g
- A
matrix, the function estimates of the
significant directions.
- mhat
- A
vector, the estimate of the regression
using the significant directions.