Can someone please help me specify this STAN model tensorflow_probability?
Here N is 1000.
rv1 is a 1000 element vector drawn from an Normal distribution with mean=100.0 and sd = 10.0
rv2 is a 1000 element vector drawn from an Normal distribution with mean=200.0 and sd = 05.0
Specifically, I want to estimate the hyperparameters mean and sd of the two distributions given the random variates rv1, rv2.
functions{
}
data{
int N;
row_vector[N] rv1;
row_vector[N] rv2;
}
parameters{
real m1;
real <lower=0.001> s1;
real m2;
real <lower=0.001> s2;
row_vector[N] samp1;
row_vector[N] samp2;
}
transformed parameters{
real m1_t;
real m2_t;
real <lower=0.001> s1_t;
real <lower=0.001> s2_t;
m1_t = m1*1180.0;
m2_t = m2*2180.0;
s1_t = s1* 100.0;
s2_t = s2* 100.0;
}
model{
m1 ~ std_normal();
m2 ~ std_normal();
s1 ~ std_normal();
s2 ~ std_normal();
rv1 ~ normal(m1_t, s1_t);
rv2 ~ normal(m2_t, s2_t);
}
Thanks in advance!