# NOT RUN {
# Sample a Gaussian mixture with components given by Z_potts
# mean values are 0, 1 and 2 and a linear effect on the x-axis.
# }
# NOT RUN {
set.seed(2)
Y <- Z_potts + rnorm(length(Z_potts), sd = 0.4) +
(row(Z_potts) - mean(row(Z_potts)))*0.01
# Check what the data looks like
cplot(Y)
fixed <- polynomial_2d(c(1,0), dim(Y))
fit <- fit_ghm(Y, mrfi = mrfi(1), theta = theta_potts, fixed_fn = fixed)
fit$par
cplot(fit$fixed)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab