pybop.observers.observer#
Classes#
An observer of a time series state. Observers: |
Module Contents#
- class pybop.observers.observer.Observer(parameters: List[pybop.parameters.parameter.Parameter], model: pybop.models.base_model.BaseModel, check_model=True, signal=['Voltage [V]'], additional_variables=[], init_soc=None, x0=None)[source]#
Bases:
pybop._problem.BaseProblem- An observer of a time series state. Observers:
keep track of the distribution of a current time series model state
predict forward in time the distribution of the state
update the distribution of the state with new observations
- Parameters:
parameters (list) – List of parameters for the problem.
model (BaseModel) – The model to observe.
check_model (bool, optional) – Flag to indicate if the model should be checked (default: True).
signal (List[str]) – The signal to observe.
additional_variables (List[str], optional) – Additional variables to observe and store in the solution (default: []).
init_soc (float, optional) – Initial state of charge (default: None).
x0 (np.ndarray, optional) – Initial parameter values (default: None).
- evaluate(x)[source]#
Evaluate the model with the given parameters and return the signal.
- Parameters:
x (np.ndarray) – Parameter values to evaluate the model at.
- Returns:
y – The model output y(t) simulated with inputs x.
- Return type:
np.ndarray
- get_current_state() pybop.models.base_model.TimeSeriesState[source]#
Returns the current state of the model.
- get_measure(x: pybop.models.base_model.TimeSeriesState) numpy.ndarray[source]#
- log_likelihood(values: dict, times: numpy.ndarray, inputs: pybop.models.base_model.Inputs) float[source]#
Returns the log likelihood of the model given the values and inputs.
- Parameters:
values (np.ndarray) – The values of the model.
times (np.ndarray) – The times at which to observe the model.
inputs (Inputs) – The inputs to the model.
- observe(time: float, value: numpy.ndarray | None = None) float[source]#
Predict the time series model until t = time and optionally observe the measurement value.
Returns the log likelihood of the model given the value and inputs. If no value is given, the log likelihood is 0.
The base observer does not perform any value observation and always returns 0.
- Parameters:
time (float) – The time of the new observation.
value (np.ndarray (optional)) – The new observation.