Top | ![]() |
![]() |
![]() |
![]() |
Functions
NcmData * | ncm_data_ref () |
void | ncm_data_free () |
void | ncm_data_clear () |
NcmData * | ncm_data_dup () |
guint | ncm_data_get_length () |
guint | ncm_data_get_dof () |
void | ncm_data_set_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 () |
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 () |
Object Hierarchy
GObject ╰── NcmData ├── NcmDataGaussDiag ├── NcmDataGauss ├── NcDataClusterNCount ├── NcmDataPoisson ├── NcmDataGaussCov ╰── NcmDataDist1d
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 NcmDataClass.m2lnL_val or NcmDataClass.leastsquares_f to perform respectively likelihood or least squares analysis.
Functions
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_get_length ()
guint
ncm_data_get_length (NcmData *data
);
Return a integer representing the number of data points.
ncm_data_get_dof ()
guint
ncm_data_get_dof (NcmData *data
);
Calculates the degrees of freedom associated with the data.
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.
ncm_data_resample ()
void ncm_data_resample (NcmData *data
,NcmMSet *mset
,NcmRNG *rng
);
Resample data in data
from the models contained in mset
.
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
.
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.
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()
.
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
.
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
.
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()
.
Types and Values
struct NcmDataClass
struct NcmDataClass { gboolean bootstrap; 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 (*leastsquares_J) (NcmData *data, NcmMSet *mset, NcmMatrix *J); void (*leastsquares_f_J) (NcmData *data, NcmMSet *mset, NcmVector *f, NcmMatrix *J); void (*m2lnL_val) (NcmData *data, NcmMSet *mset, gdouble *m2lnL); void (*m2lnL_grad) (NcmData *data, NcmMSet *mset, NcmVector *grad); void (*m2lnL_val_grad) (NcmData *data, NcmMSet *mset, gdouble *m2lnL, NcmVector *grad); };
Virtual table for the NcmData abstract class.
Members
gboolean |
sets whenever the NcmData implementations supports bootstrap. |
|
return the length associated to the NcmData object. |
||
return the effective degrees of freedom related to the NcmData statistics (likelihood or $\chi^2$) this number does not represent necessarely the number of data points. |
||
perform any model independent precalculation. |
||
perform any model dependent precalculation. |
||
resample data from the models in NcmMSet. |
||
calculates the least squares $\vec{f}$ vector, i.e., $\chi^2 \equiv \vec{f}\cdot\vec{f}$. |
||
calculates the least squares $\vec{f}$ vector derivatives
with respect to the free parameter of |
||
calculates both least squares vector and its derivatives. |
||
evaluate the minus two times the natural logarithim of the likelihood, i.e., $-2\ln(L)$. |
||
evaluate the gradient of $-2\ln(L)$ with respect to the free
parameters in |
||
evaluate the value and the gradient of $-2\ln(L)$. |
Property Details
The “bootstrap”
property
“bootstrap” NcmBootstrap *
The NcmData bootstrap object if any.
Flags: Read / Write
The “init”
property
“init” gboolean
Data initialized state.
Flags: Read / Write
Default value: FALSE