Model and Modelstack

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”.

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.

Parameters
name: string

Model name

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’]

Sets scale for residuals, logarithmic or none

Returns

instance of model_obj

escape.core.model.modelstack(name, model=None)

Creates instance of modelstack_obj.

Parameters
name: string

Modelstack name.

model: single model instance or list of models

Models to add to modelstack.

Returns

instance of modelstack_obj

class escape.core.model.model_obj

Bases: object

data
data_length
dimensions
dof
last_cost
name
num_of_params
parameter(self, size_t i)
residuals
shake(self)
simulation
class escape.core.model.modelstack_obj

Bases: object

add(self, model_obj mdl)
data_length
dof
erase(self, size_t idx)
erase_all(self)
model(self, size_t idx)
name
num_of_params
parameter(self, size_t i)
set(self, size_t idx, model_obj mdl)
set_data(self, datastack_obj data)
shake(self)