Escolar Documentos
Profissional Documentos
Cultura Documentos
GMM in finance
GMM with R
GEL in finance
Whats next?
Pierre Chauss1
1
Special thanks to Rmetrics Association and its partners for financial
support.
Pierre Chauss GMM and GEL with R
Outline
GMM in finance
GMM with R
GEL in finance
Whats next?
1 GMM in finance
The generalized method of moments
Consumption-CAPM
Linear factor pricing models
Nonlinear factor models
Continuous time processes
2 GMM with R
The function gmm()
Linear models
Nonlinear models
3 GEL in finance
The generalized empirical likelihood
GEL with R
4 Whats next?
Pierre Chauss GMM and GEL with R
Outline The generalized method of moments
GMM in finance Consumption-CAPM
GMM with R Linear factor pricing models
GEL in finance Nonlinear factor models
Whats next? Continuous time processes
GMM
GMM
GMM
where
T
1X
g() = g(, xt )
T
t=1
The asymptotic efficiency is achieved if the matrix W is the
inverse
of a consistent estimate of the covariance matrix of
T g() defined as:
X
() = Cov[g(, xt ), g(, xt+s )]
s=
where
T
1X
g() = g(, xt )
T
t=1
The asymptotic efficiency is achieved if the matrix W is the
inverse
of a consistent estimate of the covariance matrix of
T g() defined as:
X
() = Cov[g(, xt ), g(, xt+s )]
s=
GMM: Properties
Given some regularity conditions, the GMM estimator
converges as T goes to infinity to the following distribution:
L
T ( 0 ) N(0, V ),
where
g(0 , xt ) g(0 , xt )
V =E (0 )1 E
Finally, we can test the (q p) overidentifying restrictions using
the result that, under the null H0 : E [g(, xt )] = 0:
L
T g() [( )]1 g() 2qp
GMM: Properties
Given some regularity conditions, the GMM estimator
converges as T goes to infinity to the following distribution:
L
T ( 0 ) N(0, V ),
where
g(0 , xt ) g(0 , xt )
V =E (0 )1 E
Finally, we can test the (q p) overidentifying restrictions using
the result that, under the null H0 : E [g(, xt )] = 0:
L
T g() [( )]1 g() 2qp
C-CAPM
C-CAPM
C-CAPM
If the utility is given by the popular constant relative risk
aversion function
1
z /(1 ) if 6= 1
U(z) = ,
log z if = 1
where zt It .
Pierre Chauss GMM and GEL with R
Outline The generalized method of moments
GMM in finance Consumption-CAPM
GMM with R Linear factor pricing models
GEL in finance Nonlinear factor models
Whats next? Continuous time processes
CAPM
CAPM
CAPM
CAPM
CAPM-Black
Rit = + i (Rm,t ) + it
gmm()
gmm(g,x,t0=NULL,gradv=NULL,
type=c("twoStep","cue","iterative")
Other important options:
wmatrix = c("optimal","ident")
vcov=c("HAC","iid")
kernel=c("Quadratic Spectral","Truncated", "Bartlett",
"Parzen", "Tukey-Hanning")
bw = bwAndrews2 or bwNeweyWest2
gmm()
gmm(g,x,t0=NULL,gradv=NULL,
type=c("twoStep","cue","iterative")
Other important options:
wmatrix = c("optimal","ident")
vcov=c("HAC","iid")
kernel=c("Quadratic Spectral","Truncated", "Bartlett",
"Parzen", "Tukey-Hanning")
bw = bwAndrews2 or bwNeweyWest2
gmm()
gmm(g,x,t0=NULL,gradv=NULL,
type=c("twoStep","cue","iterative")
Other important options:
wmatrix = c("optimal","ident")
vcov=c("HAC","iid")
kernel=c("Quadratic Spectral","Truncated", "Bartlett",
"Parzen", "Tukey-Hanning")
bw = bwAndrews2 or bwNeweyWest2
gmm()
gmm(g,x,t0=NULL,gradv=NULL,
type=c("twoStep","cue","iterative")
Other important options:
wmatrix = c("optimal","ident")
vcov=c("HAC","iid")
kernel=c("Quadratic Spectral","Truncated", "Bartlett",
"Parzen", "Tukey-Hanning")
bw = bwAndrews2 or bwNeweyWest2
gmm()
gmm(g,x,t0=NULL,gradv=NULL,
type=c("twoStep","cue","iterative")
Other important options:
wmatrix = c("optimal","ident")
vcov=c("HAC","iid")
kernel=c("Quadratic Spectral","Truncated", "Bartlett",
"Parzen", "Tukey-Hanning")
bw = bwAndrews2 or bwNeweyWest2
> require(gmm)
> data(Finance)
> r <- Finance$r[1:300, ]
> rm <- Finance$rm[1:300]
> rf <- Finance$rf[1:300]
> z <- r - rf
> t <- nrow(z)
> zm <- matrix(rm - rf, t, 1)
> res <- gmm(z ~ zm, x = zm)
H0 : R = c
[[1]]
[1] "Wald test for H0: R(Theta)=c"
$H0
Null Hypothesis
[1,] WMK_(Intercept) = 0
[2,] UIS_(Intercept) = 0
[3,] ORB_(Intercept) = 0
[4,] MAT_(Intercept) = 0
[5,] ABAX_(Intercept) = 0
[6,] T_(Intercept) = 0
[7,] EMR_(Intercept) = 0
[8,] JCS_(Intercept) = 0
[9,] VOXX_(Intercept) = 0
[10,] ZOOM_(Intercept) = 0
$result
Statistics P-Value
Wald test 4.118292 0.9418528
J-test Pz(>j)
Test E(g)=0: 2.818007 0.9853883
The Black-CAPM
t = rt (rmt )
The Black-CAPM
> summary(res)$par
> summary(res)$j
J-test Pz(>j)
Test E(g)=0: 5.801583 0.7596007
J-test Pz(>j)
Test E(g)=0: 3.824509 0.8725995
where
t+1 = rt+1 rt rt
GEL
First of all, we need to smooth the moment function in order to
take into account the autocorrelation and conditional
heteroskedasticity. g(, xt ) is replaced by:
m
X
g w (, xt ) = w (s)g(, xts )
s=m
where w (s) are kernel based weights that sum to one. The
sample moment conditions become:
T
X
g() = pt g w (, xt ) = 0
t=1
GEL
The GEL estimator is defined as:
T
X
n = arg min hT (pt ),
,pt
t=1
subject to
XT
pt g w (, xt ) = 0 and
t=1
T
X
pt = 1,
t=1
GEL
GEL
gel(g,x,tet0,gradv=NULL,smooth=FALSE,
type=c("EL","ET","CUE","ETEL"))
Other options:
kernel = c("Bartlett", "Parzen", "Truncated",
"Tukey-Hanning")
bw=bwAndrews2
tol_obj
maxiterlam
constraint=TRUE
optlam=c("iter","numeric")
CAPM
statistics p-value
LR test 12.09362 0.2788400
LM test 11.53989 0.3170287
J test 12.19297 0.2723491
Some ideas