Fitting Equation of State Parameters to Data¶
Overview¶
BurnMan implements completely general nonlinear least squares fitting routines
in the function burnman.optimize.eos_fitting.nonlinear_least_squares_fit().
This function takes an instance of a burnman.optimize.nonlinear_fitting.NonLinearModel
as input, along with data to be fit, and returns best-fit parameters along with
uncertainties.
For many users, the process of constructing the NonLinearModel class may be unfamiliar and tedious. To facilitate fitting equations of state to data, BurnMan provides a number of helper functions that construct NonLinearModel instances so that users can easily fit equations of state to data.
Available Fitting Functions¶
- burnman.optimize.eos_fitting.fit_PTV_data(mineral, fit_params, data, data_covariances=[], delta_params=None, bounds=None, param_tolerance=1e-05, max_lm_iterations=50, param_priors=None, param_prior_inv_cov_matrix=None, verbose=True)[source]
A simple alias for the fit_PTp_data for when all the data is volume data
- burnman.optimize.eos_fitting.fit_PTp_data(mineral, fit_params, flags, data, data_covariances=[], mle_tolerances=[], param_tolerance=1e-05, delta_params=None, bounds=None, max_lm_iterations=50, param_priors=None, param_prior_inv_cov_matrix=None, verbose=True)[source]
Given a mineral of any type, a list of fit parameters and a set of P-T-property points and (optional) uncertainties, this function returns a list of optimized parameters and their associated covariances, fitted using the scipy.optimize.curve_fit routine.
- Parameters:
mineral (
burnman.Mineral) – Mineral for which the parameters should be optimized.fit_params (list of str) – List of dictionary keys contained in mineral.params corresponding to the variables to be optimized during fitting. Initial guesses are taken from the existing values for the parameters
flags (string or list of strings) – Attribute names for the property to be fit for the whole dataset or each datum individually (e.g. ‘V’)
data (2D numpy.array) – Observed X-P-T-property values
data_covariances (3D numpy.array) – X-P-T-property covariances (optional) If not given, all covariance matrices are chosen such that all data points have equal weight, with all error in the pressure.
mle_tolerances (numpy.array) – Tolerances for termination of the maximum likelihood iterations (optional).
param_tolerance (float) – Fractional tolerance for termination of the nonlinear optimization (optional).
delta_params (numpy.array) – Initial values for the change in parameters (optional).
bounds (2D numpy.array) – Minimum and maximum bounds for the parameters (optional). The shape must be (n_parameters, 2).
max_lm_iterations (int) – Maximum number of Levenberg-Marquardt iterations.
verbose (bool) – Whether to print detailed information about the optimization to screen.
- Returns:
Model with optimized parameters.
- Return type:
- burnman.optimize.eos_fitting.fit_VTP_data(mineral, fit_params, data, data_covariances=[], delta_params=None, bounds=None, param_tolerance=1e-05, max_lm_iterations=50, param_priors=None, param_prior_inv_cov_matrix=None, verbose=True)[source]
A simple alias for the fit_VTp_data for when all the data is pressure data
- burnman.optimize.eos_fitting.fit_VTp_data(mineral, fit_params, flags, data, data_covariances=[], mle_tolerances=[], param_tolerance=1e-05, delta_params=None, bounds=None, max_lm_iterations=50, param_priors=None, param_prior_inv_cov_matrix=None, verbose=True)[source]
Given a mineral of any type, a list of fit parameters and a set of V-T-property points and (optional) uncertainties, this function returns a list of optimized parameters and their associated covariances, fitted using the scipy.optimize.curve_fit routine.
- Parameters:
mineral (
burnman.Mineral) – Mineral for which the parameters should be optimized.fit_params (list of str) – List of dictionary keys contained in mineral.params corresponding to the variables to be optimized during fitting. Initial guesses are taken from the existing values for the parameters
flags (string or list of strings) – Attribute names for the property to be fit for the whole dataset or each datum individually (e.g. ‘P’)
data (2D numpy.array) – Observed V-T-property values
data_covariances (3D numpy.array) – V-T-property covariances (optional) If not given, all covariance matrices are chosen such that all data points have equal weight, with all error in the properties.
mle_tolerances (numpy.array) – Tolerances for termination of the maximum likelihood iterations (optional).
param_tolerance (float) – Fractional tolerance for termination of the nonlinear optimization (optional).
delta_params (numpy.array) – Initial values for the change in parameters (optional).
bounds (2D numpy.array) – Minimum and maximum bounds for the parameters (optional). The shape must be (n_parameters, 2).
max_lm_iterations (int) – Maximum number of Levenberg-Marquardt iterations.
verbose (bool) – Whether to print detailed information about the optimization to screen.
- Returns:
Model with optimized parameters.
- Return type: