Top | ![]() |
![]() |
![]() |
![]() |
Functions
NcmFitCatalog * | ncm_fit_catalog_new () |
void | ncm_fit_catalog_free () |
void | ncm_fit_catalog_clear () |
void | ncm_fit_catalog_set_file () |
void | ncm_fit_catalog_set_flush_mode () |
void | ncm_fit_catalog_set_flush_interval () |
void | ncm_fit_catalog_set_first_id () |
void | ncm_fit_catalog_set_run_type () |
void | ncm_fit_catalog_sync () |
void | ncm_fit_catalog_reset () |
void | ncm_fit_catalog_erase_data () |
const gchar * | ncm_fit_catalog_peek_filename () |
gboolean | ncm_fit_catalog_is_empty () |
gdouble | ncm_fit_catalog_largest_error () |
guint | ncm_fit_catalog_len () |
gboolean | ncm_fit_catalog_get_prng () |
void | ncm_fit_catalog_set_prng () |
void | ncm_fit_catalog_add_from_fit () |
void | ncm_fit_catalog_add_from_vector () |
void | ncm_fit_catalog_log_current_stats () |
void | ncm_fit_catalog_set_fit_mean_covar () |
void | ncm_fit_catalog_param_pdf () |
gdouble | ncm_fit_catalog_param_pdf_pvalue () |
Properties
gchar * | filename | Read / Write |
NcmFit * | fit | Read / Write / Construct Only |
gdouble | flush-interval | Read / Write / Construct |
NcmFitCatalogFlush | fmode | Read / Write / Construct |
gchar * | run-type-string | Read / Write / Construct |
Types and Values
enum | NcmFitCatalogFlush |
#define | NCM_FIT_CATALOG_EXTNAME |
#define | NCM_FIT_CATALOG_M2LNL_COLNAME |
#define | NCM_FIT_CATALOG_FIRST_ID_LABEL |
#define | NCM_FIT_CATALOG_PRNG_ALGO_LABEL |
#define | NCM_FIT_CATALOG_PRNG_SEED_LABEL |
#define | NCM_FIT_CATALOG_NROWS_LABEL |
#define | NCM_FIT_CATALOG_RTYPE_LABEL |
#define | NCM_FIT_CATALOG_RTYPE_BSTRAP_MEAN |
#define | NCM_FIT_CATALOG_RTYPE_UNDEFINED |
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_fit_catalog_new ()
NcmFitCatalog *
ncm_fit_catalog_new (NcmFit *fit
);
Creates a new NcmFitCatalog 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_fit_catalog_free ()
void
ncm_fit_catalog_free (NcmFitCatalog *fcat
);
Decrese the reference count of fcat
atomically.
ncm_fit_catalog_clear ()
void
ncm_fit_catalog_clear (NcmFitCatalog **fcat
);
Decrese the reference count of *fcat
atomically and sets the pointer *fcat
to null.
ncm_fit_catalog_set_file ()
void ncm_fit_catalog_set_file (NcmFitCatalog *fcat
,const gchar *filename
);
Sets the data filename to be used to sync/save data.
ncm_fit_catalog_set_flush_mode ()
void ncm_fit_catalog_set_flush_mode (NcmFitCatalog *fcat
,NcmFitCatalogFlush fmode
);
Sets the flush mode to fmode
.
ncm_fit_catalog_set_flush_interval ()
void ncm_fit_catalog_set_flush_interval (NcmFitCatalog *fcat
,gdouble interval
);
Sets the minimum time interval between flushs.
ncm_fit_catalog_set_first_id ()
void ncm_fit_catalog_set_first_id (NcmFitCatalog *fcat
,gint first_id
);
Sets the first id of the catalog, mainly used to inform in which realization the catalog starts.
ncm_fit_catalog_set_run_type ()
void ncm_fit_catalog_set_run_type (NcmFitCatalog *fcat
,const gchar *rtype_str
);
Sets the run type string.
ncm_fit_catalog_sync ()
void ncm_fit_catalog_sync (NcmFitCatalog *fcat
,gboolean check
);
Syncronise memory and data file. If no file was defined simply returns.
ncm_fit_catalog_reset ()
void
ncm_fit_catalog_reset (NcmFitCatalog *fcat
);
Clean all catalog data, close any opened file. Otherwise it does not change any object's parameter.
ncm_fit_catalog_erase_data ()
void
ncm_fit_catalog_erase_data (NcmFitCatalog *fcat
);
This function erases all data from the fits file associated with the catalog.
ncm_fit_catalog_peek_filename ()
const gchar *
ncm_fit_catalog_peek_filename (NcmFitCatalog *fcat
);
Gets the filename associated with fcat
.
ncm_fit_catalog_largest_error ()
gdouble
ncm_fit_catalog_largest_error (NcmFitCatalog *fcat
);
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_fit_catalog_len ()
guint
ncm_fit_catalog_len (NcmFitCatalog *fcat
);
Number of itens in the catalog.
ncm_fit_catalog_get_prng ()
gboolean ncm_fit_catalog_get_prng (NcmFitCatalog *fcat
,gchar **prng_algo
,gulong *seed
);
This function checks if any pseudo random number generator (PRNG) is registred in the catalog
and returns its properties in prng_algo
and seed
if so.
ncm_fit_catalog_set_prng ()
void ncm_fit_catalog_set_prng (NcmFitCatalog *fcat
,NcmRNG *rng
);
This function sets the pseudo random number generator (PRNG) description in the catalog.
ncm_fit_catalog_add_from_fit ()
void ncm_fit_catalog_add_from_fit (NcmFitCatalog *fcat
,NcmFit *fit
);
Adds a new element to the catalog using the parameters and likelihood value
from fit
. It assumes that fit
is compatible with the catalog.
ncm_fit_catalog_add_from_vector ()
void ncm_fit_catalog_add_from_vector (NcmFitCatalog *fcat
,NcmVector *vals
);
Adds a new element to the catalog using the values from the vector
vals
.
ncm_fit_catalog_log_current_stats ()
void
ncm_fit_catalog_log_current_stats (NcmFitCatalog *fcat
);
Logs the current means and standard deviations of the catalog's parameters.
ncm_fit_catalog_set_fit_mean_covar ()
void
ncm_fit_catalog_set_fit_mean_covar (NcmFitCatalog *fcat
);
Sets the NcmFit object parameters using the means from fcat
and
the covariance with the covariance of fcat
.
ncm_fit_catalog_param_pdf ()
void ncm_fit_catalog_param_pdf (NcmFitCatalog *fcat
,guint i
);
Bins and calculates the pdf associated with the parameter i
.
(not ready yet FIXME)
ncm_fit_catalog_param_pdf_pvalue ()
gdouble ncm_fit_catalog_param_pdf_pvalue (NcmFitCatalog *fcat
,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” NcmFitCatalogFlush
Catalog flush mode.
Flags: Read / Write / Construct
Default value: NCM_FIT_CATALOG_FLUSH_AUTO
The “run-type-string”
property
“run-type-string” gchar *
Run type string.
Flags: Read / Write / Construct
Default value: "undefined-run"