NcmData

NcmData — Abstract class for implementing data objects.

Functions

Properties

NcmBootstrap * bootstrap Read / Write
char * desc Read / Write
gboolean init Read / Write
char * long-desc Read / Write
char * name Read

Types and Values

Object Hierarchy

    GObject
    ╰── NcmData
        ├── NcmDataGaussDiag
        ├── NcmDataGaussCov
        ├── NcmDataDist2d
        ├── NcmDataDist1d
        ├── NcmDataGauss
        ├── NcDataClusterNCount
        ├── NcDataClusterPseudoCounts
        ├── NcDataClusterWL
        ├── NcDataPlanckLKL
        ├── NcDataReducedShearClusterMass
        ├── NcmDataFunnel
        ├── NcmDataGaussMix2D
        ├── NcmDataPoisson
        ╰── NcmDataRosenbrock

Description

The NcmData object represent generic data. This is the root object used when building a statistical analysis. Every implementation of NcmData envolves the methods described in NcmDataClass.

A NcmData must implement, at least, the method ncm_data_m2lnL_val() or ncm_data_leastsquares_f() to perform respectively likelihood or least squares analysis.

Functions

NcmDataFisherMatrix ()

void
(*NcmDataFisherMatrix) (NcmData *data,
                        NcmMSet *mset,
                        NcmMatrix **IM);

Calculates the Fisher-information matrix I .

Parameters

data

a NcmData

 

mset

a NcmMSet

 

IM

The fisher matrix.

[out]

ncm_data_ref ()

NcmData *
ncm_data_ref (NcmData *data);

Increase the reference count of data .

Parameters

data

a NcmData.

 

Returns

data .

[transfer full]


ncm_data_free ()

void
ncm_data_free (NcmData *data);

Decrease the reference count of data .

Parameters

data

a NcmData.

 

ncm_data_clear ()

void
ncm_data_clear (NcmData **data);

Decrease the reference count of *data and sets the pointer *data to NULL.

Parameters

data

a NcmData.

 

ncm_data_dup ()

NcmData *
ncm_data_dup (NcmData *data,
              NcmSerialize *ser_obj);

Duplicate the data object.

Parameters

data

a NcmData.

 

ser_obj

a NcmSerialize.

 

Returns

a duplicate of data .

[transfer full]


ncm_data_get_length ()

guint
ncm_data_get_length (NcmData *data);

Return a integer representing the number of data points.

[virtual get_length]

Parameters

data

a NcmData.

 

Returns

number of data points.


ncm_data_get_dof ()

guint
ncm_data_get_dof (NcmData *data);

Calculates the degrees of freedom associated with the data.

[virtual get_dof]

Parameters

data

a NcmData.

 

Returns

degrees of freedom of the data.


ncm_data_set_init ()

void
ncm_data_set_init (NcmData *data,
                   gboolean state);

Sets the data to initialized or not state .

Parameters

data

a NcmData

 

state

a boolean

 

ncm_data_is_init ()

gboolean
ncm_data_is_init (NcmData *data);

Parameters

data

a NcmData

 

Returns

whether the data object is initialized.


ncm_data_set_desc ()

void
ncm_data_set_desc (NcmData *data,
                   const gchar *desc);

Sets the data description. It gets a copy of desc.

Parameters

data

a NcmData.

 

desc

description.

 

ncm_data_take_desc ()

void
ncm_data_take_desc (NcmData *data,
                    gchar *desc);

Sets the data description desc without copying it, the desc memory will be freed (g_free()) when the object is freed.

Parameters

data

a NcmData.

 

desc

description.

 

ncm_data_peek_desc ()

const gchar *
ncm_data_peek_desc (NcmData *data);

Gets data description.

Parameters

data

a NcmData.

 

Returns

internal data description.

[transfer none]


ncm_data_get_desc ()

gchar *
ncm_data_get_desc (NcmData *data);

Gets data description.

Parameters

data

a NcmData.

 

Returns

copy of the data description.

[transfer full]


ncm_data_prepare ()

void
ncm_data_prepare (NcmData *data,
                  NcmMSet *mset);

Prepare all models in data necessary for the statistical calculations.

[virtual prepare]

Parameters

data

a NcmData.

 

mset

a NcmMSet.

 

ncm_data_resample ()

void
ncm_data_resample (NcmData *data,
                   NcmMSet *mset,
                   NcmRNG *rng);

Resample data in data from the models contained in mset . During the resampling the data is marked as resampling and prepare is called.

[virtual resample]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

rng

a NcmRNG

 

ncm_data_is_resampling ()

gboolean
ncm_data_is_resampling (NcmData *data);

Parameters

data

a NcmData

 

Returns

whether the data is resampling.


ncm_data_bootstrap_create ()

void
ncm_data_bootstrap_create (NcmData *data);

Creates a bootstrap object inside of data . Uses the default bsize == fsize.

Parameters

data

a NcmData.

 

ncm_data_bootstrap_remove ()

void
ncm_data_bootstrap_remove (NcmData *data);

Removes a bootstrap object inside of data if any.

Parameters

data

a NcmData.

 

ncm_data_bootstrap_set ()

void
ncm_data_bootstrap_set (NcmData *data,
                        NcmBootstrap *bstrap);

