Prometheus stddev of offsets

How would I get the standard deviation for previous 3 '1w' offsets?

In this example it can be done by create new offset metrics at scrape time.

offset_rate1h{offset="1w"} =   rate1h offset 1w
offset_rate1h{offset="2w"} =   rate1h offset 2w
offset_rate1h{offset="3w"} =   rate1h offset 3w

Than do this:

stddev without (offset) (offset_rate1h)

How would you accomplish this without having to create new variables?