如何表示观察是两个采样值中较大的一个?

San*_*har 6 jags hierarchical-bayesian

我正在编写一个JAGS脚本(分层贝叶斯模型),其中事件的时间被建模为两个进程之间的竞争.

观察: time是事件的测量时间.

模型:具有高斯率的两个过程 - 无论哪个过程首先触发事件.

目标:估算两个过程的比率.

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!
  }
}
Run Code Online (Sandbox Code Playgroud)

问题:我如何指出时间是从两个比率中的较大者中采样的,每个比率是从不同的分布中采样的?

模拟time数据的示例直方图,使用mu1=3, mu2=3两个过程的不同标准偏差(固定为1和0.1)

在此输入图像描述