Description Usage Arguments Details Value References Examples
View source: R/density_estimation.R
Function that estimates a univariate density estimation by local Gaussian approximations, as described in Hufthammer and Tjøstheim (2009).
1 2 3 4 5 6 | dlg_marginal(
x,
bw = 1,
eval_points = seq(quantile(x, 0.01), quantile(x, 0.99), length.out = grid_size),
grid_size = 15
)
|
x |
The data vector. |
bw |
The bandwidth (a single number). |
eval_points |
The grid where we want to evaluate the density. Chosen suitably if not provided, with length equal to grid_size. |
grid_size |
Number of grid points if grid is not provided. |
This function is mainly mean to be used as a tool in multivariate analysis as away to obtain the estimate of a univariate (marginal) density function, but it can of course be used in general to estimate univariate densities.
A list including the data set $x
, the grid
$eval_points
, the bandwidth $bw
, as well as a matrix of the
estimated parameter estimates $par_est
and the estimated bivariate
density $f_est
.
Hufthammer, Karl Ove, and Dag Tjøstheim. "Local Gaussian Likelihood and Local Gaussian Correlation" PhD Thesis of Karl Ove Hufthammer, University of Bergen, 2009.
1 2 | x <- rnorm(100)
estimate <- dlg_marginal(x, bw = 1, eval_points = -4:4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.