Closed bschneidr closed 1 week ago
Thanks for pointing this out. It does actually return the values if you assign it, e.g. ac <- autocorrelation(x)
works fine. But yeah you're right that the assignment as the final line of the function code will result in it not printing anything.
The function
autocorrelation()
doesn't return any values, unlike the functionautocovariance()
. Below is a reprex:Created on 2024-09-27 with reprex v2.1.1
This is because the
autocorrelation()
function ends with an assignment, and doesn't end withreturn()
or by printing an object.https://github.com/stan-dev/posterior/blob/20b6d3aad2d15e398dbf86787da01843f824df7f/R/convergence.R#L610