Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: finance
See also: archest annarchtest bigarch jump lochomtest volatility

Quantlet: lochomest
Description: calls the quantlet "lochomtest" and performs the estimation of the volatility for the whole time series at regular grid points.

Reference(s):

Link:
Usage: {x,t} = lochomest(powtr,lambda,mu,m0)
Input:
powtr T x 1 vector, powtr = abs(S)^(0.5) where S is a time series of financial returns
lambda scalar, smoothing parameter, 0.5 <= lambda <= 4
mu scalar, smoothing parameter, 0.5 <= mu <= 4
m0 integer scalar, the grid step, m0 >= 5
Output:
x T x 1 vector, estimated volatilities
t T x 1 vector, includes the estimated interval lengths of homogeneity at each grid point

Example:
library("finance")
func("setmask")
func("discrete")
func("select1item")
x1 = read("dmus58")
x2 = read("jpydem")
x = x1[1:rows(x2)]~x2[,8]
items = "DM/$"|"YEN/DM"
headline = "choose the data set:"
it = select1item(headline, items)
x = x[,it]
title = "DM/$ returns"|"YEN/DM returns"
title = title[it]
x = x[2:rows(x)] - x[1:rows(x) -1]
x = paf(x, x != 0)
powtr = sqrt(abs(x))
names = "sample size = "|"lambda = "|"mu = "|"m0 = "
defaults = rows(x)|1|3|100
v = readvalue(names, defaults)
lambda = v[2]
mu = v[3]
m0 = v[4]
x = x[1:v[1]]
{xest, hom} = lochomest(powtr, lambda, mu, m0)
setsize(500, 750)
d = createdisplay(3, 1)
setsize(500, 500)
t = 1:rows(hom)
hom = t~hom
xest = t~xest
vol = t~(abs(x))
x = t~x
x = setmask(x, "line", "color", 1)
hom = paf(hom, hom[,2] != 1)
xest = paf(xest, xest[,2] != 1)
hom = setmask(hom, "line", "thin")
xest = setmask(xest, "line", "thin")
show(d, 1, 1, x)
show(d, 2, 1, xest)
show(d, 3, 1, hom)
setgopt(d, 1, 1, "title", title)
setgopt(d, 2, 1, "title", "Volatility")
setgopt(d, 3, 1, "title", "Interval of homogeneity")
setgopt(d, 1, 1, "xoffset", 5|5, "yoffset", 20|20)
setgopt(d, 2, 1, "xoffset", 5|5, "yoffset", 20|20)
setgopt(d, 3, 1, "xoffset", 5|5, "yoffset", 20|20)

Result:
creates a display which shows
  a) the time series under investigation
  b) the time series of estimated volatilities
  c) the intervals of homogeneity



Author: D. Mercurio, W. Haerdle, 20001103 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006