Draw pseudo-observations from predictive distribution. If pred contains draws from the component posterior (prior) distributions, then the output is draws from the posterior (prior) predictive distribution. If pred is not specified, then whether output draws are from prior or posterior predictive distribution depends on whether fit is created using the lgp option prior_only=TRUE or not.

draw_pred(fit, pred = NULL)



An object of class lgpfit that has been created using the lgp option sample_f=TRUE.


An object of class Prediction, containing draws of each model component. If NULL, this is obtained using get_pred(fit).


An array with shape \(S x P\), where \(S\) is the number of draws that pred contains and \(P\) is the length of each function draw. Each row \(s = 1, \ldots, S\) of the output is one vector drawn from the predictive distribution, given parameter draw \(s\).

See also

Other main functions: create_model(), get_draws(), lgp(), pred(), prior_pred(), sample_model()