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: smoother
See also: regxest regxci regest regci regcb

Quantlet: regxcb
Description: computes uniform confidence bands with a pre-specified confidence level for univariate regression using the Nadaraya-Watson estimator.

Reference(s):

Usage: {mh, clo, cup} = regxcb(x {,h {,alpha {,K} {,v}}})
Input:
x n x 2, the data. In the first column the independent and in the second column the dependent variable are contained.
h optional scalar, bandwidth. If not given, 20% of the range of x[,1] is used as default.
alpha optional scalar representing the confidence level; default alpha = 0.05.
K optional string, kernel function on [-1,1] with K(-1) = K(1) = 0; default K = "qua".
v optional m x 1 vector, values of the independent variable in which to compute the regression and the confidence bands. If not given, the (sorted) x is used.
Output:
mh n x 2 or m x 2 matrix; the first column represents the sorted first column of x or the sorted v and the second column contains the regression estimate on the values of the first column.
clo n x 2 or m x 2 matrix; the first column represents the sorted first column of x or the sorted v and the second column contains the lower confidence bounds on the values of the first column.
cup n x 2 or m x 2 matrix, the first column contains the sorted first column of x or the sorted v and the second one the upper confidence bounds on the values of the first column.

Note:

Example:
library("smoother")
library("plot")
x = read("motcyc")
{mh, clo, cup} = regxcb(x,3)
;
x =setmask( x,"cross")
mh=setmask(mh,"line","blue")
clo=setmask(clo,"line","blue","thin","dashed")
cup=setmask(cup,"line","blue","thin","dashed")
plot(x,mh,clo,cup)

Result:
Uniform confidence bands at confidence level
alpha = 0.05 are pictured using the bandwidth h = 0.3



Author: M. Mueller, 20020915
(C) MD*TECH Method and Data Technologies, 05.02.2006