How to indicate an observation is the larger of two sampled values?

99 Views Asked by At

I'm writing a JAGS script (hierarchical bayesian model) where the times of events are modelled as a race between two processes.

Observations: time is the measured times of events.

Model: two processes with gaussian rates - whichever process finishes first triggers the event.

Goal: Estimate the rates of the two processes.

model{
  # Priors
  mu1 ~ dnorm( 0,1 )                      # rate of one process
  mu2 ~ dnorm( 0,1 )                      # rate of other process
  sigma1 <- 1                             # variability in rate
  sigma2 <- 0.1                           # variability in rate

  # Observations
  for (i in 1:N)
    rate1[i] ~ dnorm( mu1, sigma1 )        # Sample the two
    rate2[i] ~ dnorm( mu2, sigma2 )        # racing processes.

    rmax[i] <- max( rate1[i], rate2[i] )  # which was faster?

    time[i] ~ 1/rmax[i]      #### This is wrong!
  }
}

Question: How can I indicate that the times are sampled from the larger of two rates, each of which is sampled from a different distribution?

Example histogram of simulated time data, using mu1=3, mu2=3 with different standard deviations for the two processes (fixed at 1 and 0.1)

enter image description here

0

There are 0 best solutions below