I have a question regarding the use of an external function as policy rule. My basis model is a replication of Fernandez-Villaverde 2010 from the MMB which works very well. However, I want to replace the monetary policy rule by my own policy (matlab function), which has the from of a neural network. It requires outputgap and inflation as inputs and gives out the interest rate. Including the function in dynare works well, also the steady state file computes the steady state.

However when trying stochsimul, dynare can´t solve the model because the rank condition is not verified (10 Eigenvalues larger than 1 for 12 forward-looking variables) and Blanchard Kahn condition is not satisfied.

US_FV10 is the mod file using the respective steadystate file. The Matlab function is called Agent10 and needs the .mat file with the same name (all attached).

Warning: Variable ‘policy’ originally saved as a DAGNetwork cannot be instantiated as an object and will be read in
as a uint32.

so it seems some piece of code is missing
2. What you describe seems as if your new policy rule does not satisfy the Taylor principle. That looks like an economic problem, not a Dynare one.

The function file I used only produced the value of the function (=the Neural Net). I replaced it with a file containing the analytical equation itself and the Jacobian. I guess this is what dynare needs!?

yes, you are right. I do think the Taylor Principle holds, however I might have a conflict between the interest determined by my new policy and the model-specific interest. I will check on that and come back to this!
Cheers