Hello dev-team and fellow nimble-users,
I've recently been working with a Bayesian population model involving the "classical" approach of calculating growth rates and stable age distributions via eigen analysis of a projection matrix.
It seemed like a perfect scenario to work with nimbleFunctions, and I successfully wrote a function for building the projection matrix ('make.sealPM' in attached code).
The function works as it should, but nimble spams the following warning messages whenever it is used:
"Run-time warning: matrix used in call to nimEigen() has a complex eigenvalue."
"Run-time warning: matrix matrix used in call to nimEigen() has a complex valued
eigenvector."
Is there a way to turn these off?
When written directly into the MCMC model, the eigen cacluations worked fine, presumably because nimble converts the complex numbers into real ones at some point.
Ideally though, I'd write the eigen calculations as nimbleFunctions as well (to give a bit more flexibility and account for the possibility that the dominant eigenvalue may not always have the same index).
Unfortunately, my attempt to do that did not go as well, again because of the complex numbers. So far, it looks to me like there is no nimble equivalent of R's "Re()" function (which extracts the real part of a complex number), but maybe I have misse something?
I am attaching an example to re-create/illustrate the issue. Any tips/suggestions welcome.
Thank you!