Learn R Programming

fields (version 1.3-1)

nkreg: Normal kernel regression estimate

Description

Estimates a univariate or multivariate regression surface using a normal kernel function and a fixed bandwidth.

Usage

nkreg(data.x, data.y, bandwidth, n.points=50, grid=NULL, grid.list=NULL)

Arguments

Value

xPoints for evaluationyestimate of curve or surface. If more than one bandwidth is supplied then y is matrix with columns indexed by the bandwidth valueshbandwidths used.grid.listgrid.list that was either passed or created.

See Also

Tps, Krig, sreg, smooth.2d, image.smooth

Examples

Run this code
out<- nkreg( rat.diet$t, rat.diet$con, bandwidth=3, n.points=100)
plot( rat.diet$t, rat.diet$con)
lines( out$x, out$y)

# 2-d example evaluate at 40 points
out<- nkreg( precip$x, precip$y, bandwidth=.5, n.points=64)
image.plot( as.surface(out$x, out$y))

Run the code above in your browser using DataLab