RBF_filter: RBF filter

Description Usage Arguments Value Examples

View source: R/frequency_fns.R

Description

Takes a 2-D set of disaggregated points and smooths them out by placing a radial basis function at each point and using least-squares estimation for the ensuing weights. The constant trend is added on at the end.

Usage

1
RBF_filter(data, si, varname = "z", smooth_var = 800^2)

Arguments

data

a data frame with fields x, y and an output variable.

si

data frame containing fields x and y which denote the desired coordinates of the output field (typically a grid).

varname

the label of the column in data to use as the output variable.

smooth_var

the variance of the radial basis function.

Value

the smoothed field values at locations in si

Examples

1
2
3
4
data <- data.frame(x = c(1,1,2,2),y = c(1,2,1,2), z = c(1,2,3,4))
si <- as.data.frame(expand.grid(seq(0,3,by=0.1),seq(0,3,by=0.1)))
names(si) <- c("x","y")
si$z <- RBF_filter(data,si,varname="z",smooth_var=1)

shazhe/mvst0 documentation built on May 29, 2019, 9:20 p.m.