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: cafpe
See also: tp/cafpe/cafpedefault tp/cafpe/cafpe tp/cafpe/cafpeload

Quantlet: plotloclin
Description: Quantlet to compute for a given lag vector on given grid range a 1- or 2-dimensional plot of the regression function of a nonlinear autoregressive process; if more than 2 lags are used, then only two lags are allowed to vary, the others have to be fixed at values that are given by the user; the procedure uses a plug-in bandwidth; for this bandwidth the vector of residuals and the matrix of regressors are returned on which the bandwidth estimation was conducted (for the default values of the advanced parameters see the quantlet cafpedefault); plots also standardized residuals

Reference(s):

Usage: {hplugin,hB,hC,xs,resid} = plotloclin(xdata,xresid,xdataln,xdatadif,xdatastand,volat,lags,h,xsconst,gridnum,gridmax,gridmin)
Input:
ATTENTION: this quantlet requires to open locling.dll, density.dll (NT) or locling.so, denc.so (UNIX). This can be done with the quantlet cafpeload or directly with garb = dlopen ("\locling.dll") on NT, garb = dlopen ("\density.dll") on NT, garb = dlopen ("/locling.so") on UNIX, garb = dlopen ("/denc.so") on UNIX.
xdata n x 1 matrix of the observed time series
xresid n' x 1 vector of residuals from fitting conditional mean function
xdataln character variable: "yes": take natural logs, "no": don't
xdatadif character variable: "yes": take first differences of data, "no": don't
xdatastand character variable: "yes": standardize data, "no": don't
volat character variable: "no" plots conditional mean function; "resid" plots conditional volatility function, the residuals of fitting a conditional mean function have to be contained in xresid
lags m x 1 vector of lags
h scalar bandwidth for which if set to zero a scalar plug-in bandwidth using hoptest is computed or a (d x 1) vector bandwidth
xsconst m x 1 vector (only needed if m>2) indicates which lags vary and which are kept fixed for those keeping fixed, the entry in the correponding row contains the value at which it is fixed for those to be varied, the entry in the corresponding row is 1e-100
gridnum scalar, number of grid points in one direction
gridmax scalar, maximum for grid
gridmin scalar, minimum for grid
Output:
hplugin scalar, plug-in bandwidth or chosen scalar or vector bandwidth
hB scalar, rule-of-thumb bandwidth for nonparametrically estimating the constant B in CAFPE and for computing the plug-in bandwidth
hC scalar, rule-of-thumb bandwidth for nonparametrically estimating the constant C for computing the plug-in bandwidth
xs m x n' matrix with lagged values of time series which are used to compute plug-in bandwidth and residuals for potential diagnostics
resid vector with residuals after fitting a local linear regression at xs

Example:
pathcafpe 	= "tp/cafpe/" ; path for CAFPE quantlets
library("xplore")
library("times")
func(pathcafpe + "cafpeload"); load required XploRe files of CAFPE
cafpeload(pathcafpe)    	
n              = 50
truedat    = "";
xresid     = 0
xdataln    = "no";
xdatadif   = "no";
xdatastand = "no";
lags       = 1|2
h          = 0
xsconst    = 1e-100|1e-100
gridnum    = 10
gridmax    = 3
gridmin    = -5
volat      = "no"
; generate data
randomize(0)     ; sets seed value for random number generator
y=genexpar(1,0.1,0.3|0.6, 2.2|-0.8,normal(n))  ; generate exponential AR(2) process
; plot generated data
title = "Realisation of exponential AR(2) process"
xlabel= "Time"
ylabel= "Values"
plotoneline(1:n~y,title,xlabel,ylabel)
; compute plug-in bandwidth and plot regression function for given lags
{ hplugin,hB,hC,xs,resid } = plotloclin(y,xresid,xdataln,xdatadif,xdatastand,volat,lags,h,xsconst,gridnum,gridmax,gridmin)
"plug-in bandwidth" hplugin
Result:
surface plot of regression function on a grid
determined by the data as well as used bandwidths

Library: cafpe
See also: tp/cafpe/cafpedefault tp/cafpe/cafpe tp/cafpe/cafpeload

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

Author: Tschernig 000420
(C) MD*TECH Method and Data Technologies, 27.4.2000