I would like to revive this topic: Instead of 2 ordered parameters a and b, I have an array of ordered vectors:
data{
int<lower=2> total_sample_size;
simplex[3] pop_sizes_proportion;
}
parameters{
vector<lower=0>[3] deltas;
real<lower=0.0> time1;
real<lower=(time1*pop_sizes_proportion[1]/pop_sizes_proportion[N])> time2;
real<lower=(time2*pop_sizes_proportion[2]/pop_sizes_proportion[N])> oldest_time;
positive_ordered[total_sample_size-1] event_times_in_oldest_population_time_scale[3];
}
Here, each deltas is drawn from the same prior distribution, time1 is drawn from a custom distribution given deltas[1]
, time2
is drawn from the same custom distribution given deltas[2]
and oldest_time is drawn from the same costum distribution given deltas[3]
.
The times time1
, time2
, oldest_time
are in different time scale, but when transformed in the same time scale(the time scale of the oldest population) must be ordered:
time1*pop_sizes_proportion[1]/pop_sizes_proportion[N]< time2*pop_sizes_proportion[2]/pop_sizes_proportion[N]< oldest_time
The parameter: oldest_time
have a lower constraint but not a upper constraint:
real<lower=(time2*pop_sizes_proportion[1]/pop_sizes_proportion[N])> oldest_time;
The parameter time2
has lower and upper constraint but the upper constraint is based on the NEXT defined parameter oldest_time
.
First question: How to impose constraints on intermediate times like time2
?(considering also that they have a prior distribution conditional of deltas).(should I truncate the conditional distribution using [a,b] ?)
Now I have an array of vector of positive ordered events times: event_times_in_oldest_population_time_scale
.
event_times_in_oldest_population_time_scale[1]
correspond to ordered event times for population 1,
event_times_in_oldest_population_time_scale[2]
correspond to ordered event times for population 2, and
event_times_in_oldest_population_time_scale[3]
correspond to ordered event times for population 3.
(all those times are in the in oldest population time scale)
The event_times_in_oldest_population_time_scale[1]
have to be lower than or equal to time1*pop_sizes_proportion[1]/pop_sizes_proportion[N]`.
The event_times_in_oldest_population_time_scale[2]
have to be lower than or equal to time2*pop_sizes_proportion[2]/pop_sizes_proportion[N]
.
The event_times_in_oldest_population_time_scale[3]
have to be lower than or equal to oldest_time*pop_sizes_proportion[N]/pop_sizes_proportion[N]= oldest_time
.
Second question:
How should I include the upper constraints on the array of positive ordered vectors: event_times_in_oldest_population_time_scale
?
EDIT: @maxbiostat has painstakingly edited this post for readability and syntax highlighting.