0
votes

suppose i use mgcv’s gam to predict with some newdata producing two outputs(say g1,g2) . How can ask gam.predict to return the covariance of the two predictions?

I would like to compute the confidence interval of f(g1,g2) for some f. Assuming two predictions follow bivariate normal , i could use the delta theorem to compute the confidence interval.

Or is there an alternative method to compute this?

1

1 Answers

0
votes

I am not really sure what you are asking, but if you need to calculate the covariance of any two data sets g1, g2 (independently if they are output of function gam.predict) you can simply use the function cov() after calling gam.predict, i.e., cov(g1,g2).