// Line parameter prior assume intercept = tag("param", "intercept", normal(0,7)); assume slope = tag("param", "slope", normal(0,4)); // Hypothesized linear relationship assume line = proc(x) { slope * x + intercept }; // Prior for unknown noise level assume noise = tag("hyper", "noise", gamma(1, 1)); // Prior on the outlier rate assume outlier_prob = tag("hyper", "outlier_prob", uniform_continuous(0.01, 0.3)); // Per-point outlier check assume is_outlier = mem(proc(i) { tag("outlier", i, flip(outlier_prob)) }); // Full data model: linear relationship with additive noise of unknown // but consistent magnitude, plus outlier detection with a broad // Gaussian outlier model. assume obs = proc(i, x) { if (is_outlier(i)) { normal(0,20) } else { normal(line(x), noise) } };