Class ExpData

Inheritance Relationships

Base Type

Class Documentation

class ExpData : public amici::SimulationParameters

ExpData carries all information about experimental or condition-specific data.

Public Functions

ExpData() = default

Default constructor.

ExpData(ExpData const&) = default

Copy constructor.

ExpData(int nytrue, int nztrue, int nmaxevent)

Constructor that only initializes dimensions.

Parameters:
  • nytrue – Number of observables

  • nztrue – Number of event outputs

  • nmaxevent – Maximal number of events to track

ExpData(int nytrue, int nztrue, int nmaxevent, std::vector<realtype> ts)

constructor that initializes timepoints from vectors

Parameters:
  • nytrue – Number of observables

  • nztrue – Number of event outputs

  • nmaxevent – Maximal number of events to track

  • ts – Timepoints (dimension: nt)

ExpData(int nytrue, int nztrue, int nmaxevent, std::vector<realtype> ts, std::vector<realtype> fixed_parameters)

constructor that initializes timepoints and fixed parameters from vectors

Parameters:
  • nytrue – Number of observables

  • nztrue – Number of event outputs

  • nmaxevent – Maximal number of events to track

  • ts – Timepoints (dimension: nt)

  • fixed_parametersModel variables excluded from sensitivity analysis (dimension: nk)

ExpData(int nytrue, int nztrue, int nmaxevent, std::vector<realtype> ts, std::vector<realtype> const &my, std::vector<realtype> const &sigma_y, std::vector<realtype> const &mz, std::vector<realtype> const &sigma_z)

constructor that initializes timepoints and data from vectors

Parameters:
  • nytrue – Number of observables

  • nztrue – Number of event outputs

  • nmaxevent – Maximal number of events to track

  • ts – Timepoints (dimension: nt)

  • my – measurements (dimension: nt x nytrue, row-major)

  • sigma_y – noise scale of measurements (dimension: nt x nytrue, row-major)

  • mz – event measurements (dimension: nmaxevents x nztrue, row-major)

  • sigma_z – noise scale of event measurements (dimension: nmaxevents x nztrue, row-major)

explicit ExpData(Model const &model)

constructor that initializes with Model

Parameters:

model – pointer to model specification object

ExpData(ReturnData const &rdata, realtype sigma_y, realtype sigma_z, int seed = -1)

Constructor that initializes with ReturnData, adds normally distributed noise according to specified sigmas.

Parameters:
  • rdata – return data pointer with stored simulation results

  • sigma_y – scalar noise scales for all observables

  • sigma_z – scalar noise scales for all event observables

  • seed – Seed for the random number generator. If a negative number is passed, a random seed is used.

ExpData(ReturnData const &rdata, std::vector<realtype> sigma_y, std::vector<realtype> sigma_z, int seed = -1)

Constructor that initializes with ReturnData, adds normally distributed noise according to specified sigmas.

Parameters:
  • rdata – return data pointer with stored simulation results

  • sigma_y – vector of noise scales for observables (dimension: nytrue or nt x nytrue, row-major)

  • sigma_z – vector of noise scales for event observables (dimension: nztrue or nmaxevent x nztrue, row-major)

  • seed – Seed for the random number generator. If a negative number is passed, a random seed is used.

~ExpData() = default
int nytrue() const

number of observables of the non-augmented model

Returns:

number of observables of the non-augmented model

int nztrue() const

number of event observables of the non-augmented model

Returns:

number of event observables of the non-augmented model

int nmaxevent() const

maximal number of events to track

Returns:

maximal number of events to track

int nt() const

number of timepoints

Returns:

number of timepoints

void set_timepoints(std::vector<realtype> const &ts)

Set output ts.

If the number of timepoint increases, this will grow the observation/sigma matrices and fill new entries with NaN. If the number of ts decreases, this will shrink the observation/sigma matrices.

Note that the mapping from ts to measurements will not be preserved. E.g., say there are measurements at t = 2, and this function is called with [1, 2], then the old measurements will belong to t = 1.

Parameters:

ts – ts

std::vector<realtype> const &get_timepoints() const

Get output timepoints.

Returns:

ExpData::ts

realtype get_timepoint(int it) const

Get timepoint for a specific index.

Parameters:

it – timepoint index

Returns:

timepoint timepoint at index

void set_measurements(std::vector<realtype> const &my)

Set all measurements.

Parameters:

my – measurements (dimension: nt x nytrue, row-major)

void set_measurements(std::vector<realtype> const &my, int iy)

Set measurements for a specific observable.

Parameters:
  • my – measurements (dimension: nt)

  • iy – observable index

bool is_set_measurement(int it, int iy) const

Check whether a measurement is defined at the given indices.

Parameters:
  • it – time index

  • iy – observable index

Returns:

true if a value is set for the specified indices; otherwise false

std::vector<realtype> const &get_measurements() const

Get all measurements.

Returns:

measurements (dimension: nt x nytrue, row-major)

realtype const *get_measurements_ptr(int it) const

Get measurements for a specific timepoint.

Parameters:

it – timepoint index

Returns:

pointer to measurements at index (dimension: nytrue)

