find_rho | R Documentation |
$\rho$
between two variables.This function uses the local likelihood function
proposed by Hjort & Jones (1996) to find an estimate of the
local correlation $\rho$
given $n$
bivariate
observations and a vector $b$
with the specified
bandwidths. Note that the code use the simplifying assumption
that the the marginals are standard normal, which reduces the
number of parameters to estimate from five to one. This
function is based on code from H\aakon Otneim.
find_rho(
data,
grid,
b,
.kernel = c("normal", "uniform"),
return_arguments = FALSE
)
data |
A matrix containing the observations, one bivariate observation in each row. |
grid |
A matrix containing the points where we want to find the local correlations, one bivariate point in each row. |
b |
A vector containing the two bandwidths to use. |
.kernel |
Specification of the kernel to use, either
|
return_arguments |
Logical argument, default |
In the computation, a product kernel that either is based
on the standard normal distribution or the uniform distribution
is used. The default kernel is the normal one, since it seems
to behave better than the uniform kernel with regard to being
able to get a proper result (i.e. not NA
) and since it
also seems to compute a bit faster when a computation is
possible. Note that the code computes the required densities
(related to the normal distribution) directly instead of using
dnorm
and dmvnorm
, since that gives a speed gain.
The result of this function is a list. For each grid-point
there will be an estimate of the local correlation and the
log-density of the corresponding local Gaussian approximation
at that point. When return_arguments
is TRUE
,
the three arguments data
, grid
and b
will
also be included.
Hjort, N. L., and Jones, M. C.: "Locally parametric nonparametric density estimation.", The Annals of Statistics (1996): 1619-1647.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.