Setting up Turing.jl model for an astrophysics problem

Hi guys,

I’m new to using Julia and Turing.jl. A friend recommended I ask about this here.
I’m trying to model the dispersion of the stellar orbits around the supermassive black hole at the center of the Milky Way.
I’m not quite sure how to set up Turing for this kind of inference, and I didn’t see any similar examples in the docs.

Here is a schematic Turing model for what I’m trying to do. Could you please tell me if there’s something evidently wrong, or if I’m totally off-base, if there’s a better way to about it?

@model toymodel(data1, data1error, data2, data2error) = begin
    # Priors for the parameter we want to constrain
    A ~ Uniform(1.0,2.0)
    #Our model does a forward prediction of the mean of the 
    #distribution of some_function_of(nuisance2).
    #We don't know the standard deviation, but we intend to margnialize over it.
    predicted_mean = markovian_model_prediction(A, nuisance1)
    some_function_of(nuisance2) ~ LogNormal(predicted_mean, unknown_std)

    # Introducing the statistical error asociated with each measured parameter.
    N = length(data2)
    for i in 1:N
        data2[i] ~ Normal(nuisance2[i], data2error[i])
        data1[i] ~ Normal(nuisance1[i], data1error[i])


Hi @majoburo !
I am happy to have read your post although I do not have the answer. I work in a very close topic to yours as shown here. Also, I have began a related project in Julia using differential equations and optimizations. I am interested in your project so, if you want to join forces, please contact me at my email:
All the best.

Can you tell us a little more about what’s going on here? Where do nuisance1 and nuisance2 come from? Are they sampled parameters that will be declared in your model?