Top |
Fit CatalogFit Catalog — Ordered catalog of different NcmMSet parameter values. |
Functions
NcmMSetCatalog * | ncm_mset_catalog_new () |
void | ncm_mset_catalog_free () |
void | ncm_mset_catalog_clear () |
void | ncm_mset_catalog_set_add_val_name () |
void | ncm_mset_catalog_set_file () |
void | ncm_mset_catalog_set_flush_mode () |
void | ncm_mset_catalog_set_flush_interval () |
void | ncm_mset_catalog_set_first_id () |
void | ncm_mset_catalog_set_run_type () |
void | ncm_mset_catalog_set_rng () |
void | ncm_mset_catalog_sync () |
void | ncm_mset_catalog_reset () |
void | ncm_mset_catalog_erase_data () |
const gchar * | ncm_mset_catalog_peek_filename () |
gboolean | ncm_mset_catalog_is_empty () |
gdouble | ncm_mset_catalog_largest_error () |
guint | ncm_mset_catalog_len () |
void | ncm_mset_catalog_add_from_mset () |
void | ncm_mset_catalog_add_from_mset_array () |
void | ncm_mset_catalog_add_from_vector () |
void | ncm_mset_catalog_log_current_stats () |
NcmVector * | ncm_mset_catalog_peek_current_row () |
void | ncm_mset_catalog_get_mean () |
void | ncm_mset_catalog_get_covar () |
void | ncm_mset_catalog_param_pdf () |
gdouble | ncm_mset_catalog_param_pdf_pvalue () |
Properties
gchar * | filename | Read / Write |
gdouble | flush-interval | Read / Write / Construct |
NcmMSetCatalogFlush | fmode | Read / Write / Construct |
NcmMSet * | mset | Read / Write / Construct Only |
guint | nadd-vals | Read / Write / Construct Only |
NcmRNG * | rng | Read / Write |
gchar * | run-type-string | Read / Write / Construct |
Types and Values
enum | NcmMSetCatalogFlush |
#define | NCM_MSET_CATALOG_EXTNAME |
#define | NCM_MSET_CATALOG_M2LNL_COLNAME |
#define | NCM_MSET_CATALOG_FIRST_ID_LABEL |
#define | NCM_MSET_CATALOG_RNG_ALGO_LABEL |
#define | NCM_MSET_CATALOG_RNG_SEED_LABEL |
#define | NCM_MSET_CATALOG_RNG_STAT_LABEL |
#define | NCM_MSET_CATALOG_RNG_INIS_LABEL |
#define | NCM_MSET_CATALOG_NROWS_LABEL |
#define | NCM_MSET_CATALOG_RTYPE_LABEL |
#define | NCM_MSET_CATALOG_RTYPE_BSTRAP_MEAN |
#define | NCM_MSET_CATALOG_RTYPE_UNDEFINED |
#define | NCM_MSET_CATALOG_FSYMB_LABEL |
Description
This class defines a catalog type object. This object can automatically syncronise with a fits file (thought cfitsio).
For Motecarlo studies like resampling from a fiducial model or bootstrap it is used to save the values of the best-fit values for each realization. Since the order of resampling is important due to the fact that we use the same pseudo-random number generator for all resamplings, this object also guarantees the order of the samples added.
For Markov Chain Montecarlo this object saves the value of the same likelihood in different points of the parameter space.
For both applications this object keeps an interactive mean and variance for the parameters added, this allows a sample by sample analyses of the convergence.
Functions
ncm_mset_catalog_new ()
NcmMSetCatalog * ncm_mset_catalog_new (NcmMSet *mset
,guint nadd_vals
,...
);
Creates a new NcmMSetCatalog based on the NcmFit object fit
. The catalog assumes that the fit
object will remain with the same set of free
parameters during his whole lifetime.
ncm_mset_catalog_free ()
void
ncm_mset_catalog_free (NcmMSetCatalog *mcat
);
Decrese the reference count of mcat
atomically.
ncm_mset_catalog_clear ()
void
ncm_mset_catalog_clear (NcmMSetCatalog **mcat
);
Decrese the reference count of *mcat
atomically and sets the pointer
*mcat
to null.
ncm_mset_catalog_set_add_val_name ()
void ncm_mset_catalog_set_add_val_name (NcmMSetCatalog *mcat
,guint i
,const gchar *name
);
Sets the i
-th additional value name.
ncm_mset_catalog_set_file ()
void ncm_mset_catalog_set_file (NcmMSetCatalog *mcat
,const gchar *filename
);
Sets the data filename to be used to sync/save data.
ncm_mset_catalog_set_flush_mode ()
void ncm_mset_catalog_set_flush_mode (NcmMSetCatalog *mcat
,NcmMSetCatalogFlush fmode
);
Sets the flush mode to fmode
.
ncm_mset_catalog_set_flush_interval ()
void ncm_mset_catalog_set_flush_interval (NcmMSetCatalog *mcat
,gdouble interval
);
Sets the minimum time interval between flushs.
ncm_mset_catalog_set_first_id ()
void ncm_mset_catalog_set_first_id (NcmMSetCatalog *mcat
,gint first_id
);
Sets the first id of the catalog, mainly used to inform in which realization the catalog starts.
ncm_mset_catalog_set_run_type ()
void ncm_mset_catalog_set_run_type (NcmMSetCatalog *mcat
,const gchar *rtype_str
);
Sets the run type string.
ncm_mset_catalog_set_rng ()
void ncm_mset_catalog_set_rng (NcmMSetCatalog *mcat
,NcmRNG *rng
);
Sets the random number generator.
ncm_mset_catalog_sync ()
void ncm_mset_catalog_sync (NcmMSetCatalog *mcat
,gboolean check
);
Syncronise memory and data file. If no file was defined simply returns.
ncm_mset_catalog_reset ()
void
ncm_mset_catalog_reset (NcmMSetCatalog *mcat
);
Clean all catalog data from memory and file. Otherwise it does not change any object's parameter.
ncm_mset_catalog_erase_data ()
void
ncm_mset_catalog_erase_data (NcmMSetCatalog *mcat
);
This function erases all data from the fits file associated with the catalog.
ncm_mset_catalog_peek_filename ()
const gchar *
ncm_mset_catalog_peek_filename (NcmMSetCatalog *mcat
);
Gets the filename associated with mcat
.
ncm_mset_catalog_largest_error ()
gdouble
ncm_mset_catalog_largest_error (NcmMSetCatalog *mcat
);
Calculates the largest proportional error of the parameters included, i.e., $\text{lre} = \sigma_{\hat{p}}/(|\hat{p}|\sqrt{n})$ where $n$ represents the number of samples in the catalog, $\hat{p}$ is the estimated mean of the parameter $p$ and $\sigma_{\hat{p}}$ its standard deviation.
It tries to guess when $p = 0$. In this case $\sigma_{\hat{p}} \approx |\hat{p}|\sqrt{n}$, therefore for $n > 10$ it tests if $\text{lre} \approx 1$ and if it is the case it returns $\text{lre} = \sigma_{\hat{p}}/\sqrt{n}$ instead.
ncm_mset_catalog_len ()
guint
ncm_mset_catalog_len (NcmMSetCatalog *mcat
);
Number of itens in the catalog.
ncm_mset_catalog_add_from_mset ()
void ncm_mset_catalog_add_from_mset (NcmMSetCatalog *mcat
,NcmMSet *mset
,...
);
Adds a new element to the catalog using the parameters from mset
. It
assumes that mset
is compatible with the catalog and expect the right number of
additional values.
ncm_mset_catalog_add_from_mset_array ()
void ncm_mset_catalog_add_from_mset_array (NcmMSetCatalog *mcat
,NcmMSet *mset
,gdouble *ax
);
Adds a new element to the catalog using the parameters from mset
. It
assumes that mset
is compatible with the catalog and expect the right number of
additional values in the array ax
.
ncm_mset_catalog_add_from_vector ()
void ncm_mset_catalog_add_from_vector (NcmMSetCatalog *mcat
,NcmVector *vals
);
Adds a new element to the catalog using the values from the vector vals
.
ncm_mset_catalog_log_current_stats ()
void
ncm_mset_catalog_log_current_stats (NcmMSetCatalog *mcat
);
Logs the current means and standard deviations of the catalog's parameters.
ncm_mset_catalog_peek_current_row ()
NcmVector *
ncm_mset_catalog_peek_current_row (NcmMSetCatalog *mcat
);
Gets the last added row.
ncm_mset_catalog_get_mean ()
void ncm_mset_catalog_get_mean (NcmMSetCatalog *mcat
,NcmVector **mean
);
Gets the current mean vector.
ncm_mset_catalog_get_covar ()
void ncm_mset_catalog_get_covar (NcmMSetCatalog *mcat
,NcmMatrix **cov
);
Gets the current covariance matrix.
ncm_mset_catalog_param_pdf ()
void ncm_mset_catalog_param_pdf (NcmMSetCatalog *mcat
,guint i
);
Bins and calculates the pdf associated with the parameter i
. (not ready yet
FIXME)
ncm_mset_catalog_param_pdf_pvalue ()
gdouble ncm_mset_catalog_param_pdf_pvalue (NcmMSetCatalog *mcat
,gdouble pval
,gboolean both
);
Calculates the p-value associated with the parameter value pval
.
Property Details
The “filename”
property
“filename” gchar *
Catalog filename.
Flags: Read / Write
Default value: NULL
The “flush-interval”
property
“flush-interval” gdouble
Data flush interval.
Flags: Read / Write / Construct
Allowed values: [0,1000]
Default value: 10
The “fmode”
property
“fmode” NcmMSetCatalogFlush
Catalog flush mode.
Flags: Read / Write / Construct
Default value: NCM_MSET_CATALOG_FLUSH_AUTO
The “nadd-vals”
property
“nadd-vals” guint
Number of additional values.
Flags: Read / Write / Construct Only
Allowed values: >= 1
Default value: 1
The “run-type-string”
property
“run-type-string” gchar *
Run type string.
Flags: Read / Write / Construct
Default value: "undefined-run"