Vector pow(vector x, real y)

Is it possible to do pow(vector x, real y) to generate a vector output? Thank you.

Not yet. Just write the loop.

You’re able to do this in cmdstan and its interfaces (cmdstanR and cmdstanPy) via both the call to pow:

pow(vector x, real y)

And by using the new elementwise-power operator: .^

x .^ y
3 Likes