# How to bootstrap prediction intervals for “customized” regression models in R

Are there functions in R that could help me do the following?

We have a special type of regression which is called Geometric Mean Regression.

We have done some search and found the following:

https://stat.ethz.ch/pipermail/r-help/2011-July/285022.html

The question is: how to do the statistical inference on GMR results?

More specifically, we are looking for the prediction interval:

Lets say we regress y1, y2, ..., yn onto x1, x2, ..., xn:

we would like to know what's the prediction interval for a new data point:

x_new=x1+x2+x3

(i.e. the new data point is the sum of the existing first three data points)

In ordinary linear regression, we could derive prediction interval for an in-sample data point as well as a new data point...

For our x_new=x1+x2+x3, we can derive formulas for the prediction interval.

But for the above customized regression,

how do we obtain the prediction intervals?

Are there functions in R that can help us do this?

We are thinking of using bootstrapping, etc. Are there functions in R help us on this?

Thanks a lot!

I did some googling and researching... Reading the following article,

http://www.ecd.bnl.gov/pubs/BNL-79819-2008-JA.pdf

It seems that once we estimate the parameters of the bivariate normal distribution,

then we can plug into the formula of conditional distribution of Y|X=x1+x2+x3 ?

http://en.wikipedia.org/wiki/Multivariate_normal_distribution

My question is:

Is it a correct procedure to do the following:

Step 1: estimate the parameters of the bivariate normal distribution; Step 2: plug the estimated parameters into the Y|X=x1+x2+x3 formula and get the 95% quantile of it?

Do I need to repeat Step 2 many times following the bootstrapping procedure?

Or one shot of Step 2 is enough?

I got very much confused...

Any thoughts?

Thanks a lot!

-
Just to clarify: the implicit model for "GMR" is that the dataset $\{(x_i,y_i)\}$ consists of iid draws from some unknown bivariate (normal) distribution. By "prediction interval," then, are you asking about making inferences about the conditional distribution of $Y$ given $X=x_1+x_2+x_3$? –  whuber Apr 11 '12 at 15:06
Hi whuber, I am a bit confused by what you said. Usually when we do "prediction interval", we do xnew=data.frame(x=newdata); predict.lm(mymodel, newdata=xnew, interval="prediction")... However, since my "new data" is not a usual one, it's Xnew=x1+x2+x3 i.e. the sum of the first 3 in-sample data-points, I found that I cannot blindly throw the Xnew into the "predict.lm" function in R; instead, I derived my own formulas for the prediction bands by modifying the derivation of usual prediction bands for usual data...Does that answer your question? –  Luna Apr 11 '12 at 15:11
It sheds some light on my question, but does not answer it, Luna. It suggests you should research the probability models and assumptions underlying GMR and lm, because they are different: it is inconsistent (and wrong) to apply GMR and then try to use it as if it were lm output. GMR is not some alternative computational method to lm: it does a different analysis altogether and its estimates mean something altogether different than those produced by lm. –  whuber Apr 11 '12 at 15:18
No we haven't mix GMR and LM... the answer I gave above was all about lm... and now we would like to explore GMR... but then the problem is how to obtain the prediction interval. Thanks whuber! –  Luna Apr 11 '12 at 15:27
okay now I understand your question. Thank you! Yes, by using GMR, we take the view that X and Y are jointly-distributed. Then the similar concept to "prediction interval" in LM should be the one you've mentioned... It makes sense. Any thoughts on how to obtain the 95% "prediction interval" under this new view? Thank you! –  Luna Apr 11 '12 at 15:47
show 1 more comment