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

Same as DensityEstimator but here the observations of the underlying model are \(t\)-dimensional. More...

Inheritance diagram for umontreal.ssj.stat.density.DensityEstimatorDoubleArray:
umontreal.ssj.stat.density.ConditionalDensityEstimator

Public Member Functions

abstract void setData (double[][] data)
 Sets the observations for the density estimator to data.
double[][] getData ()
 Gives the observations for this density estimator, if any.
abstract double evalDensity (double x)
 Evaluates the density estimator at x.
double[] evalDensity (double[] evalPoints)
 Evaluates the density estimator at the points in evalPoints.
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.
abstract String toString ()
 Gives a short description of the estimator.

Static Public Member Functions

static void evalDensity (ArrayList< DensityEstimatorDoubleArray > 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.

Protected Attributes

double[][] data
 The data associated with this DensityEstimatorDoubleArray object, if any.

Detailed Description

Same as DensityEstimator but here the observations of the underlying model are \(t\)-dimensional.

This can be useful for conditional density estimators or likelihood-ratio estimators, for instance. Here, mostly tools to evaluate the density are implemented, where evaluation at one point is to be defined individually for each realization and is thus kept abstract. Additional functionalities for experiments such as plotting the density, computing the integrated variance or the mean integrated square error, etc., can still be used from the DensityEstimator class.

Author
florian

Definition at line 21 of file DensityEstimatorDoubleArray.java.

Member Function Documentation

◆ evalDensity() [1/5]

void umontreal.ssj.stat.density.DensityEstimatorDoubleArray.evalDensity ( ArrayList< DensityEstimatorDoubleArray > listDE,
double[] evalPoints,
double data[][][],
ArrayList< double[][]> listDensity )
static

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.

To this end, the user passes a list of density estimators in listDE as well as \(m\) independent realizations of the underlying model consisting of \(n\) observations each in the \(m\times n \times t\) array data.

This method then calls evalDensity(double[], double[][][]) for each density estimator in listDE, thus evaluating the respective density estimator at the \(k\) points in evalPoints and adds the resulting \(m\times k\) array to listDensity.

Parameters
listDEthe list of density estimators.
evalPointsthe evaluation points.
datathe three-dimensional array carrying the observations of \(m\) independent realizations of the underlying model.
listDensitya list to which the evaluations at evalPoints of each density estimator in listDE are added.

Definition at line 144 of file DensityEstimatorDoubleArray.java.

◆ evalDensity() [2/5]

abstract double umontreal.ssj.stat.density.DensityEstimatorDoubleArray.evalDensity ( double x)
abstract

Evaluates the density estimator at x.

Parameters
xthe evaluation point.
Returns
the density estimator evaluated at \(x\).

Reimplemented in umontreal.ssj.stat.density.ConditionalDensityEstimator.

◆ evalDensity() [3/5]

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

Evaluates the density estimator at the points in evalPoints.

By default, this method calls evalDensity(double) for each entry of evalPoints. Many density estimators can handle evaluation at a set of points more efficiently than that. If so, it is suggested to override this method in the implementation of the corresponding estimator.

Returns
the density estimator evaluated at the points evalPoints.

Reimplemented in umontreal.ssj.stat.density.ConditionalDensityEstimator.

Definition at line 65 of file DensityEstimatorDoubleArray.java.

◆ evalDensity() [4/5]

double[] umontreal.ssj.stat.density.DensityEstimatorDoubleArray.evalDensity ( double[] evalPoints,
double data[][] )

Sets the observations for the density estimator to data and evaluates the density at each point in evalPoints.

Parameters
evalPointsthe evaluation points.
datathe observations.
Returns
the density estimator defined by data evaluated at each point in evalPoints.

Reimplemented in umontreal.ssj.stat.density.ConditionalDensityEstimator.

Definition at line 82 of file DensityEstimatorDoubleArray.java.

◆ evalDensity() [5/5]

double[][] umontreal.ssj.stat.density.DensityEstimatorDoubleArray.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.

Assume that we have \(m\) independent realizations of the underlying model. For each such realization this method constructs a density and evaluates it at the points from evalPoints. The independent realizations are passed via the 3-dimensional \(m\times n \times t\) array data, where \(n\) denotes the number of observations per realization and \(t\) the model dimension. 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 density estimator was evaluated.

Parameters
evalPointsthe evaluation points.
datathe three-dimensional array carrying the observations of \(m\) independent realizations of the underlying model.
Returns
the density estimator for each realization evaluated at evalPoints.

Definition at line 114 of file DensityEstimatorDoubleArray.java.

◆ getData()

double[][] umontreal.ssj.stat.density.DensityEstimatorDoubleArray.getData ( )

Gives the observations for this density estimator, if any.

Returns
the observations for this density estimator.

Definition at line 42 of file DensityEstimatorDoubleArray.java.

◆ setData()

abstract void umontreal.ssj.stat.density.DensityEstimatorDoubleArray.setData ( double data[][])
abstract

Sets the observations for the density estimator to data.

Note that, in some cases, this might require to completely reconstruct the density estimator.

Parameters
datathe desired observations.

Reimplemented in umontreal.ssj.stat.density.ConditionalDensityEstimator.

◆ toString()

abstract String umontreal.ssj.stat.density.DensityEstimatorDoubleArray.toString ( )
abstract

Gives a short description of the estimator.

Returns
a short description.

Reimplemented in umontreal.ssj.stat.density.ConditionalDensityEstimator.

Member Data Documentation

◆ data

double [][] umontreal.ssj.stat.density.DensityEstimatorDoubleArray.data
protected

The data associated with this DensityEstimatorDoubleArray object, if any.

Definition at line 26 of file DensityEstimatorDoubleArray.java.


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