SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.stat.density.DEDerivativeGaussian Class Reference

This class implements a density derivative estimator (DDE) with a Gaussian ( i.e., standard normal) kernel function. More...

Inheritance diagram for umontreal.ssj.stat.density.DEDerivativeGaussian:
umontreal.ssj.stat.density.DensityDerivativeEstimator umontreal.ssj.stat.density.DensityEstimator

Public Member Functions

 DEDerivativeGaussian (int order)
 Constructs a DDE with a Gaussian kernel function of order order.
 DEDerivativeGaussian (int order, double[] data)
 Constructs a DDE with a Gaussian kernel function of order order based on the observations data.
 DEDerivativeGaussian (double h)
 Constructs a DDE with a Gaussian kernel function with bandwidth h.
 DEDerivativeGaussian (double h, double[] data)
 Constructs a DDE with a Gaussian kernel function with bandwidth h based on the observations data.
 DEDerivativeGaussian (int order, double h)
 Constructs a DDE with a Gaussian kernel function of order order and bandwidth h.
 DEDerivativeGaussian (int order, double h, double[] data)
 Constructs a DDE with a Gaussian kernel function of order order and bandwidth h based on the observations data.
double evalDensity (double x)
 Evaluates the DDE at the point x.
double[] evalDensity (double[] evalPoints)
 Evaluates the DDE at all the points in evalPoints and the resulting values are returned in an array.
String toString ()
 Gives a short description of the estimator.
Returns
a short description.

Public Member Functions inherited from umontreal.ssj.stat.density.DensityDerivativeEstimator
int getOrder ()
 Gives the order \(r\) of the DDE.
void setOrder (int order)
 Sets the order \(r\) of the DDE to order.
double getH ()
 Gives the current bandwidth \(h\).
void setH (double h)
 Sets the bandwidth \(h\) to h.
void setData (double[] data)
 Sets the observations for the density estimator do data.Note that, in some cases, this requires to completely reconstruct the density estimator.
Parameters
datathe desired observations.

Public Member Functions inherited from umontreal.ssj.stat.density.DensityEstimator
double[] getData ()
 Gives the observations for this density estimator, if any.
double[] evalDensity (double[] evalPoints, double[] data)
 Sets the observations for the density estimator to data and evaluates the density at each point in evalPoints.
double[][] evalDensity (double[] evalPoints, double[][] data)
 This method is particularly designed to evaluate the density estimator in such a way that the result can be easily used to estimate the empirical IV and other convergence-related quantities.

Static Public Member Functions

static double evalDensity (double x, int order, double h, double[] data)
 Evaluates the DDE of order order with bandwidth h which is defined by the observations data at the evaluation point x.
static double[] evalDensity (double[] evalPoints, int order, double h, double[] data)
 Evaluates the DDE of order order with bandwidth h which is defined by the observations data at each of the evaluation points in evalPoints.
static double[][] evalDensity (double[] evalPoints, int order, double h, double[][] data)
 Assume that we have \(m\) independent realizations of the underlying model.
static double hermitePoly (int r, double x)
 Computes the probabilist's Hermite polynomial of order r at x, which is defined by the recursion.
Static Public Member Functions inherited from umontreal.ssj.stat.density.DensityDerivativeEstimator
static double hAmiseR (int r, double mu2, double mu2Derivative, double init, int n)
 Given a value init for the roughness functional of \( f^{(r+2)}\), mu2 the second moment of the kernel function \(K\), and mu2Derivative the second moment of \(K^{(r)}\), this method computes the asymptotically optimal bandwidth for the DDE based on \(n\) observations simulated by Monte Carlo for the \(r\)-th derivative of the sought density \(f\).
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 \(R(f^{(r+2t)})\) via init as initial value, this function iterates over (hopt) \(t\) times to obtain the asymptotically optimal bandwidth for the DDE based on \(n\) observations simulated by Monte Carlo for the \(r\)-th derivative of the sought density \(f\).
static double densityFunctionalGaussian (int r, double sigma)
 Computes \(\Phi_{2r}(p)\), i.e.
