Description Usage Arguments Details Value References Examples
View source: R/density_estimation.R
Estimate a conditional density function using locally Gaussian approximations.
1 2 3 4 5 6 7  | 
lg_object | 
 An object of type   | 
grid | 
 A matrix of grid points, where we want to evaluate the density estimate. Number of columns *must* be the same as number of variables in X1.  | 
condition | 
 A vector with conditions for the variables that we condition
upon. Length of this vector *must* be the same as the number of variables
in X2. The function will throw an error of there is any discrepancy in the
dimensions of the   | 
normalization_points | 
 How many grid points for approximating the integral of the density estimate, to use for normalization?  | 
fixed_grid | 
 Not used presently.  | 
This function is the conditional version of the locally Gaussian density
estimator (LGDE), described in Otneim & Tjøstheim (2018). The function takes
as arguments an lg-object as produced by the main lg_main- function,
a grid of points where the density estimate should be estimated, and a set of
conditions.
The variables must be sorted before they are supplied to this function. It will always assume that the free variables come before the conditioning variables.
Assume that X is a stochastic vector with two components X1 and X2. This function will thus estimate the conditional density of X1 given a specified value of X2.
A list containing the conditional density estimate as well as all the running parameters that has been used. The elements are:
f_est: The estimated conditional density.
c_mean: The estimated local conditional means as defined in
equation (10) of Otneim & Tjøstheim (2017).
c_cov: The estimated local conditional covariance matrices
as defined in equation (11) of Otneim & Tjøstheim (2017).
x: The data set.
bw: The bandwidth object.
transformed_data: The data transformed to approximate
marginal standard normality (if selected).
normalizing_constants: The normalizing constants used to
transform data and grid back and forth to the marginal standard
normality scale, as seen in eq. (8) of Otneim & Tjøstheim (2017)
(if selected).
grid: The grid where the estimation was performed, on the
original scale.
transformed_grid: The grid where the estimation was
performed, on the marginal standard normal scale.
normalization_points Number of grid points used
to approximate the integral of the density estimate, in order to
normalize?
normalization_constant If approximated, the integral of the
non-normalized density estimate. NA if not normalized.
density_normalized Logical, indicates whether the final
density estimate (contained in f_est) has been approximately
normalized to have unit integral.
Otneim, Håkon, and Dag Tjøstheim. "Conditional density estimation using the local Gaussian correlation" Statistics and Computing 28, no. 2 (2018): 303-321.
1 2 3 4 5 6 7 8  | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.