# NOT RUN {
data(tempanomalies)
x <- tempanomalies$Year
y <- tempanomalies$AnnualAnomaly
stmoe <- emStMoE(X = x, Y = y, K = 2, p = 1, threshold = 1e-4, verbose = TRUE)
# stmoe is a ModelSTMoE object. It contains some methods such as 'summary' and 'plot'
stmoe$summary()
stmoe$plot()
# stmoe has also two fields, stat and param which are reference classes as well
# Log-likelihood:
stmoe$stat$loglik
# Parameters of the polynomial regressions:
stmoe$param$beta
# }
Run the code above in your browser using DataLab