Top | ![]() |
![]() |
![]() |
![]() |
Functions
void | (*NcmDataFisherMatrix) () |
NcmData * | ncm_data_ref () |
void | ncm_data_free () |
void | ncm_data_clear () |
NcmData * | ncm_data_dup () |
NcmData * | ncm_data_new_from_file () |
guint | ncm_data_get_length () |
guint | ncm_data_get_dof () |
void | ncm_data_set_init () |
gboolean | ncm_data_is_init () |
void | ncm_data_set_desc () |
void | ncm_data_take_desc () |
const gchar * | ncm_data_peek_desc () |
gchar * | ncm_data_get_desc () |
void | ncm_data_prepare () |
void | ncm_data_resample () |
void | ncm_data_bootstrap_create () |
void | ncm_data_bootstrap_remove () |
void | ncm_data_bootstrap_set () |
void | ncm_data_bootstrap_resample () |
gboolean | ncm_data_bootstrap_enabled () |
NcmBootstrap * | ncm_data_peek_bootstrap () |
void | ncm_data_leastsquares_f () |
void | ncm_data_leastsquares_J () |
void | ncm_data_leastsquares_f_J () |
void | ncm_data_m2lnL_val () |
void | ncm_data_m2lnL_grad () |
void | ncm_data_m2lnL_val_grad () |
void | ncm_data_mean_vector () |
void | ncm_data_sigma_vector () |
void | ncm_data_inv_cov_UH () |
void | ncm_data_fisher_matrix () |
Types and Values
#define | NCM_TYPE_DATA |
struct | NcmDataClass |
#define | NCM_DATA_RESAMPLE_RNG_NAME |
NcmData |
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
.
ncm_data_clear ()
void
ncm_data_clear (NcmData **data
);
Decrease the reference count of *data
and sets the pointer *data
to NULL.
ncm_data_dup ()
NcmData * ncm_data_dup (NcmData *data
,NcmSerialize *ser_obj
);
Duplicate the data
object.
ncm_data_new_from_file ()
NcmData *
ncm_data_new_from_file (const gchar *filename
);
Creates a new NcmData from filename
.
ncm_data_get_length ()
guint
ncm_data_get_length (NcmData *data
);
Return a integer representing the number of data points.
[virtual get_length]
ncm_data_get_dof ()
guint
ncm_data_get_dof (NcmData *data
);
Calculates the degrees of freedom associated with the data.
[virtual get_dof]
ncm_data_set_init ()
void ncm_data_set_init (NcmData *data
,gboolean state
);
Sets the data
to initialized or not state
.
ncm_data_set_desc ()
void ncm_data_set_desc (NcmData *data
,const gchar *desc
);
Sets the data
description. It gets a copy of desc.
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.
ncm_data_prepare ()
void ncm_data_prepare (NcmData *data
,NcmMSet *mset
);
Prepare all models in data
necessary for the statistical calculations.
[virtual prepare]
ncm_data_resample ()
void ncm_data_resample (NcmData *data
,NcmMSet *mset
,NcmRNG *rng
);
Resample data in data
from the models contained in mset
.
[virtual resample]
ncm_data_bootstrap_create ()
void
ncm_data_bootstrap_create (NcmData *data
);
Creates a bootstrap object inside of data
. Uses the default bsize == fsize.
ncm_data_bootstrap_remove ()
void
ncm_data_bootstrap_remove (NcmData *data
);
Removes a bootstrap object inside of data
if any.
ncm_data_bootstrap_set ()
void ncm_data_bootstrap_set (NcmData *data
,NcmBootstrap *bstrap
);
Sets the bstrap
object in data
checking if they are compatible.
ncm_data_bootstrap_resample ()
void ncm_data_bootstrap_resample (NcmData *data
,NcmRNG *rng
);
Perform one bootstrap, i.e., resample the data with replacement.
ncm_data_bootstrap_enabled ()
gboolean
ncm_data_bootstrap_enabled (NcmData *data
);
Checks whether bootstrap is enabled in data
.
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]
ncm_data_leastsquares_J ()
void ncm_data_leastsquares_J (NcmData *data
,NcmMSet *mset
,NcmMatrix *J
);
Calculates the least squares jacobian matrix $$J_{ij} = \frac{df_i}{dx_j},$$ where $f_i$ is the component of the least squares vector $\vec{f}$ and $x_j$ is the j-th parameter.
[virtual leastsquares_J]
ncm_data_leastsquares_f_J ()
void ncm_data_leastsquares_f_J (NcmData *data
,NcmMSet *mset
,NcmVector *f
,NcmMatrix *J
);
Calculates both least squares vector and matrix as in ncm_data_leastsquares_f()
and ncm_data_leastsquares_J()
.
[virtual leastsquares_f_J]
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]
ncm_data_m2lnL_grad ()
void ncm_data_m2lnL_grad (NcmData *data
,NcmMSet *mset
,NcmVector *grad
);
Calculates the gradient of $-2\ln(L)$, i.e., $$g_i = -2\frac{d\ln(L)}{dx_i}.$$
where $L$ represents the likelihood of the data given the models in mset
.
The result is stored in grad
.
[virtual m2lnL_grad]
ncm_data_m2lnL_val_grad ()
void ncm_data_m2lnL_val_grad (NcmData *data
,NcmMSet *mset
,gdouble *m2lnL
,NcmVector *grad
);
Calculates both the value and the gradient of $-2\ln(L)$ as in ncm_data_m2lnL_val()
and
ncm_data_m2lnL_grad()
.
[virtual m2lnL_val_grad]
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]
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\cdotU$ this function returns in-place the product $U\cdotH$.
[virtual inv_cov_UH]
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