create.grid: Create a grid for kernel estimation

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Helps to define a grid for kernel denity or regression estimates (univariate or multivariate).

Usage

1
create.grid(grid.list, sort=TRUE)

Arguments

grid.list

list of 1-dimensional vectors containing the grid values for each dimension

sort

sort the vectors (can be set to FALSE if vectors are already sorted in ascending order)

Details

This function allows easily to define grids for the "gplm" package. If the data are d-dimensional and the grid vector lengths are n1, ... nd, then the output is a (n1*...*nd) x d matrix with each row corresponding to one d-dimensional data point at which the function estimate is to be calculated.

Value

m x d grid matrix

Author(s)

Marlene Mueller

See Also

expand.grid, kde, kreg

Examples

1
2
3
4
5
6
7
8
  v1 <- 1:5
  v2 <- 3:1
  grid <- create.grid(list(v1,v2))

  x <- matrix(rnorm(60),30,2)
  v1 <- seq(min(x[,1]),max(x[,1]),length=10)
  v2 <- seq(min(x[,2]),max(x[,2]),length=5)
  grid <- create.grid(list(v1,v2))

gplm documentation built on May 2, 2019, 2:10 a.m.