data = {
const arr = new Array(T);
const arr2 = new Array(T);
const tstar = observations[0].x;
arr[tstar] = { x: tstar, y: observations[0].y, y2: observations[0].y };
for(let t = tstar - 1; t >= 0; t--) {
arr[t] = {
x: t,
y: arr[t + 1].y - logistic_rate(arr[t + 1].y, rate, asymptote_lower, asymptote_upper)
};
arr[t].y2 = arr[t].y;
}
for(let t = tstar + 1; t < T; t++) {
arr[t] = {
x: t,
y: arr[t - 1].y - logistic_rate(arr[t - 1].y, rate2, asymptote_lower2, asymptote_upper)
};
arr[t].y2 = arr[t - 1].y2 + logistic_rate(arr[t - 1].y2, rate, asymptote_lower, asymptote_upper);
}
return arr;
}