Class
NumCosmoMathFit
Description [src]
abstract class NumCosmoMath.Fit : GObject.Object
{
/* No available fields */
}
Abstract class for implementing fitting methods.
This object implements a abstract class for implementing fitting methods.
Instance methods
ncm_fit_add_equality_constraint
Adds an equality constraint with the function func and the tolerance tot.
ncm_fit_add_inequality_constraint
Adds an inequality constraint with the function func and the tolerance tot.
ncm_fit_covar_cor
Computes the correlation between the parameters pid1 and pid2 of the models
mid1 and mid2, respectively.
ncm_fit_covar_cov
Computes the covariance between the parameters pid1 and pid2 of the models
mid1 and mid2, respectively.
ncm_fit_covar_fparam_cor
Computes the correlation between the fitted parameters fpi1 and fpi2.
These indices refers to the list of all FREE parameters set in the MSet.
ncm_fit_covar_fparam_cov
Computes the covariance between the fitted parameters fpi1 and fpi2.
These indices refers to the list of all FREE parameters set in the MSet.
ncm_fit_covar_fparam_sd
Computes the standard deviation of the fitted parameter fpi.
This index refers to the list of all FREE parameters set in the MSet.
ncm_fit_covar_fparam_var
Computes the variance of the fitted parameter fpi.
This index refers to the list of all FREE parameters set in the MSet.
ncm_fit_data_m2lnL_val
This function computes minus two times the logarithm base e of the likelihood
using only the data set and not considering any prior. The result is set
on data_m2lnL.
ncm_fit_fisher
Calculates the covariance from the Fisher matrix, see ncm_dataset_fisher_matrix().
Note that this function does not use the gradient defined in the fit object, it
always uses the accurate numerical differentiation methods implemented in the
NcmDiff object.
ncm_fit_fisher_bias
Calculates the covariance from the Fisher matrix and the bias vector, see
ncm_dataset_fisher_matrix_bias(). The bias vector is calculated using the
the theory vector f_true as the true model expectation values.
ncm_fit_free
Atomically decrements the reference count of fit by one. If the reference count drops to 0,
all memory allocated by fit is released.
ncm_fit_function_error
Propagates the errors in the free parameters to the function func.
If no free parameters are set in the NcmMSet object associated to the
fit object, the computed error is 0.
ncm_fit_get_covar
Returns a copy of the covariance matrix (pre-calculated by, e.g, ncm_fit_numdiff_m2lnL_covar()).
ncm_fit_is_least_squares
Indicates if the least squares fitting is being used (TRUE) or not (FALSE).
ncm_fit_log_covar
Prints to the log file the names and indices of the fitted parameters, their best-fit values, standard deviations and correlation matrix.
ncm_fit_lr_test
Computes the likelihood ratio test for the parameter pid of the model mid
with the value val. The function returns the probability of the null hypothesis
assuming a chi-squared distribution with dof degrees of freedom. That is,
it computes the left tail of the chi-squared distribution with dof degrees of freedom.
ncm_fit_lr_test_range
Computes the likelihood ratio test for the parameter pid of the model mid
in the interval [start, stop] subdivided by nsteps. The function returns a
NcmMatrix with the following columns:
1. Parameter value.
2. The difference in -2 times the natural logarithm of the likelihood
between the full model and the model with the parameter pid fixed to the
value in the first column.
3. The probability density of the difference in -2 times the natural logarithm
of the likelihood between the full model and the model with the parameter
pid fixed to the value in the first column, assuming a chi-squared distribution
with one degree of freedom.
4. Cumulative probability (two-sides) of the difference (Column 3).
ncm_fit_ls_fisher
Computes the covariance matrix using the jacobian matrix and the least squares
problem, see ncm_fit_ls_J(). Note that this function uses the gradient defined
in the fit object using ncm_fit_set_grad_type() to compute the jacobian matrix.
ncm_fit_m2lnL_grad
Computes the gradient of the minus two times the logarithm base e of the likelihood.
ncm_fit_m2lnL_val_grad
Computes the minus two times the logarithm base e of the likelihood and its gradient.
ncm_fit_numdiff_m2lnL_covar
Calculates the covariance matrix using the inverse of the Hessian matrix $\partial_i\partial_j -\ln(L)$, where the derivatives are taken with respect to the free parameters.
deprecated: 0.18.2
ncm_fit_numdiff_m2lnL_lndet_covar
Calculates the logarithm of the determinant of the covariance matrix using the inverse of the Hessian matrix $\partial_i\partial_j -\ln(L)$, where the derivatives are taken with respect to the free parameters.
ncm_fit_obs_fisher
Computes the covariance matrix using the inverse of the Hessian matrix
$\partial_i\partial_j -\ln(L)$, where the derivatives are taken with respect to the
free parameters. This function does not use the gradient defined in the fit object,
it always uses the accurate numerical differentiation methods implemented in the
NcmDiff object.
ncm_fit_priors_m2lnL_val
This function computes minus two times the logarithm base e of the likelihood
using the data set and taking into account the assumed priors. The result is
set on priors_m2lnL.
ncm_fit_run_restart
Re-runs the fit until the difference between fits are less than the required tolerance, i.e., $$ m2lnL_{i-1} - m2lnL_i < \mathrm{abstol} + \mathrm{reltol}\vert m2lnL_{i-1}\vert. $$.
ncm_fit_set_logger
Sets the logger functions. The writer function is called to write the
messages to the log. The updater function is called to update the
parameters. The start_update is called before the minimization starts and
the end_update is called after the minimization ends.
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 NumCosmoMathFitClass {
NcmFit* (* copy_new) (
NcmFit* fit,
NcmLikelihood* lh,
NcmMSet* mset,
NcmFitGradType gtype
);
void (* reset) (
NcmFit* fit
);
gboolean (* run) (
NcmFit* fit,
NcmFitRunMsgs mtype
);
const gchar* (* get_desc) (
NcmFit* fit
);
}
No description available.
Class members
copy_new: NcmFit* (* copy_new) ( NcmFit* fit, NcmLikelihood* lh, NcmMSet* mset, NcmFitGradType gtype )No description available.
reset: void (* reset) ( NcmFit* fit )No description available.
run: gboolean (* run) ( NcmFit* fit, NcmFitRunMsgs mtype )No description available.
get_desc: const gchar* (* get_desc) ( NcmFit* fit )No description available.