NcmStatsDist1d

NcmStatsDist1d — Abstract class for implementing one dimensional probability distributions

Properties

gdouble abstol Read / Write / Construct
gdouble max-prob Read / Write / Construct
gdouble norma Read
gdouble reltol Read / Write / Construct
gdouble xf Read / Write
gdouble xi Read / Write

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_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.

Property Details

The “abstol” property

  “abstol”                   gdouble

Absolute tolerance on the random variables.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “max-prob” property

  “max-prob”                 gdouble

Maximal probability considered.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1


The “norma” property

  “norma”                    gdouble

Distribution norma.

Owner: NcmStatsDist1d

Flags: Read

Allowed values: >= 0

Default value: 0


The “reltol” property

  “reltol”                   gdouble

relative tolerance.

Owner: NcmStatsDist1d

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1e-13


The “xf” property

  “xf”                       gdouble

x_f.

Owner: NcmStatsDist1d

Flags: Read / Write

Default value: 0


The “xi” property

  “xi”                       gdouble

x_i.

Owner: NcmStatsDist1d

Flags: Read / Write

Default value: 0