0

I’m trying to fit an image of (matrix of NxN) dimension, but I don’t figure out how to do it. I suppose that my model has to be a y ~multi_normal (mu, Sigma) with mu a vector of values mu_x and mu_y and Sigma a cov matrix.

I’m writing a simple Stan code, but i don’t know how to introduce the image to the multi_normal. An example of data could be:

np.array([[1 4  7 6],
[2 11 9 4],
[3 6  9 4],
[1 2  3 1]])

This code is bad but how can I implement it?

data {
 int<lower=0> n; #dimensions of gaussian
 int<lower=0> N; #dimensions of the image
 matrix[N,N] x; #image

}
parameters {
 vector[2] mu;
 matrix <lower=0> cov;
}
model {
 y ~ multi_normal( mu, cov);
 mu ~ normal(0., 100.); #prior
 cov ~ cauchy(0., 100.);
Antonio
  • 1
  • 2

0 Answers0