PostgreSQL Query

Job ID: 31131736

Budget: $30 – $250 USD

I would like to represent the value shift on the timeseries as on the picture in the form of time-weighted average.
There are 3 columns in the table.

1. Vector -> X axis
2. Magic number -> Y axis
3. Time (time shift represents different colours)


I would like to create a solution preferably in the postgres/timescaledb that it would provide continues/timeseries value change of (both X and Y axis).

The correlation between X and Y should look at the 2 closest match vectors below 0 (Magic number) and 2 closest points above 0 from the wide range of vectors. (Total 4 reference vector points)

My assumptions to solve it (could be inaccurate/not sure)
Is to calculate the area below the curve of 4 Vector points and average that over time in 5 min buckets. Or create time-weighted average from with a time shift (timescaledb)
Related categories: Python PostgreSQL