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.

Ancestors

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_distrib

Calculates the distribution of parameter pi.

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_distrib

Calculates the distribution of func.

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_distrib

Calculates the distribution of parameter pi.

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_col_by_name

Finds the column name in the catalog mcat.

ncm_mset_catalog_col_full_name
No description available.

ncm_mset_catalog_col_name
No description available.

ncm_mset_catalog_col_symb
No description available.

ncm_mset_catalog_erase_data

Erases all data from the fits file associated with the catalog.

ncm_mset_catalog_estimate_autocorrelation_tau

Updates the internal estimates of the integrate autocorrelation time.

ncm_mset_catalog_free

Decreases the reference count of mcat atomically.

ncm_mset_catalog_get_bestfit_m2lnL
No description available.

ncm_mset_catalog_get_bestfit_row
No description available.

ncm_mset_catalog_get_burnin

Gets the burn-in size, see ncm_mset_catalog_set_burnin().

ncm_mset_catalog_get_covar

Gets the current covariance matrix.

ncm_mset_catalog_get_cur_id
No description available.

ncm_mset_catalog_get_first_id
No description available.

ncm_mset_catalog_get_full_covar

Gets the current full (including additional values) covariance matrix.

ncm_mset_catalog_get_m2lnp_var

Gets the $-2\ln(p)$ parameter index.

ncm_mset_catalog_get_mean

Gets the current mean vector.

ncm_mset_catalog_get_mset

Gets the NcmMSet catalog from mcat.

ncm_mset_catalog_get_nth_m2lnL_percentile

Computes the p percentile of the likelihood.

ncm_mset_catalog_get_param_shrink_factor

Gets the current shrink factor of parameter p.

ncm_mset_catalog_get_post_lnnorm

Computes, if necessary, the posterior normalization.

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_row_from_time
No description available.

ncm_mset_catalog_get_run_type

Gets the run type string from mcat.

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_get_tau_method
No description available.

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_is_empty
No description available.

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_len

Number of items in the catalog.

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_max_time

Number of items in the catalog divided by the number of chains.

ncm_mset_catalog_nadd_vals

Number of additional variables in the catalog.

ncm_mset_catalog_nchains

Number of chains in the catalog.

ncm_mset_catalog_ncols
No description available.

ncm_mset_catalog_param_pdf

Bins and calculates the pdf associated with the parameter i.

ncm_mset_catalog_param_pdf_pvalue

Calculates the p-value associated with the parameter value pvalue.

ncm_mset_catalog_peek_accept_ratio_array

Peeks the acceptance ratio array.

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_chain_pstats

Peeks the chain NcmStatsVec object.

ncm_mset_catalog_peek_current_e_mean

Gets the last ensemble mean.

ncm_mset_catalog_peek_current_e_var

Gets the last ensemble variance.

ncm_mset_catalog_peek_current_row

Gets the last added row.

ncm_mset_catalog_peek_e_mean_stats

Peeks the ensemble NcmStatsVec object.

ncm_mset_catalog_peek_e_mean_t

Gets the mean of the t-th ensemble.

ncm_mset_catalog_peek_e_var_t

Gets the variance of the t-th ensemble.

ncm_mset_catalog_peek_filename

Gets the filename associated with mcat.

ncm_mset_catalog_peek_mset

Gets the NcmMSet catalog from mcat.

ncm_mset_catalog_peek_pstats

Peeks the parameters NcmStatsVec object.

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_peek_row

Gets the i-th row.

ncm_mset_catalog_ref

Increases the reference count of mcat atomically.

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_reset_stats

Reset catalog statistical quantities.

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_file

Sets the data filename to be used to sync/save data.

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_set_m2lnp_var

Sets p as the $-2\ln(p)$ parameter index.

ncm_mset_catalog_set_rng

Sets the random number generator.

ncm_mset_catalog_set_run_type

Sets the run type string.

ncm_mset_catalog_set_sync_interval

Sets the minimum time interval between syncs.

ncm_mset_catalog_set_sync_mode

Sets the sync mode to smode.

ncm_mset_catalog_set_tau_method

Sets the autocorrelation time method to tau_method.

ncm_mset_catalog_sync

Synchronize memory and data file. If no file was defined, it simply returns.

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.

ncm_mset_catalog_weighted

Whether the catalog has weights.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.MSetCatalog:burnin
No description available.

NumCosmoMath.MSetCatalog:filename
No description available.

NumCosmoMath.MSetCatalog:m2lnp-var
No description available.

NumCosmoMath.MSetCatalog:mset
No description available.

NumCosmoMath.MSetCatalog:nadd-val-names
No description available.

NumCosmoMath.MSetCatalog:nadd-val-symbols
No description available.

NumCosmoMath.MSetCatalog:nadd-vals
No description available.

NumCosmoMath.MSetCatalog:nchains
No description available.

NumCosmoMath.MSetCatalog:read-only
No description available.

NumCosmoMath.MSetCatalog:rng
No description available.

NumCosmoMath.MSetCatalog:run-type-string
No description available.

NumCosmoMath.MSetCatalog:smode
No description available.

NumCosmoMath.MSetCatalog:sync-interval
No description available.

NumCosmoMath.MSetCatalog:tau-method
No description available.

NumCosmoMath.MSetCatalog:weighted
No description available.

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.

Class structure

struct NumCosmoMathMSetCatalogClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.