I’m trying to sample from the following banana shaped distribution using NUTS.
I’d appreciate it if you could guide me whether my Stan model is correct or not.
Here is the model information:
Given two correlated Gaussian random variables, u1 and u2 with zero mean, unit variance and correlation coefficient rho equal to 0.9, consider the following transformation:

x = u1* a
y = (u2/a)+b*(u1^2+a^2)
where a = 1.15 and b=0.5.

So, here is my Stan code:

data{
vector[2] mu;
matrix[2, 2] Sigma;
real a;
real b;

}
parameters {
vector[2] u;
}

transformed parameters {
real x = a* u[1];
real y = (u[2]/a)+b*(u[1]^2+a^2);
}

model {
u ~ multi_normal(mu, Sigma);
}

And the attached figure is the banana shaped dist. based on x and y coordinate.

I’m wondering if my model is correct or not.
I think i need to write the joint probability dist. of x and y, but i don’t know how i can code it in Stan.

You should move x and y to the generated quantities block. Other than that, your model is fine, although you don’t need Stan to draw from a multivariate normal and transform the result, and if you were to use Stan, it is better to use multi_normal_cholesky instead of multi_normal. Writing the model block in terms of x and y would require a Jacobian determinant, which is best avoided if possible, which is what you have done by putting the “prior” on the thing(s) declared in the parameters block.

I took a look at your paper and while I see the similarity in the figures I don’t see an exact correspondence with a specific figure. I see one candidate and the point patterns aren’t the same up to scaling AFAICT. Can you be more clear as to which figure you are suggesting?

Dear Krzysztof
the First picture of this post (which was not posted by a developer) is the “cropped version” of Figure 8 a) of the attached paper. The second clearly is not.
It is not a big deal, but we would like to see the proper reference to the original source… or at least being informed by its use

Hi Sakredja,
Of course. definitely.
I don’t know why i cannot edit my original post.
I didn’t expect it will be a big deal. Anyway, i refer it here:
Dear all,
The source of the original figure is from the following paper: https://arxiv.org/abs/1706.01435