Description Usage Arguments Details Value Author(s) References Examples
View source: R/Beran_estimator.R
Estimates the Fourier coefficients of the scores in a location shift model, with is the class of densities obtained by a location shift of a fixed unknown density f. The score, given by
φ'(x)=-f'\circ F^{-1}(t)/f\circ F^{-1}(x),
does not depend on the unknown shift. The Fourier coefficients of the score is estimated from the data, whose density is assumed to be a location shift of the unknown density f. We use Beran (1974)'s nonparametric estimator here.
1 | score.coeff(x, theta, indices, which)
|
x |
An array of length n; represents the data from a location model whose score the Fourier coefficients seek to estimate. |
theta |
A small number, should be of order O_p(n^{-1/2}). The default is 4n^{-1/2} |
indices |
An array of positive integers, for each integer j in "indices", Fourier coefficient corresponding to the basis function t\mapsto\exp(i2π jt) is computed. |
which |
Optional. Takes value 1 or 2. If "which" is 1, only the real part of the Fourier coefficient is computed. If "which" is 2, only the imaginary part of the k-th coefficient is calculated. The default is to calculate both real and imaginary parts. |
theta:
theta do not need to depend on the range of the data because
the estimators depend only on the rank of the dataponts. If theta=z_n which
equals z n^{-1/2}, then the estimated coefficients are
root-n consistent by Theorem 2.1 of Beran (1974).
which:
If it is known that the density f is symmetric,
then the Fourier coefficients are real. Therefore, there is
no need to calculate the imaginary part. Similarly, if the density
is odd, then the Fourier coefficinets of the scores are purely
imaginary. Otherwise, one generally requires both the real and the imaginary parts,
and "which" should be left unspecified in those cases.
If "which=1", an array (with the same length as "indices"), give the real parts of the Fourier coefficients.
If "which=2, an array (with the same length as "indices"), give the imaginary parts of the Fourier coefficients.
The default is to return a matrix whose first and second column give the real and imaginary parts of the Fourier coefficients, respectively. The number of rows equal the length of the array "indices".
Nilanjana Laha (maintainer), nlaha@hsph.harvard.edu.
Beran, R. (1974). Asymptotically efficient adaptive rank estimates in location models. Ann. Statist., 2, 63-74.
1 | x <- rnorm(100); score.coeff(x, length(x)^(-1/2), 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.