interpolated_rate()
SELECT
id,
bucket,
interpolated_rate(
summary,
bucket,
'15 min',
LAG(summary) OVER (PARTITION BY id ORDER by bucket),
LEAD(summary) OVER (PARTITION BY id ORDER by bucket)
)
SELECT
id,
time_bucket('15 min'::interval, ts) AS bucket,
counter_agg(ts, val) AS summary
FROM foo
GROUP BY id, time_bucket('15 min'::interval, ts)
) t