Static Public Member Functions inherited from umontreal.ssj.stat.density.DensityEstimator
static void evalDensity (ArrayList< DensityEstimator > listDE, double[] evalPoints, double[][] data, ArrayList< double[][]> listDensity)
 This function is particularly designed for experiments with many different types of density estimators, as it evaluates all of these estimators at the points in evalPoints.
static double[] computeVariance (double[][] density)
 This method computes the empirical variance based on the values given in data.
static double computeIV (double[][] density, double a, double b, double[] variance)
 This method estimates the empirical IV over the interval \([a,b]\).
static void computeIV (ArrayList< double[][]> listDensity, double a, double b, ArrayList< Double > listIV)
 This method estimates the empirical IV over the interval \([a,b]\) for a collection of different estimators.
static double[] computeMISE (ContinuousDistribution dist, double[] evalPoints, double[][] density, double a, double b, double[] variance, double[] sqBias, double[] mse)
 In situations where the true density is known this method can estimate the empirical MISE over the interval \([a,b]\).
static void computeMISE (ContinuousDistribution dist, double[] evalPoints, ArrayList< double[][]> listDensity, double a, double b, ArrayList< double[]> listMISE)
 This method estimates the empirical MISE over the interval \([a,b]\) for a collection of different estimators.
static String plotDensity (double[] evalPoints, double[] density, String plotTitle, String[] axisTitles)
 Gives a plot of the estimated density.
static double roughnessFunctional (double[] density, double a, double b)
 Estimates the roughness functional.

Additional Inherited Members

Protected Attributes inherited from umontreal.ssj.stat.density.DensityEstimator
double[] data
 The data associated with this DensityEstimator object, if any.

Detailed Description

This class implements a density derivative estimator (DDE) with a Gaussian ( i.e., standard normal) kernel function.

While many general methods are already handled by its superclass, this class is mainly concerned with the construction and evaluation of this kind of DDE. The formula specific to a Gaussian DDE is given by

\[ \hat{f}^{(r)}_{n,h}(x) = \frac{(-1)^r}{n h^{r+1}}\sum_{i=0}^{n-1} \phi \left( \frac{x-X_i}{h}\right) H_r\left( \frac{x-X_i}{h}\right), \]

where \(H_r\) denotes the probabilist's Hermite polynomial of order \(r\) and \(\phi\) denotes the standard normal density.

This class also offers static methods so that the user can simply evaluate the density based on a set of observations without having to construct a KDE.

Definition at line 23 of file DEDerivativeGaussian.java.

Constructor & Destructor Documentation

