Dear Stan Forum users, I would like to know if there is a way for Stan to estimate the following nested model. Also, if there is a similar type of problems that are doable in Stan, please let me know.

(1) The likelihood depends on the parameter of interest (say theta), but also on a function of theta, v(theta).

(2) For a given theta, the function v( ) is the solution to a fixed point problem in a functional space.

Fixed Point Equation:
v = f(v; theta)

I have R codes that can conduct the second part (i.e. the codes can solve the fixed point equation given theta). My question is if it is possible for us to feed Stan v(theta)'s that are only numerically available from the R codes.

I don’t think it’s possible to feed Stan anything here, but I do think it will soon be possible to use the algebraic solvers (a new feature in Stan) to solve for v(theta) numerically. Someone else will have to pitch in on when that feature is available in release. I saw announcements about some significant progress on that feature recently.

Thank you so much @dlakelan and @bgoodri for your replies. Is the 2.17.x. version already available?

Sorry if this was a naive question, but how can I tell Stan to solve the fixed point equation using the algebraic solver at each parameter value (i.e. at each iteration) in MCMC? In other words, in which section (the data, the model, or the parameter section) do I need to specify the algebraic solver?

Either transformed parameters or model depending on whether you want to save the solution in the output. There is an example in chapter 20 of the manual.

2.17.x is not on CRAN yet or the like. I think you have to pull a developer version from github for the moment. https://github.com/stan-dev

Not sure what the release plan is but I’m hoping it’s soonish. Perhaps you can start by grabbing the developer release of the manual, though it looks like there’s no build process that produces pdfs on the github site, so you’d have to pull the source from the stan repository and run LaTeX on it.