kernesti.regr: Multivariate kernel regression estimator at one point

Description Usage Arguments Value Author(s) See Also Examples

Description

Computes the value of a multivariate kernel regression estimator (Nadaraya-Watson estimator) at one point.

Usage

1
kernesti.regr(arg, x, y, h=1, kernel="gauss", g=NULL, gernel="gauss", vect=FALSE)

Arguments

arg

d-vector; the point where the estimate is evaluated

x

n*d data matrix; the matrix of the values of the explanatory variables

y

n vector; the values of the response variable

h

a positive real number; the smoothing parameter of the kernel estimate

kernel

a character; determines the kernel function; either "gauss" or "uniform"; in the univariate case can also be "exp"

g

a positive real number; the smoothing parameter of the kernel estimate for a simultaneous time space smoothing

gernel

a character; determines the kernel function for the time space smoothing; either "gauss", "uniform", "exp", or "bart"

vect

TRUE or FALSE; an internal parameter related to the method of calculation

Value

a real number

Author(s)

Jussi Klemela

See Also

pcf.kernesti,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(1)
n<-100
d<-2 
x<-8*matrix(runif(n*d),n,d)-3
C<-(2*pi)^(-d/2)
phi<-function(x){ return( C*exp(-sum(x^2)/2) ) }
D<-3; c1<-c(0,0); c2<-D*c(1,0); c3<-D*c(1/2,sqrt(3)/2)
func<-function(x){phi(x-c1)+phi(x-c2)+phi(x-c3)}
y<-matrix(0,n,1)
for (i in 1:n) y[i]<-func(x[i,])+0.01*rnorm(1)

arg<-c(0,0)
kernesti.regr(arg,x,y,h=0.5)

Example output

Loading required package: denpro
[1] 0.1408687

regpro documentation built on May 1, 2019, 10:21 p.m.

Related to kernesti.regr in regpro...