◆ DEDerivativeGaussian() [1/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( int order)

Constructs a DDE with a Gaussian kernel function of order order.

Parameters
orderthe order of the derivative considered.

Definition at line 30 of file DEDerivativeGaussian.java.

◆ DEDerivativeGaussian() [2/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( int order,
double[] data )

Constructs a DDE with a Gaussian kernel function of order order based on the observations data.

Parameters
orderorder the order of the derivative considered.
datathe observations.

Definition at line 41 of file DEDerivativeGaussian.java.

◆ DEDerivativeGaussian() [3/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( double h)

Constructs a DDE with a Gaussian kernel function with bandwidth h.

Parameters
hthe bandwidth.

Definition at line 51 of file DEDerivativeGaussian.java.

◆ DEDerivativeGaussian() [4/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( double h,
double[] data )

Constructs a DDE with a Gaussian kernel function with bandwidth h based on the observations data.

Parameters
hthe bandwidth.
datathe observations.

Definition at line 62 of file DEDerivativeGaussian.java.

◆ DEDerivativeGaussian() [5/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( int order,
double h )

Constructs a DDE with a Gaussian kernel function of order order and bandwidth h.

Parameters
hthe bandwidth.
orderthe order of the derivative considered.

Definition at line 75 of file DEDerivativeGaussian.java.

◆ DEDerivativeGaussian() [6/6]

umontreal.ssj.stat.density.DEDerivativeGaussian.DEDerivativeGaussian ( int order,
double h,
double[] data )

Constructs a DDE with a Gaussian kernel function of order order and bandwidth h based on the observations data.

Parameters
orderthe order of the derivative considered.
hthe bandwidth.
datathe observations.

Definition at line 88 of file DEDerivativeGaussian.java.

Member Function Documentation

◆ evalDensity() [1/5]

double umontreal.ssj.stat.density.DEDerivativeGaussian.evalDensity ( double x)

Evaluates the DDE at the point x.

Parameters
xthe evaluation point.
Returns
the DDE evaluated at x.

Reimplemented from umontreal.ssj.stat.density.DensityEstimator.

Definition at line 102 of file DEDerivativeGaussian.java.

◆ evalDensity() [2/5]

double umontreal.ssj.stat.density.DEDerivativeGaussian.evalDensity ( double x,
int order,
double h,
double[] data )
static

Evaluates the DDE of order order with bandwidth h which is defined by the observations data at the evaluation point x.

Parameters
xthe evaluation point.
orderthe order of the DDE.
hthe bandwidth.
datathe observations.
Returns
The DDE defined by the above parameters evaluated at x

Definition at line 171 of file DEDerivativeGaussian.java.

◆ evalDensity() [3/5]

double[] umontreal.ssj.stat.density.DEDerivativeGaussian.evalDensity ( double[] evalPoints)

Evaluates the DDE at all the points in evalPoints and the resulting values are returned in an array.

Parameters
evalPointsthe evaluation points.
Returns
the DDE evaluated at the points evalPoints.

Reimplemented from umontreal.ssj.stat.density.DensityEstimator.

Definition at line 129 of file DEDerivativeGaussian.java.

◆ evalDensity() [4/5]

double[] umontreal.ssj.stat.density.DEDerivativeGaussian.evalDensity ( double[] evalPoints,
int order,
double h,
double[] data )
static

Evaluates the DDE of order order with bandwidth h which is defined by the observations data at each of the evaluation points in evalPoints.

Parameters
evalPointsthe evaluation points.
orderthe order of the DDE.
hthe bandwidth.
datathe observations.
Returns
The DDE defined by the above parameters evaluated at each point in evalPoint.

Definition at line 201 of file DEDerivativeGaussian.java.

◆ evalDensity() [5/5]

double[][] umontreal.ssj.stat.density.DEDerivativeGaussian.evalDensity ( double[] evalPoints,
int order,
double h,
double data[][] )
static

Assume that we have \(m\) independent realizations of the underlying model.

For each such realization this method evaluates a DDE of order order with bandwidth h at the points from evalPoints. The independent realizations are passed via the 2-dimensional \(m\times n\) array data, where \(n\) denotes the number of observations per realization. Hence, its first index identifies the independent realization while its second index identifies a specific observation of this realization.

The result is returned as a \(m\times k\) matrix, where \(k \) is the number of evaluation points, i.e., the length of evalPoints. The first index, again, identifies the independent realization whereas the second index corresponds to the point of evalPoints at which the DDE was evaluated.

Parameters
evalPointsthe evaluation points.
orderthe order of the DDE.
hthe bandwidth.
datathe observations.
Returns
the DDE for each realization evaluated at evalPoints.

Definition at line 244 of file DEDerivativeGaussian.java.

◆ hermitePoly()

double umontreal.ssj.stat.density.DEDerivativeGaussian.hermitePoly ( int r,
double x )
static

Computes the probabilist's Hermite polynomial of order r at x, which is defined by the recursion.

\[H_{r+1}(x)= x H_r(x) - r H_{r-1}(x) \]

with initial values \(H_0(x) = 0\), \(H_1(x) = x\).

Parameters
rthe order of the Hermite polynomial.
xthe evaluation point.
Returns
the probabilist's Hermite polynomial.
Remarks
Florian: This should probably be located elsewhere.

Definition at line 263 of file DEDerivativeGaussian.java.

◆ toString()

String umontreal.ssj.stat.density.DEDerivativeGaussian.toString ( )

Gives a short description of the estimator.

Returns
a short description.

Reimplemented from umontreal.ssj.stat.density.DensityDerivativeEstimator.

Definition at line 156 of file DEDerivativeGaussian.java.


The documentation for this class was generated from the following file: