Squash trends to known boundaries
Test with Dummy Data¶
N = 700
t = torch.arange(N)
trend = 0.05*t + 0.1
trend[t>350] = -0.1*(t[t>350] - 350) + trend[t==350]
noise = torch.randn(trend.shape)
y = trend + noise
s = Squasher(-5, 10)
plt.plot(t, y, label='observed')
plt.plot(t, trend, label='actual')
plt.plot(t, s(y), label='squashed')
plt.legend()
plt.show()