Dear Nik Try the following code
loo_predict.mu <- function(model.obj, input.data) { yhat <- foreach(i = 1 : nrow(input.data), .packages="gamlss", .combine = rbind) %dopar% { updated.model.obj <- update(model.obj, data = input.data[-i, ]) predict(updated.model.obj, what = "mu", data = input.data[-i, ], newdata = input.data[i,], type = "response") } return(data.frame(result = yhat[, 1], row.names = NULL)) } par.run <- loo_predict.mu(model3, input.processed.cut) The predict command in this case also need the old data. Thanks Mikis Prof Dimitrios Mikis Stasinopoulos stasi...@staff.londonmet.ac.uk [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.