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 prespecified confidence level for univariate regression using the Nadaraya-Watson estimator.

Reference(s):

Usage: {mh, clo, cup} = regxcb(x {,h {,alpha {,K} {,d}}})
Input:
x n x 2, the data. In the first column the independent, in the second column the dependent variable.
h scalar, bandwidth. If not given, 20% of the range of x[,1] is used.
alpha confidence level, If not given, 0.05 is used.
K string, kernel function on [-1,1] with K(-1)=K(1)=0. If not given, the Quartic kernel "qua" is used.
xv m x 1, values of the independent variable on which to compute the regression. If not given, x is used.
Output:
mh n x 2 or m x 2 matrix, the first column is the sorted first column of x or the sorted xv, 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 is the sorted first column of x or the sorted xv, 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 is the sorted first column of x or the sorted xv, the second column contains 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


Library: smoother
See also: regxest regxci regest regci regcb

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: Marlene Mueller 990413
(C) MD*TECH Method and Data Technologies, 21.9.2000