getDensity: Compute probability density estimate from numerical fields

Description Usage Arguments

View source: R/density_estimates.R

Description

One-dimensional numerical kernel density estimation based on density. This function abstacts away database operations and provides sensible defauts for trimming out outlier data, handling computational cost and handling special formats (like Date fields).

Usage

1
2
3
getDensity(tbl, cols, con = options("synergetr_con")[[1]], trim = 0.001,
  adj = 1, discrete = FALSE, n = 500,
  sample_max = options("synergetr_sample_max")[[1]], is_date = FALSE)

Arguments

tbl

Table name

cols

Column name

con

Connection object to the database, or NULL for in-memory data.frames

trim

The quentile of data to be discarded from both ends (min and max) for robust estimation of the probability density

adj

Kernel width parameter to be passed to density

discrete

TRUE for integer-valued output

n

Default number of point for the kernel density estimation

sample_max

Maximum number of data points to read from the source table. Can be used to limit the data transfer from a database (and the consecutive memory consumption and computational costs)

is_date

Convert data first into Date before casting it into integers (where day 0 equals 1970-01-01)


avirkki/synergetr documentation built on May 18, 2019, 9:16 p.m.