How to add inequality constraint on the model


#1

sigma
as
para
mu and alpha are parameters.
How to implement this inequaliity constrait in Stan?
so that mu1alpha1>0 and mu2alpha2>0
Thank you very much.
with regards


#2
parameters {
  real mu_1;
  real<lower=0> mu_1_alpha_1;
}
transformed parameters {
  real sigma_1 = mu_1_alpha_1 / mu_1;
}

#3

Thank you very much!
what is sigma_1?
should i do something like this?
‘parameters {’
‘vector[4]p;’
‘real<lower=0> mu_1_alpha_1= p[1]*p[2] ;’
‘real<lower=0> mu_2_alpha_2= p[3]*p[4] ;’
‘}’
p is the vector of paramters. p[1]=mu_1,p[2]=alpha_1,p[3]=mu_2,p[4]=alpha_2
Thank you very much!
with best regards


#4

Yeah, by sigma_1 I meant alpha_1.


#5

This is brilliant! Thank you very much!