I am not an expert in time series (that is why I referred you to the task view 
rather than give my own inexpert opinion).  I do remember from a textbook that 
covered the basics of time series that prediction 2 time points ahead was 
different from plugging in the next time estimate and predicting one ahead.  
And basic theory of linear models also supports this.

The standard linear model assumes all x's to be fixed (or independent of each 
other if random) if you add a new x that is not independent and not fixed, then 
this does not hold.  There is also a whole area of linear models for what to do 
if x is not an exact value but measured with error (or predicted), another area 
that I know exists and is complicated, but which I have not studied beyond the 
basics.

Also the standard formula for prediction intervals has a piece to account for 
variability around the mean and another piece to account for the variability in 
the estimate of the mean due to the coefficients being estimates rather than 
known quantities, it only makes sense that there should be another piece to 
account for uncertainty due to the value of x in the prediction when it is not 
known.

The best I can recommend is look through the task view.  Maybe someone else has 
a better refrence.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111

From: Dave Evens [mailto:daveeve...@yahoo.co.uk]
Sent: Friday, June 17, 2011 1:48 AM
To: Greg Snow; r-help@r-project.org
Subject: Re: [R] prediction intervals

Thank you for your post Greg.
Do you have any useful references regarding this variability (papers etc)?

Many thanks.
Dave


From: Greg Snow <greg.s...@imail.org>
To: Dave Evens <daveeve...@yahoo.co.uk>; "r-help@r-project.org" 
<r-help@r-project.org>
Sent: Thursday, 16 June 2011, 21:32
Subject: RE: [R] prediction intervals

I don't think that this approach is appropriate here.  Each iteration after the 
1st the lm/predict combination will assume that the new data is exact when in 
fact it is an estimate with some error involved.  To properly do this you need 
to take into account that variability.  There is a time series task view on 
CRAN that may point you to better tools.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org<mailto:greg.s...@imail.org>
801.408.8111


> -----Original Message-----
> From: r-help-boun...@r-project.org<mailto:r-help-boun...@r-project.org> 
> [mailto:r-help-bounces@r-
> project.org] On Behalf Of Dave Evens
> Sent: Thursday, June 16, 2011 11:33 AM
> To: r-help@r-project.org<mailto:r-help@r-project.org>
> Subject: [R] prediction intervals
>
>
>
> Dear members,
>
> I'm fitting linear model using "lm" which has numerous auto-regressive
> terms as well as other explanatory variables. In order to calculate
> prediction intervals, i've used a for-loop as the auto-regressive
> parameters need to be updated each time so that a new forecast and
> corresponding prediction interval can be calculated.
>
> I'm fitting a number of these models which have different values for
> the response variable and possibly different explanatory variables. The
> response is temperature in fahrenheit (F), and the different models are
> for cities. So each city has its own fitted linear model for
> temperature. I'm assuming that they're independent models for the time
> being, I want to combine the results across all cities and have overall
> prediction intervals. Because I assuming that they're independent can I
> just add together the degrees of freedom from each model (i.e. total
> degrees of freedom=df1+df2+...) and the variance-covariance matrices
> (i.e. V=V1+V2+...) in order to calcalate the overall prediction
> intervals?
>
> Any help would be most appreciated.
>
> Regards,
> Dave
>     [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org<mailto:R-help@r-project.org> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-<http://www.r-project.org/posting->
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to