NcmStatsDist1d

NcmStatsDist1d — Abstract class for implementing one dimensional probability distributions

Functions

Properties

double abstol Read / Write / Construct
gboolean compute-cdf Read / Write / Construct
double max-prob Read / Write / Construct
double norma Read
double reltol Read / Write / Construct
double xf Read / Write
double xi Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── NcmStatsDist1d
        ├── NcmStatsDist1dEPDF
        ╰── NcmStatsDist1dSpline

Description

Abstract class to reconstruct an arbitrary one dimensional probability distribution.

Functions

ncm_stats_dist1d_ref ()

NcmStatsDist1d *
ncm_stats_dist1d_ref (NcmStatsDist1d *sd1);

Increases the reference count of sd1 .

Parameters

sd1

a NcmStatsDist1d

 

Returns

sd1 .

[transfer full]


ncm_stats_dist1d_free ()

void
ncm_stats_dist1d_free (NcmStatsDist1d *sd1);

Decreases the reference count of sd1 .

Parameters

sd1

a NcmStatsDist1d

 

ncm_stats_dist1d_clear ()

void
ncm_stats_dist1d_clear (NcmStatsDist1d **sd1);

Decreases the reference count of *sd1 and sets the pointer *sd1 to NULL.

Parameters

sd1

a NcmStatsDist1d

 

ncm_stats_dist1d_prepare ()

void
ncm_stats_dist1d_prepare (NcmStatsDist1d *sd1);

Prepares the object for calculations.

Parameters

sd1

a NcmStatsDist1d

 

ncm_stats_dist1d_get_current_h ()

gdouble
ncm_stats_dist1d_get_current_h (NcmStatsDist1d *sd1);

[virtual get_current_h]

Parameters

sd1

a NcmStatsDist1d

 

Returns

the current value of the bandwidth h.


ncm_stats_dist1d_set_compute_cdf ()

void
ncm_stats_dist1d_set_compute_cdf (NcmStatsDist1d *sd1,
                                  gboolean compute_cdf);

Enable/Disable the computation of the CDF and inverse CDF whenever compute_cdf is TRUE/FALSE.

Parameters

sd1

a NcmStatsDist1d

 

compute_cdf

a boolean

 

ncm_stats_dist1d_get_compute_cdf ()

gboolean
ncm_stats_dist1d_get_compute_cdf (NcmStatsDist1d *sd1);

Parameters

sd1

a NcmStatsDist1d

 

Returns

If the sd1 is computing the CDF and inverse CDF.


ncm_stats_dist1d_set_xi ()

void
ncm_stats_dist1d_set_xi (NcmStatsDist1d *sd1,
                         gdouble xi);

Sets the lower bound of the distribution $x_i$.

Parameters

sd1

a NcmStatsDist1d

 

xi

a double

 

ncm_stats_dist1d_set_xf ()

void
ncm_stats_dist1d_set_xf (NcmStatsDist1d *sd1,
                         gdouble xf);

Sets the upper bound of the distribution $x_f$.

Parameters

sd1

a NcmStatsDist1d

 

xf

a double

 

ncm_stats_dist1d_get_xi ()

gdouble
ncm_stats_dist1d_get_xi (NcmStatsDist1d *sd1);

Parameters

sd1

a NcmStatsDist1d

 

Returns

the lower bound of the distribution $x_i$.


ncm_stats_dist1d_get_xf ()

gdouble
ncm_stats_dist1d_get_xf (NcmStatsDist1d *sd1);

Parameters

sd1

a NcmStatsDist1d

 

Returns

the upper bound of the distribution $x_f$.


ncm_stats_dist1d_eval_p ()

gdouble
ncm_stats_dist1d_eval_p (NcmStatsDist1d *sd1,
                         gdouble x);

Calculates the value of the probability density at x .

Parameters

sd1

a NcmStatsDist1d

 

x

random variable value

 

Returns

the value of the probability density at x .


