You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a mismatch in the stable states returned by the r_iterate_matrix and iterate_matrix functions if the loop runs to the final iteration. Not sure if current tests are ending the loop before niter, hence not erroring.
The (possible) issue arises when the while loop never breaks due to diff > tol, in which case the final iteration is (i < niter => i = niter - 1). This iteration increments i by 1, then stores the output to states[[i+1]]. So the final element of states is at niter + 1.
In fact, this should cause an issue in all cases, shouldn't it? I can't decipher the tf_extract_stable_distribution function so am not sure whether this pulls out the last or second-to-last iteration.
One difference is that the stable state will be normalised (to sum to 1), but the last nonzero element of all states isn't. Did you account for that?
Even if it's the penultimate state, the convergence criterion should mean it's the same as the ultimate one (when normalised, and to within the tolerance).
I think there is a mismatch in the stable states returned by the r_iterate_matrix and iterate_matrix functions if the loop runs to the final iteration. Not sure if current tests are ending the loop before niter, hence not erroring.
The (possible) issue arises when the while loop never breaks due to
diff > tol
, in which case the final iteration is (i < niter
=>i = niter - 1
). This iteration incrementsi
by 1, then stores the output tostates[[i+1]]
. So the final element of states is atniter + 1
.greta.dynamics/tests/testthat/helpers.R
Lines 23 to 25 in e89309d
But then the stable state is returned as
states[[i]]
, which isstates[[niter]]
in this case:greta.dynamics/tests/testthat/helpers.R
Line 32 in e89309d
Is this intentional? If not, I can prepare a PR. The same issue arises on the iterate_dynamic_matrix branch.
The text was updated successfully, but these errors were encountered: