jdensity: jdensity

Description Usage Arguments Value

Description

A wrapper for multicdf() that extracts densities (masses) for a given set of observed values +/- the vector 'steps'.

Usage

1
2
jdensity(observed, steps, pcdfs, nosupport = NA, partial = T,
  interpolate = F)

Arguments

observed

Single row dataframe of observed data (will be coerced). Each column should be one variable that corresponds to one of the cdfs in pcdfobj.

pcdfs

List of cdfs, each corresponding to a relevant predictive variable. See 'pcdf()'.

nosupport

Value to return if the observed value(s) fall outside the support of the corresponding empirical cdf(s). Defaults to NA.

partial

If True, a density of >= 0 will be returned even if there is only partial overlap between the range (observed+/-steps) and the support of the corresponding cdf. The default value is True and it is generally recommended. It means that the function will return the density (mass) estimate for the portion of a given observed range that does fall within the support of the corresponding cdf. Without this option, the endpoint of the range that falls outside the cdf support will yield the nosupport value, which will mean the entire range could be disregraded in further calculations.

interpolate

If True, the empirical cdf will be interpolated, providing an estimate of a continuous pdf instead. If False (default), then observed values that lie between mass density estimates will yield 'nosupport'.

Value

Vector of densities (masses) corresponding to the variables in pcdfobj. The order of the densities (masses) will be the same as the order of the corresponding cdfs in pcdfobj.


wccarleton/Rlamap documentation built on May 24, 2019, 7:50 a.m.