fit_kde_object: Fit kernel density estimator (KDE) object

Description Usage Arguments Details Value Examples

View source: R/kde.R

Description

This function fits a kernel density estimator to a set of data points. Another wrapper of ks::kde.

Usage

1
fit_kde_object(df, h_band = NULL, position = 1:2, grid_size = rep(1000, 2))

Arguments

df

data.frame with all the points

h_band

optional argument for the bandwidth of the kde object. If NULL, the optimal band would be selected through the ks::kde function. Default is NULL.

position

Columns position of x/y pair. Default is 1:2

grid_size

size of the grid which is going to be used for the evaluation of kde object. Can be reduced to speed-up computation.

Details

This function is shared with TCpredictionbands on github: TCpredictionbands.

Value

KDE object fitted to the df data.frame.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
set.seed(8192)
x <- 2^rnorm(100)
y <- rnorm(100)
dfmat <- cbind(x,y)

kde_object <- fit_kde_object(dfmat)

## End(Not run)

skgallagher/EpiCompare documentation built on Sept. 14, 2021, 5:45 a.m.