Class
NumCosmoMathData
Description [src]
abstract class NumCosmoMath.Data : GObject.Object
{
/* No available fields */
}
Abstract class for implementing data objects.
A NcmData represents a data set and its statistical model given the models in a
NcmMSet. It is the root object of a statistical analysis; several of them are
combined in a NcmDataset. The methods an implementation provides are those of
NcmDataClass.
An implementation must provide at least ncm_data_m2lnL_val(), for a likelihood analysis, or ncm_data_leastsquares_f(), for a least-squares one.
Every evaluation first calls ncm_data_prepare(). The begin method, when present, runs once before the first prepare after the data change (after it is initialized and after each ncm_data_resample()), and prepare runs every time.
Functions
ncm_data_clear
If data is not NULL, decreases the reference count of data by one and sets
*data to NULL.
Instance methods
ncm_data_bootstrap_create
Creates a bootstrap object inside of data. Uses the default bsize == fsize.
ncm_data_fisher_matrix
Calculates the Fisher-information matrix of data with respect to the free
parameters of mset. If IM is NULL a new matrix is allocated, otherwise IM
must be a square matrix of the number of free parameters and is overwritten.
Without free parameters *IM is freed and set to NULL. The Fisher matrix is
additive: those of uncorrelated data sets add up.
ncm_data_fisher_matrix_bias
Calculates the Fisher-information matrix, as ncm_data_fisher_matrix(), and the
parameter shift delta_theta obtained when the true mean is f_true, which must
have ncm_data_get_length() components. *delta_theta is allocated when NULL and
overwritten otherwise; without free parameters both are freed and set to NULL.
Both quantities are additive over uncorrelated data sets.
ncm_data_free
Decreases the reference count of data by one. If the reference count reaches
zero, data is freed.
ncm_data_has_mean_vector
This method returns TRUE if the likelihood implements
the ncm_data_mean_vector() virtual method.
ncm_data_inv_cov_UH
Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot H$.
ncm_data_inv_cov_Uf
Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot\vec{f}$.
ncm_data_leastsquares_f
Calculates the least squares vector $\vec{f}$ using the models contained in
mset and set the results in f.
ncm_data_m2lnL_val
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. With a
bootstrap enabled, aborts if the bootstrap has no realization.
ncm_data_mean_vector
Calculates the Gaussian mean vector (for non-Gaussian distribution it should calculate the Gaussian approximated mean of the actual distribution).
ncm_data_register_shared
Gives data the chance to register, via ncm_serialize_set(), any of its
own internal objects it wants shared (as an anchor, not deep-copied) by
every later ncm_serialize_dup_obj()/ncm_serialize_to_variant() call made
through the same ser — typically a large, read-only, per-instance
payload that would otherwise be duplicated once per parallel worker.
Subclasses only need to override this when they hold such a payload; the
default implementation does nothing.
ncm_data_resample
Resamples the data in data from the models contained in mset. During the
resampling data is marked as resampling (see ncm_data_is_resampling()) and
prepared; afterwards data is initialized and its begin method runs again before
the next evaluation, since the data changed.
ncm_data_take_desc
Sets the data description desc without copying it, the desc memory will
be freed (g_free) when the object is freed.
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct NumCosmoMathDataClass {
guint (* get_length) (
NcmData* data
);
guint (* get_dof) (
NcmData* data
);
void (* begin) (
NcmData* data
);
void (* prepare) (
NcmData* data,
NcmMSet* mset
);
void (* resample) (
NcmData* data,
NcmMSet* mset,
NcmRNG* rng
);
void (* leastsquares_f) (
NcmData* data,
NcmMSet* mset,
NcmVector* f
);
void (* m2lnL_val) (
NcmData* data,
NcmMSet* mset,
gdouble* m2lnL
);
void (* mean_vector) (
NcmData* data,
NcmMSet* mset,
NcmVector* mu
);
void (* inv_cov_UH) (
NcmData* data,
NcmMSet* mset,
NcmMatrix* H
);
void (* inv_cov_Uf) (
NcmData* data,
NcmMSet* mset,
NcmVector* f
);
void (* fisher_matrix_bias) (
NcmData* data,
NcmMSet* mset,
NcmVector* f_true,
NcmMatrix** IM,
NcmVector** delta_theta
);
void (* register_shared) (
NcmData* data,
NcmSerialize* ser
);
}
No description available.
Class members
get_length: guint (* get_length) ( NcmData* data )No description available.
get_dof: guint (* get_dof) ( NcmData* data )No description available.
begin: void (* begin) ( NcmData* data )No description available.
prepare: void (* prepare) ( NcmData* data, NcmMSet* mset )No description available.
resample: void (* resample) ( NcmData* data, NcmMSet* mset, NcmRNG* rng )No description available.
leastsquares_f: void (* leastsquares_f) ( NcmData* data, NcmMSet* mset, NcmVector* f )No description available.
m2lnL_val: void (* m2lnL_val) ( NcmData* data, NcmMSet* mset, gdouble* m2lnL )No description available.
mean_vector: void (* mean_vector) ( NcmData* data, NcmMSet* mset, NcmVector* mu )No description available.
inv_cov_UH: void (* inv_cov_UH) ( NcmData* data, NcmMSet* mset, NcmMatrix* H )No description available.
inv_cov_Uf: void (* inv_cov_Uf) ( NcmData* data, NcmMSet* mset, NcmVector* f )No description available.
fisher_matrix_bias: void (* fisher_matrix_bias) ( NcmData* data, NcmMSet* mset, NcmVector* f_true, NcmMatrix** IM, NcmVector** delta_theta )No description available.
register_shared: void (* register_shared) ( NcmData* data, NcmSerialize* ser )No description available.
Virtual methods
NumCosmoMath.DataClass.fisher_matrix
Calculates the Fisher-information matrix of data with respect to the free
parameters of mset. If IM is NULL a new matrix is allocated, otherwise IM
must be a square matrix of the number of free parameters and is overwritten.
Without free parameters *IM is freed and set to NULL. The Fisher matrix is
additive: those of uncorrelated data sets add up.
NumCosmoMath.DataClass.fisher_matrix_bias
Calculates the Fisher-information matrix, as ncm_data_fisher_matrix(), and the
parameter shift delta_theta obtained when the true mean is f_true, which must
have ncm_data_get_length() components. *delta_theta is allocated when NULL and
overwritten otherwise; without free parameters both are freed and set to NULL.
Both quantities are additive over uncorrelated data sets.
NumCosmoMath.DataClass.inv_cov_UH
Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot H$.
NumCosmoMath.DataClass.inv_cov_Uf
Given the Cholesky decomposition of the inverse covariance $C^{-1} = L\cdot U$ this function returns in-place the product $U\cdot\vec{f}$.
NumCosmoMath.DataClass.leastsquares_f
Calculates the least squares vector $\vec{f}$ using the models contained in
mset and set the results in f.
NumCosmoMath.DataClass.m2lnL_val
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. With a
bootstrap enabled, aborts if the bootstrap has no realization.
NumCosmoMath.DataClass.mean_vector
Calculates the Gaussian mean vector (for non-Gaussian distribution it should calculate the Gaussian approximated mean of the actual distribution).
NumCosmoMath.DataClass.prepare
Prepare all models in data necessary for the statistical calculations.
NumCosmoMath.DataClass.register_shared
Gives data the chance to register, via ncm_serialize_set(), any of its
own internal objects it wants shared (as an anchor, not deep-copied) by
every later ncm_serialize_dup_obj()/ncm_serialize_to_variant() call made
through the same ser — typically a large, read-only, per-instance
payload that would otherwise be duplicated once per parallel worker.
Subclasses only need to override this when they hold such a payload; the
default implementation does nothing.
NumCosmoMath.DataClass.resample
Resamples the data in data from the models contained in mset. During the
resampling data is marked as resampling (see ncm_data_is_resampling()) and
prepared; afterwards data is initialized and its begin method runs again before
the next evaluation, since the data changed.