NcmPriorFlat

NcmPriorFlat — Base class for flat prior distributions.

Functions

Properties

double h0 Read / Write / Construct
double scale Read / Write / Construct
double variable Read / Write / Construct
double x-low Read / Write / Construct
double x-upp Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── NcmMSetFunc
        ╰── NcmPrior
            ╰── NcmPriorFlat
                ├── NcmPriorFlatFunc
                ╰── NcmPriorFlatParam

Description

This object subclasses NcmPrior and defines a base class for flat priors used by NcmLikelihood. These objects describe flat prior distributions applicable to parameters or any derived quantity.

The prior is defined as: $$ -2\ln P(x) = \exp\left(\frac{2 h_0}{s} \left(\left(x_0 - x\right) + \frac{s}{2.0}\right)\right) + \exp\left(\frac{2 h_0}{s} \left(\left(x - x_1\right) + \frac{s}{2.0}\right)\right), $$ where $x_0$ and $x_1$ are the lower and upper limits, respectively, and $s$ is the scale of the prior. The variable $h_0$ has a default value of $20.0$. Note that for $x = x_0$, the first term is $e^{h_0}$ and grows exponentially with $x$ decreasing. For $x = x_0 + s$, the first term is $e^{-h_0}$ and decreases exponentially with $x$ increasing. The same happens for the second term around $x_1$.

The prior is not normalized. It is useful for defining a flat prior when the analysis is sensitive to discontinuities in the prior.

Functions

NcmPriorFlatMean ()

gdouble
(*NcmPriorFlatMean) (NcmPriorFlat *pf,
                     NcmMSet *mset);

ncm_prior_flat_ref ()

NcmPriorFlat *
ncm_prior_flat_ref (NcmPriorFlat *pf);

Increases the reference count of pf atomically.

Parameters

pf

a NcmPriorFlat

 

Returns

pf .

[transfer full]


ncm_prior_flat_free ()

void
ncm_prior_flat_free (NcmPriorFlat *pf);

Decreases the reference count of pf atomically.

Parameters

pf

a NcmPriorFlat

 

ncm_prior_flat_clear ()

void
ncm_prior_flat_clear (NcmPriorFlat **pf);

Decreases the reference count of *pf and sets *pf to NULL.

Parameters

pf

a NcmPriorFlat

 

ncm_prior_flat_set_x_low ()

void
ncm_prior_flat_set_x_low (NcmPriorFlat *pf,
                          const gdouble x_low);

Sets the lower limit of pf .

Parameters

pf

a NcmPriorFlat

 

x_low

lower limit

 

ncm_prior_flat_set_x_upp ()

void
ncm_prior_flat_set_x_upp (NcmPriorFlat *pf,
                          const gdouble x_upp);

Sets the upper limit of pf .

Parameters

pf

a NcmPriorFlat

 

x_upp

upper limit

 

ncm_prior_flat_set_scale ()

void
ncm_prior_flat_set_scale (NcmPriorFlat *pf,
                          const gdouble scale);

Sets the border scale of pf .

Parameters

pf

a NcmPriorFlat

 

scale

border scale

 

ncm_prior_flat_set_var ()

void
ncm_prior_flat_set_var (NcmPriorFlat *pf,
                        const gdouble var);

Sets the variable of pf .

Parameters

pf

a NcmPriorFlat

 

var

variable

 

ncm_prior_flat_set_h0 ()

void
ncm_prior_flat_set_h0 (NcmPriorFlat *pf,
                       const gdouble h0);

Sets the cut magnitude of pf .

Parameters

pf

a NcmPriorFlat

 

h0

Cut magnitude

 

ncm_prior_flat_get_x_low ()

gdouble
ncm_prior_flat_get_x_low (NcmPriorFlat *pf);

Parameters

pf

a NcmPriorFlat

 

Returns

the lower limit of pf .


ncm_prior_flat_get_x_upp ()

gdouble
ncm_prior_flat_get_x_upp (NcmPriorFlat *pf);

Parameters

pf

a NcmPriorFlat

 

Returns

the upper limit of pf .


ncm_prior_flat_get_scale ()

gdouble
ncm_prior_flat_get_scale (NcmPriorFlat *pf);

Parameters

pf

a NcmPriorFlat

 

Returns

the border scale of pf .


ncm_prior_flat_get_var ()

gdouble
ncm_prior_flat_get_var (NcmPriorFlat *pf);

Parameters

pf

a NcmPriorFlat

 

Returns

the variable of pf .


ncm_prior_flat_get_h0 ()

gdouble
ncm_prior_flat_get_h0 (NcmPriorFlat *pf);

Parameters

pf

a NcmPriorFlat

 

Returns

the cut magnitude of pf .

Types and Values

NCM_TYPE_PRIOR_FLAT

#define NCM_TYPE_PRIOR_FLAT (ncm_prior_flat_get_type ())

struct NcmPriorFlatClass

struct NcmPriorFlatClass {
};

NcmPriorFlat

typedef struct _NcmPriorFlat NcmPriorFlat;

Property Details

The “h0” property

  “h0”                       double

Cut magnitude.

Owner: NcmPriorFlat

Flags: Read / Write / Construct

Allowed values: >= 1

Default value: 20


The “scale” property

  “scale”                    double

border scale.

Owner: NcmPriorFlat

Flags: Read / Write / Construct

Allowed values: >= G_MINDOUBLE

Default value: 1e-10


The “variable” property

  “variable”                 double

variable.

Owner: NcmPriorFlat

Flags: Read / Write / Construct

Default value: 0


The “x-low” property

  “x-low”                    double

lower limit.

Owner: NcmPriorFlat

Flags: Read / Write / Construct

Default value: 0


The “x-upp” property

  “x-upp”                    double

upper limit.

Owner: NcmPriorFlat

Flags: Read / Write / Construct

Default value: 1