ncm_stats_dist1d_eval_m2lnp ()

gdouble
ncm_stats_dist1d_eval_m2lnp (NcmStatsDist1d *sd1,
                             gdouble x);

Calculates the value of the $-2\ln(p(x))$ for the probability density. It can be unnormalized, the norma can be retrieved using ncm_stats_dist1d_eval_norma().

Parameters

sd1

a NcmStatsDist1d

 

x

random variable value

 

Returns

the value of $-2\ln(p(x))$.


ncm_stats_dist1d_eval_pdf ()

gdouble
ncm_stats_dist1d_eval_pdf (NcmStatsDist1d *sd1,
                           gdouble x);

Calculates the value of the probability of the interval [x_i, x ].

Parameters

sd1

a NcmStatsDist1d

 

x

random variable value

 

Returns

the value of the probability of the interval [x_i, x ].


ncm_stats_dist1d_eval_norma ()

gdouble
ncm_stats_dist1d_eval_norma (NcmStatsDist1d *sd1);

Calculates the norma of the distribution. If the probability density is already normalized it will return 1.0.

Parameters

sd1

a NcmStatsDist1d

 

Returns

the value distribution normalization.


ncm_stats_dist1d_eval_inv_pdf ()

gdouble
ncm_stats_dist1d_eval_inv_pdf (NcmStatsDist1d *sd1,
                               gdouble u);

Calculates the value of the random variable $x$ for which the cumulative distribution satisfy $\int_{x_i}^x\mathrm{d}x^\prime p(x^\prime) = u$.

Parameters

sd1

a NcmStatsDist1d

 

u

a number between [0, 1]

 

Returns

the value of x.


ncm_stats_dist1d_eval_inv_pdf_tail ()

gdouble
ncm_stats_dist1d_eval_inv_pdf_tail (NcmStatsDist1d *sd1,
                                    gdouble v);

Calculates the value of the random variable $x$ for which the cumulative distribution satisfy $\int_{x}^{x_f}\mathrm{d}x^\prime p(x^\prime) = v$.

Parameters

sd1

a NcmStatsDist1d

 

v

a number between [0, 1]

 

Returns

the value of x.


ncm_stats_dist1d_gen ()

gdouble
ncm_stats_dist1d_gen (NcmStatsDist1d *sd1,
                      NcmRNG *rng);

Generates a realization of the probability distribution.

Parameters

sd1

a NcmStatsDist1d

 

rng

a NcmRNG

 

Returns

the value of the probability of the interval [x_i, x ].


ncm_stats_dist1d_eval_mode ()

gdouble
ncm_stats_dist1d_eval_mode (NcmStatsDist1d *sd1);

Calculates the mode of the distribution.

Parameters

sd1

a NcmStatsDist1d

 

Returns

the mode of the probability distribution.

Types and Values

NCM_TYPE_STATS_DIST1D

#define NCM_TYPE_STATS_DIST1D (ncm_stats_dist1d_get_type ())

struct NcmStatsDist1dClass

struct NcmStatsDist1dClass {
};

NcmStatsDist1d

typedef struct _NcmStatsDist1d NcmStatsDist1d;

Property Details

The “abstol” property

  “abstol”                   double

Absolute tolerance on the random variables.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “compute-cdf” property

  “compute-cdf”              gboolean

Whether to compute CDF and inverse CDF.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Default value: TRUE


The “max-prob” property

  “max-prob”                 double

Maximal probability considered.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1


The “norma” property

  “norma”                    double

Distribution norma.

Owner: NcmStatsDist1d

Flags: Read

Allowed values: >= 0

Default value: 0


The “reltol” property

  “reltol”                   double

relative tolerance.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1e-14


The “xf” property

  “xf”                       double

x_f.

Owner: NcmStatsDist1d

Flags: Read / Write

Default value: 0


The “xi” property

  “xi”                       double

x_i.

Owner: NcmStatsDist1d

Flags: Read / Write

Default value: 0