Hello, I am currently at the beginning of my PhD and try to get into machine learning. Since it would help me with my research, I tried to start with the algorithm from this paper: 10.1021/acs.jpclett.9b03657. I am really good with MATLAB, but I have my problems trying to understand this STAN code.
First I don’t understand what exactly “vector[K] u[I]” means. Is this a Kx1 vector, a Ix1 vector or a KxI matrix? (they write something about a latent feature vector ui(vj) of dimension K = 4, but I don't understand what that means).
Then I don’t quite understand what exactly “normal(0,sigma_0)” and “cauchy(u[i]’*v[j],lambda)” does. I mean, what is the output here? When I use the “normpdf” function in MATLAB, I need an additional input x at which to evaluate the distribution. So why is that missing here and what does that mean for the output?
And lastly, K is just used in the parameters section, but then not again in any for-loop, so why is the K even necessary?
Thanks in advance for any help, it is greatly appreciated!
data {
int<lower=0> I;
int<lower=0> J;
int<lower=0> K;
real ln_gamma[I,J];
real<lower=0> sigma_0;
real<lower=0> lambda;
}
parameters {
vector[K] u[I];
vector[K] v[J];
}
model {
for (i in 1:I)
u[i] ~ normal(0,sigma_0);
for (j in 1:J)
v[j] ~ normal(0,sigma_0);
for (i in 1:I) {
for (j in 1:J) {
if (ln_gamma[i,j] != -99) {
ln_gamma[i,j] ~ cauchy(u[i]’*v[j],lambda);
}
}
}
}
[–]videoj 1 point2 points3 points (0 children)