Class
NumCosmoMathMSetCatalog
Description [src]
final class NumCosmoMath.MSetCatalog : GObject.Object
{
/* No available fields */
}
Ordered catalog of different NcmMSet parameter values.
This class defines a catalog type object. This object can automatically synchronize with a fits file (thought cfitsio).
For Mote Carlo studies, like resampling from a fiducial model or bootstrap, it is used to save the best-fitting values of each realization. Since the order of the resampling is important, due to the fact that we use the same pseudo-random number generator for all resampling calls, this object also guarantees the order of the samples added.
For Markov Chain Monte Carlo (MCMC) 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 of the parameters added, this allows a sample by sample analyses of the convergence. Some MCMC convergence diagnostic functions are also implemented here.
Constructors
ncm_mset_catalog_new
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 its whole lifetime.
ncm_mset_catalog_new_array
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 its whole lifetime.
ncm_mset_catalog_new_from_file
Creates a new NcmMSetCatalog from the catalog in the file file.
It will use also the mset file (same name but with .mset extension).
ncm_mset_catalog_new_from_file_ro
Creates a new NcmMSetCatalog from the catalog in the file file.
The file is opened in a read-only fashion.
It will use also the mset file (same name but with .mset extension).
Functions
ncm_mset_catalog_clear
Decrease the reference count of mcat atomically and sets the pointer mcat to null.
Instance methods
ncm_mset_catalog_add_from_mset
This function 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
This function 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
Adds a new element to the catalog using the values from the vector
vals.
ncm_mset_catalog_add_from_vector_array
Adds a new element to the catalog using the parameter values from the
vector vals and additional parameters from array ax.
ncm_mset_catalog_calc_add_param_ensemble_evol
Calculates the time evolution of the parameter pi distribution.
ncm_mset_catalog_calc_ci_direct
Calculates the mean and the confidence interval (CI) for the value of func for each
p-value in p_val. It stores the results in a NcmVector, where the first element
contains the mean and the following contain the lower and upper bounds for each
p-value in p_val.
ncm_mset_catalog_calc_ci_interp
Calculates the mean and the confidence interval (CI) for the value of func for each
p-value in p_val. It stores the results in a NcmMatrix, where the first element
contains the mean and the following contain the lower and upper bounds for each
p-value in p_val.
ncm_mset_catalog_calc_const_break
Fits the model: $$f(t) = c_0 + \theta_r(t-t_0)\left[c_1(t-t_0) + c_2\frac{(t-t_0)^2}{2}\right].$$ to estimate the time $t_0$ where the chain stops evolving.
ncm_mset_catalog_calc_heidel_diag
Applies the Heidelberger and Welch’s convergence diagnostic to the catalog,
see ncm_stats_vec_heidel_diag() for mode details. If the number of chains in
the catalog is larger than one, it considers the whole catalog otherwise it
considers the ensemble means. The variable ntests control the number of
divisions where the test will be applied, if it is zero the default 10 tests
will be used.
ncm_mset_catalog_calc_max_ess_time
Calculates the time $t_m$ that maximizes the ESS for all
elements of the catalog. If the number of chains in the catalog is larger
than one, it considers the whole catalog otherwise it considers the ensemble
means. The variable ntests control the number of divisions where the ESS
will be calculated, if it is zero the default 10 tests will be used.
ncm_mset_catalog_calc_param_ensemble_evol
Calculates the time evolution of the parameter pi distribution.
ncm_mset_catalog_calc_pvalue
Calculates the p-values for the value of func
for each limit in lim, integrating the probability distribution function from
the left tail to lim. It stores the results in a NcmMatrix, where the
first element contains the p-value with respect to the first lim, and so on.
ncm_mset_catalog_estimate_autocorrelation_tau
Updates the internal estimates of the integrate autocorrelation time.
ncm_mset_catalog_get_full_covar
Gets the current full (including additional values) covariance matrix.
ncm_mset_catalog_get_post_lnvol
Computes the volume of the level region of the posterior.
Sets into glnvol the log volume of the Gaussian approximation
of the posterior.
ncm_mset_catalog_get_rng
This function checks if any pseudo random number generator (RNG) is registered in the catalog. If so, it returns it or NULL.
ncm_mset_catalog_get_shrink_factor
Gets the current shrink factor which is the multivariate potential scale reduction factor (MPSRF), namely, $$\hat{R}^p = \sqrt{\frac{n - 1}{n} + \left( \frac{m + 1}{m} \right) \lambda_1},$$ where $n$ is the number of points of one chain, $m$ is the number of chains and $\lambda_1$ is the largest eigenvalue of the positive definite matrix $W^{-1}B/n$.
ncm_mset_catalog_heidel_diag_by_chain
Calculates the lowest time $t_m$ where all chains satisfy the Heidelberger
and Welch’s convergence diagnostic. The variable ntests control the number
of divisions where the test will be calculated, if it is zero the default
10 tests will be used.
ncm_mset_catalog_largest_error
This function 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.
ncm_mset_catalog_log_current_chain_stats
Logs the current means and standard deviations of the catalog’s parameters for each chain.
ncm_mset_catalog_log_current_stats
Logs the current means and standard deviations of the catalog’s parameters.
ncm_mset_catalog_log_full_covar
Logs the current full (including additional values) covariance matrix.
ncm_mset_catalog_max_ess_time_by_chain
Calculates the time $t_m$ that maximizes the ESS for each chain of the catalog.
The variable ntests control the number of divisions where the ESS
will be calculated, if it is zero the default 10 tests will be used.
ncm_mset_catalog_param_pdf_pvalue
Calculates the p-value associated with the parameter value pvalue.
ncm_mset_catalog_peek_autocorrelation_tau
Gets the last estimate of the autocorrelation tau calculated in the last call of ncm_mset_catalog_estimate_autocorrelation_tau().
ncm_mset_catalog_peek_rng
This function checks if any pseudo random number generator (RNG) is registered in the catalog. If so, it returns it or NULL.
ncm_mset_catalog_remove_last_ensemble
Removes the last ensemble point in the catalog, i.e., removes the last ‘number of chains’ points of the catalog. Creates a backup of the original file.
ncm_mset_catalog_reset
Clean all catalog data from memory and file. Otherwise it does not change any object’s parameter.
ncm_mset_catalog_set_burnin
Sets the number of elements to ignore when reading from a catalogue, it must be set before loading data from a file.
ncm_mset_catalog_set_first_id
Sets the first id of the catalog, mainly used to inform in which realization the catalog starts.
ncm_mset_catalog_timed_sync
Synchronize memory and data file if enough time was passed after the last sync, see ncm_mset_catalog_set_sync_interval(). If no file was defined, it simply returns.
ncm_mset_catalog_trim
Drops all points in the catalog such that $t < t_c$ and skips
every thin-1 rows, creating a thinner catalog.
This function trims the first $t_c \times n_\mathrm{chains}$
points from the catalog. Creates a backup of the original file.
ncm_mset_catalog_trim_by_type
Calculates the time $t_m$ that satisfies all trimming options
in trim_type. Then drops all elements of the catalog and drops
all points $t < t_m$.
ncm_mset_catalog_trim_oob
Remove all points that are outside the bounds defined by
the catalog mset file. The catalog will always have a
single chain after the trimming. The result is saved to out_file.
ncm_mset_catalog_trim_p
Drops all points in the catalog such that the first p percent of the catalog is dropped.
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.