Slove a integral equation in STAN

I need to solve an integral equation, the integral is:

For example, I need the value of theta if the result of the integral is 0.6. How can I implement this in STAN ?

that should be attackable with the algebra solver in Stan… @charlesm93 ?

@wds15 is correct. Stan’s algebraic solver should be able to handle this. You need to specify an algebraic equation of the form

f(\theta) = 0

So if I understand you correctly,

f(\theta) = 1 + 4 \frac{\frac{1}{\theta} \int_0^\theta \frac{x}{e^x - 1} dx}{\theta} - 0.6.

The ODE solver should be able to handle the integral in the nominator, with the integrand providing the R.H.S of the differential equation – you’ll need to work out the initial condition, which should be feasible with a tool like wolfram mathematica. Alternatively, if \theta is a scalar, you might try the 1D integrator.

1 Like