This is not a question, but rather a suggestion. The osr command doesn’t work well when the loss function is rather small (which typically would be the case when you have a weighted average of variances for inflation and output), so something that helps is to multiply all the weights in the loss function by 100 or 1000 so that there are no numerical complications for optimization.