Sets the bstrap object in data checking if they are compatible.

Parameters

data

a NcmData.

 

bstrap

a NcmBootstrap.

 

ncm_data_bootstrap_resample ()

void
ncm_data_bootstrap_resample (NcmData *data,
                             NcmRNG *rng);

Perform one bootstrap, i.e., resample the data with replacement.

Parameters

data

a NcmData.

 

rng

a NcmRNG.

 

ncm_data_bootstrap_enabled ()

gboolean
ncm_data_bootstrap_enabled (NcmData *data);

Checks whether bootstrap is enabled in data .

Parameters

data

a NcmData.

 

Returns

if bootstrap is enabled in data .


ncm_data_peek_bootstrap ()

NcmBootstrap *
ncm_data_peek_bootstrap (NcmData *data);

Parameters

data

a NcmData.

 

Returns

the current NcmBootstrap object or NULL.

[transfer none]


ncm_data_leastsquares_f ()

void
ncm_data_leastsquares_f (NcmData *data,
                         NcmMSet *mset,
                         NcmVector *f);

Calculates the least squares vector $\vec{f}$ using the models contained in mset and set the results in f .

[virtual leastsquares_f]

Parameters

data

a NcmData.

 

mset

a NcmMSet.

 

f

a NcmVector

 

ncm_data_m2lnL_val ()

void
ncm_data_m2lnL_val (NcmData *data,
                    NcmMSet *mset,
                    gdouble *m2lnL);

Calculates the value of $-2\ln(L)$, where $L$ represents the likelihood of the data given the models in mset . The result is stored in m2lnL .

[virtual m2lnL_val]

Parameters

data

a NcmData.

 

mset

a NcmMSet.

 

m2lnL

a double.

[out]

ncm_data_has_mean_vector ()

gboolean
ncm_data_has_mean_vector (NcmData *data);

This method returns TRUE if the likelihood implements the ncm_data_mean_vector() virtual method.

Parameters

data

a NcmData

 

Returns

whether the data can calculate the mean vector.


ncm_data_mean_vector ()

void
ncm_data_mean_vector (NcmData *data,
                      NcmMSet *mset,
                      NcmVector *mu);

Calculates the Gaussian mean vector (for non-Gaussian distribution it should calculate the Gaussian approximated mean of the actual distribution).

[virtual mean_vector]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

mu

the mean output NcmVector

 

ncm_data_sigma_vector ()

void
ncm_data_sigma_vector (NcmData *data,
                       NcmMSet *mset,
                       NcmVector *sigma);

ncm_data_inv_cov_UH ()

void
ncm_data_inv_cov_UH (NcmData *data,
                     NcmMSet *mset,
                     NcmMatrix *H);

Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot H$.

[virtual inv_cov_UH]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

H

a NcmMatrix

 

ncm_data_inv_cov_Uf ()

void
ncm_data_inv_cov_Uf (NcmData *data,
                     NcmMSet *mset,
                     NcmVector *f);

Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot\vec{f}$.

[virtual inv_cov_Uf]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

f

a NcmVector

 

ncm_data_fisher_matrix ()

void
ncm_data_fisher_matrix (NcmData *data,
                        NcmMSet *mset,
                        NcmMatrix **IM);

Calculates the Fisher-information matrix I . Note that this is an additive quantity, i.e., the Fisher-information matrix of different and uncorrrelated data sets can be added.

[virtual fisher_matrix]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

IM

The fisher matrix.

[out]

ncm_data_fisher_matrix_bias ()

void
ncm_data_fisher_matrix_bias (NcmData *data,
                             NcmMSet *mset,
                             NcmVector *f_true,
                             NcmMatrix **IM,
                             NcmVector **delta_theta);

Calculates the Fisher-information matrix I and the bias vector f assuming that the true theoretical model is f_true . Note that these are additive quantities, i.e., the Fisher-information matrix and the bias vector of different and uncorrrelated data sets can be added.

[virtual fisher_matrix_bias]

Parameters

data

a NcmData

 

mset

a NcmMSet

 

f_true

a NcmVector

 

IM

The fisher matrix.

[out]

delta_theta

The shift parameter vector.

[out]

Types and Values

NCM_TYPE_DATA

#define NCM_TYPE_DATA (ncm_data_get_type ())

struct NcmDataClass

struct NcmDataClass {
};

NCM_DATA_RESAMPLE_RNG_NAME

#define NCM_DATA_RESAMPLE_RNG_NAME "data_resample"

NcmData

typedef struct _NcmData NcmData;

Property Details

The “bootstrap” property

  “bootstrap”                NcmBootstrap *

The NcmData bootstrap object if any.

Owner: NcmData

Flags: Read / Write


The “desc” property

  “desc”                     char *

Description of the data object.

Owner: NcmData

Flags: Read / Write

Default value: NULL


The “init” property

  “init”                     gboolean

Data initialized state.

Owner: NcmData

Flags: Read / Write

Default value: FALSE


The “long-desc” property

  “long-desc”                char *

Description of the data object.

Owner: NcmData

Flags: Read / Write

Default value: NULL


The “name” property

  “name”                     char *

Name of the data object.

Owner: NcmData

Flags: Read

Default value: NULL