RegKer: Function to do kernel regression

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

Performs kernel regression using the Naraya-Watson estimator with the specified kernel and bandwidth

Usage

1
RegKer(x,X,Y,ker,h)

Arguments

x

the point (or points) where we want to estimate Y value

X

sample of X

Y

sample of Y

Ker

kernel function to use

h

bandwith

Value

vector containing the predictions for x

Author(s)

Pablo Ramsés Alonso Martín

Examples

1
2
3
4
5
6
7
8
9
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as

{x1<-rnorm(10,0,1); y1<-exp(x1) + rnorm(100,0,0.2)
RegKer(0,x1,y1,function(x){x^2},0.1)
  }

pabloramses/kernelreg documentation built on Feb. 11, 2021, 4:25 p.m.