Model and modelstack¶
The escape.core.model module provides methods to create models objects.
Model is a container for a kernel and corresponding experimental data. It is responsible for calculating residuals and cost function, which are used by optimizers for curve fitting. The model has two settings: weight_type-“none” or “data” and residuals_scale - “none”, “log”, “q2” and “q4”.
The latter defines how to calculate residuals, with logarithmic scale or without and the former indicates which weights will be used to calculate cost, no weights or weights obtained from the data object.
Modelstacks are used when several models should be optimized.
- escape.core.model.model(name, obj, data_obj data, weight_type='data', residuals_scale='none')¶
Creates instance of model_obj.
- name: string
- kernel: kernel_obj or functor_obj
Kernel object, which model will use for intensity calculations.
- data: data_obj
Experimental data for the calculation of cost function
- weight_type: string, [‘none’, ‘data’]
Sets weight type for calculation of residuals
- residuals_scale: string, [‘none’, ‘log’, ‘q2’, ‘q4’]
Sets scale for residuals, none, logarithmic, Q^2 or Q^4
instance of model_obj
- escape.core.model.modelstack(name, model=None)¶
Creates instance of modelstack_obj.
- name: string
- model: single model instance or list of models
Models to add to modelstack.
instance of modelstack_obj
- class escape.core.model.model_obj¶
- parameter(self, size_t i)¶