Nested Model: Likelihood and Fixed Point Equation

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).

Likelihood:
P(data|theta) = g(theta, v(theta); data)

(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.

Thank you very much for your help!

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.

It is in 2.17.x.

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?

Do you know any example(s) similar to this?

Thank you.

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.

Thank you both so much for your answers!

So far, only CmdStan 2.17 has been released—it has the new algebraic solver code. We’ll announce here when it’s available.