##### Suppose we have three time delay estimates of a quad-lens system,
##### and one time delay estimate of a double-lens system.
time.delay.est <- c(-101, -91.7, -104.2, -18.8)
##### Each time delay estimate accompanies its one-sigma uncertainty (standard error)
time.delay.se <- c(4.4, 4.2, 4.1, 0.9)
##### The redshift of the deflector in the quad-lens system is 0.868,
##### and that in the double-lens system is 0.512.
z.d.obs <- c(0.868, 0.868, 0.868, 0.512)
##### The redshift of the source in the quad-lens system is 2.621,
##### and that in the double-lens system is 3.37.
z.s.obs <- c(2.621, 2.621, 2.621, 3.37)
##### Three Fermat potential difference estimates are obtained from a quad-lens syatem,
##### and one estimate is from the double-lens system.
fermat.diff.est <- c(-0.6395, -0.5734, -0.6431, -0.2625)
##### Each Fermat potential difference estimate accompanies
##### its one-sigma uncertainty (standard error).
fermat.diff.se <- c(0.0265, 0.0254, 0.0299, 0.0148)
#### Next, we make sure that each vector has the same length.
length(z.d.obs); length(z.s.obs); length(fermat.diff.est);
length(fermat.diff.se); length(time.delay.est); length(time.delay.se)
##### The following is an example code to obtain 10 posterior samples of the model parameters.
initial.values <- c(runif(1, 0, 150), runif(1, 0.05, 0.5), rcauchy(2, scale = 0.025))
res <- h0(TD.est = time.delay.est, TD.se = time.delay.se,
FPD.est = fermat.diff.est, FPD.se = fermat.diff.se,
z.d = z.d.obs, z.s = z.s.obs,
initial.param = initial.values,
sample.size = 10, burnin.size = 5)
Run the code above in your browser using DataLab