Go to the first, previous, next, last section, table of contents.


CNDLRE -- Evaluation by Discrete--LRE

SYNOPSIS

#include <CNCL/DLREF.h> Distribution Function F(x)

#include <CNCL/DLREG.h> Complementary Distr. Function G(x) #include <CNCL/DLREP.h> Probability Function P(x)

TYPE

CN_DLREF
CN_DLREG
CN_DLREP

BASE CLASSES

CNStatistics, CNDLRE

DERIVED CLASSES

None

RELATED CLASSES

LREF, LREG

DESCRIPTION

The Discrete Limited Relative Error algorithm (DLRE or LRE III) is a special LRE for evaluating discrete random variables. The possible values must be known before the evalution is initialized, because F(x) resp. G(x) or P(x) of each value will be estimated. So, the DLRE is not a better histogramm with an error measure. The implementation is a generalized version of the algorithm.

If a test value does not agree with any x--interval, the following warning is printed: Warning: Wrong x value in DLRE[FGP]::put !. Since CNCL 1.8, values are rounded in order to find a suitable interval. Thus the above error message should not occur any longer.

Constructors:

CNDLREF( CNParam * param );
CNDLREF( double XMIN, double XMAX, double INT_SIZE, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, double Fmin = 0.0,
unsigned long MAX_NRV = ULONG_MAX);
CNDLREF( double * XVALUES, long LEVEL, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, double Fmin = 0.0,
unsigned long MAX_NRV = ULONG_MAX);
Initializes a CNDLREF evaluation. There are two types of the initializing: The first constructor (second of the list above) should be used for equidistant x--values and the second for non--equidistant x--values.
Parameters:
XMIN, XMAX
Minimal and maximal x--values, whose F(x) resp. G(x) shall be estimated.
INT_SIZE
Size of an interval of the x--axis
XVALUES
Pointer to an array of doubles, which includes the x--values.
LEVEL
The number of array elements.
MAX_ERR
maximum error of d.f. and d.f respectively
PRE_FIRST
Predecessor of the first test value. That is necessary because of the correlation; you should not think about it too long, since a false value causes only a very small error in the measurement.
NAME
allows to name the evaluation.
TEXT
a short explanation of the evaluation.
Fmin
minimum F-level to stop the evaluation even when the proposed error criteria aren't fulfilled. (Default is 0.0).
MAX_NRV
The maximum number of test values allowed.

CNDLREG( CNParam * param )
CNDLREG( double XMIN, double XMAX, double INT_SIZE, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, double Gmin = 0.0,
unsigned long MAX_NRV = ULONG_MAX);
CNDLREG( double * XVALUES, long LEVEL, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, double Gmin = 0.0,
unsigned long MAX_NRV = ULONG_MAX);
Initializes a CNDLREG evaluation. The parameters are as described above (except Gmin which replaces Fmin, of course).
CNDLREP( CNParam * param )
CNDLREP( double XMIN, double XMAX, double INT_SIZE, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, bool force_rminusa_ok = false,
unsigned long MAX_NRV = ULONG_MAX);
CNDLREP( double * XVALUES, long LEVEL, double MAX_ERR, double PRE_FIRST = 0.0,
const char* NAME = NIL, const char* TEXT = NIL, bool force_rminusa_ok = false,
unsigned long MAX_NRV = ULONG_MAX);
Initializes a CNDLREP evaluation. The parameters are as described above. The new parameter force_rminusa_ok is used to force (hence the name) the large sample condition r-a >= 10. This condition cannot necessary be fulfilled by all kind of simulations, but most often it only results in a longer run time. To ensure the correctness of the results this option should be set TRUE whenever possible (default is FALSE).

In addition to the member functions required by CNCL and CNStatistics, CNDLREF, CNDLREG and CNDLREP provide:

void set_base( double ba );
Used as factor for conditional probability.
virtual void change_error( double err );
Change required relative error during simulation.
virtual double cur_x_lev();
Returns the first/last x-value whose relative error is higher than the required one.
double cur_f_lev();
double cur_g_lev();
Indicates the currently evaluated F- resp. G-Level. This may show how far the evaluation has progressed.
virtual long min_index();
virtual long max_index();
Return the lowest/highest index of the result array. These functions can be used in conjunction with the function get_result().
virtual const struct CNDLRE::resultline *get_result( long index );
Returns a single result line. The available fields are x, vf -- holds F, G or P ---, rho -- local correlation ---, sigrho, d -- the relative error -- and nx -- the absolut hits of x.
virtual double f( double xt );
virtual double g( double xt );
virtual double p( double xt );
These functions return the actual calculated F-, G-, or P-Level for the supplied x-value.


Go to the first, previous, next, last section, table of contents.