Source code for lv_sens.data
import numpy as np
from lv_sens.types import NDArray_f64
[docs]
def noisy_data(x: NDArray_f64, std_dev: float) -> NDArray_f64:
"""Generate noisy data.
Args:
x: state trajectory
std_dev: standard deviation for Gaussian noise
Returns:
noisy data trajectory
"""
xdata = x + std_dev * np.random.standard_normal(x.shape)
xdata[:, 0] = x[:, 0]
return xdata