void set_noise_scales(std::vector<realtype> const &sigma)

Set noise scales for all measurements.

Parameters:

sigma – noise scales (dimension: nt x nytrue, row-major)

void set_noise_scales(realtype sigma)

Set identical noise scales for all measurements.

Parameters:

sigma – noise scale (dimension: scalar)

void set_noise_scales(std::vector<realtype> const &sigma, int iy)

Set measurement noise scales of for a observable.

Parameters:
  • sigma – noise scales (dimension: nt)

  • iy – observable index

void set_noise_scales(realtype sigma, int iy)

Set all noise scales for a specific observable to the input value.

Parameters:
  • sigma – noise scale (dimension: scalar)

  • iy – observable index

bool is_set_noise_scale(int it, int iy) const

Check whether a noise scale is defined at the given indices.

Parameters:
  • it – time index

  • iy – observable index

Returns:

true if a value is set for the specified indices; otherwise false

std::vector<realtype> const &get_noise_scales() const

Get measurement noise scales.

Returns:

noise scales of measurements

realtype const *get_noise_scales_ptr(int it) const

Get pointer to measurement noise scales.

Parameters:

it – timepoint index

Returns:

pointer to noise scales of measurements at index

void set_event_measurements(std::vector<realtype> const &mz)

Set event measurements.

Parameters:

mz – event measurements (dimension: nmaxevent x nztrue, row-major)

void set_event_measurements(std::vector<realtype> const &mz, int iz)

Set event measurements for a specific event observable.

Parameters:
  • mz – event measurements (dimension: nmaxevent)

  • iz – event observable index

bool is_set_event_measurement(int ie, int iz) const

Check whether an event measurement is defined at the given indices.

Parameters:
  • ie – event index

  • iz – event observable index

Returns:

true if a value is set for the specified indices; otherwise false

std::vector<realtype> const &get_event_measurements() const

Get all event measurements.

Returns:

event measurements

realtype const *get_event_measurements_ptr(int ie) const

Get pointer to event measurements at ie-th occurrence.

Parameters:

ie – event occurrence

Returns:

pointer to event measurements at ie-th occurrence

void set_event_noise_scales(std::vector<realtype> const &sigma)

Set noise scales of event measurements.

Parameters:

sigma – noise scales of event measurements

void set_event_noise_scales(realtype sigma)

Set noise scales of all event measurements.

Parameters:

sigma – noise scale (dimension: scalar)

void set_event_noise_scales(std::vector<realtype> const &sigma, int iz)

Set noise scales for a specific event observable.

Parameters:
  • sigma – noise scales of observed data (dimension: nmaxevent)

  • iz – event observable index

void set_event_noise_scales(realtype sigma, int iz)

Set all noise scales for a specific event observable.

Parameters:
  • sigma – noise scale (dimension: scalar)

  • iz – event observable index

bool is_set_event_noise_scale(int ie, int iz) const

Check whether an event noise scale is defined at the given indices.

Parameters:
  • ie – event occurence

  • iz – event observable index

Returns:

true if a value is set for the specified indices; otherwise false

std::vector<realtype> const &get_event_noise_scales() const

Get noise scale of observed event data.

Returns:

noise scale of observed event data

realtype const *get_event_noise_scales_ptr(int ie) const

Get pointer to noise scale of observed event data at ie-th occurrence.

Parameters:

ie – event occurrence

Returns:

pointer to noise scale of observed event data at ie-th occurrence

void clear_observations()

Set all observations and their noise scales to NaN.

Useful, e.g., after calling ExpData::setTimepoints.

Public Members

std::string id

Arbitrary (not necessarily unique) identifier.

Protected Functions

void apply_dimensions()

resizes measurements_, noise_scales_, event_measurements_ and event_noise_scales_

void apply_data_dimension()

resizes measurements_ and noise_scales_

void apply_event_dimension()

resizes event_measurements_ and event_noise_scales_

void check_data_dimension(std::vector<realtype> const &input, char const *fieldname) const

checker for dimensions of input measurements_ or noise_scales_

Parameters:
  • input – vector input to be checked

  • fieldname – name of the input

void check_events_dimension(std::vector<realtype> const &input, char const *fieldname) const

checker for dimensions of input event_measurements_ or event_noise_scales_

Parameters:
  • input – vector input to be checked

  • fieldname – name of the input

Protected Attributes

int nytrue_ = {0}

number of observables

int nztrue_ = {0}

number of event observables

int nmaxevent_ = {0}

maximal number of event occurrences

std::vector<realtype> measurements_

observed data (dimension: nt x nytrue, row-major)

std::vector<realtype> noise_scales_

noise scale of observed data (dimension: nt x nytrue, row-major)

std::vector<realtype> event_measurements_

observed events (dimension: nmaxevents x nztrue, row-major)

std::vector<realtype> event_noise_scales_

noise scale of observed events/roots (dimension: nmaxevents x nztrue, row-major)

Friends

inline friend bool operator==(ExpData const &lhs, ExpData const &rhs)

Equality operator.

Parameters:
  • lhs – some object

  • rhs – another object

Returns:

true, if both arguments are equal; false otherwise.