I have a function that returns me a PMatrix. But sometimes that matrix is full with nan's. The cause is known, but the best solution I found is to allow the function to compute such kind of "nan" matrices and to replace that "NaN matrix in the end by the identity matrix.
This is my actual code that works fine, uptill now.
I find this code clumsy and would prefer a more straight forward code saying:
But I can't figure out how to compose such a straight forward code. Does anyone has a suggestion for me?