1package umontreal.ssj.stat.density;
137 public static double hAmiseR(
int r,
double mu2,
double mu2Derivative,
double init,
int n) {
138 double invN = 1.0 / (double) n;
139 double sign = r % 2 == 0 ? 1.0 : -1.0;
140 double h = sign * mu2Derivative * (2.0 * (double) r + 1.0) * invN / (mu2 * init);
141 double exp = 1.0 / (2.0 * (double) r + 5.0);
142 return Math.pow(h, exp);
185 public static double hAmiseR(
int r,
int t,
double mu2,
double[] mu2Derivative,
double init,
188 int k = evalPoints.length;
189 double[] estDensity =
new double[k];
190 int n = dde.
data.length;
192 for (
int tau = t - 1; tau >= 1; tau--) {
193 h =
hAmiseR(r + 2 * tau, mu2, mu2Derivative[tau], init, n);
200 return hAmiseR(r, mu2, mu2Derivative[0], init, n);
220 double sign = (r % 2 == 0 ? 1.0 : -1.0);
221 double facTerm = 1.0;
222 for (
int i = r + 1; i <= 2 * r; i++) {
223 facTerm *= (double) i;
225 double denom = Math.pow(2.0 * sigma, (
double) (2.0 * r + 1.0));
227 denom *= Math.sqrt(Math.PI);
229 return sign * facTerm / denom;
236 return "DDE [h = " + h +
"]";
This class implements a density derivative estimator (DDE) based on a kernel density estimator (KDE) ...
static double hAmiseR(int r, double mu2, double mu2Derivative, double init, int n)
Given a value init for the roughness functional of , mu2 the second moment of the kernel function ,...
String toString()
Gives a short description of the estimator.a short description.
static double hAmiseR(int r, int t, double mu2, double[] mu2Derivative, double init, DensityDerivativeEstimator dde, double[] evalPoints, double a, double b)
Given an estimate of via init as initial value, this function iterates over (hopt) times to obtain ...
int getOrder()
Gives the order of the DDE.
double getH()
Gives the current bandwidth .
void setData(double[] data)
Sets the observations for the density estimator do data.Note that, in some cases, this requires to co...
void setH(double h)
Sets the bandwidth to h.
void setOrder(int order)
Sets the order of the DDE to order.
static double densityFunctionalGaussian(int r, double sigma)
Computes , i.e.
This abstract class represents a univariate density estimator (DE).
double[] data
The data associated with this DensityEstimator object, if any.
static double roughnessFunctional(double[] density, double a, double b)
Estimates the roughness functional.
abstract double evalDensity(double x)
Evaluates the density estimator at x.