Creates an observation functor that randomly selects from a set of observation schemes for each observation. This models heterogeneous monitoring environments where different units are observed differently.
Value
A function with signature function(t_true) returning a list
from one of the constituent schemes, selected randomly according to
weights.
Examples
obs <- observe_mixture(
observe_right_censor(tau = 100),
observe_left_censor(tau = 50),
weights = c(0.7, 0.3)
)
set.seed(42)
obs(30) # randomly selects one of the two schemes
#> $t
#> [1] 50
#>
#> $omega
#> [1] "left"
#>
#> $t_upper
#> [1] NA
#>