[R] function predict

J C Nash pro|jcn@@h @end|ng |rom gm@||@com
Thu Apr 4 04:13:03 CEST 2019


I was about to reply to the item with a similar msg as Bert, but then
realized that the students were pointing out that the function (possibly
less than perfectly documented -- I didn't check) only works for complete
years. I've encountered that issue myself when teaching forecasting. So
I was prepared to accept the item more as a feature request or at least
a documentation request.

It would, of course, be useful for both homework and research use to have
a function able to do partial year forecasts, and I suspect there is that
capability in R somewhere. I've built custom scripts for that, but more than
a decade and a half ago. It takes time and care.

JN

On 2019-04-03 3:57 p.m., Bert Gunter wrote:
> This list has *no homework* policy. I would assume that the purpose of your
> "project" is for you to learn how to deal with exactly the sorts of issues
> you describe.
> 
> (But you might get lucky with a response anyway).
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Wed, Apr 3, 2019 at 12:48 PM Michaela Berndl <michib567 using gmail.com> wrote:
> 
>> Dear Sir or Madam,
>>
>>
>>
>> we are statistic students at the Johannes Kepler University in Linz,
>> Austria.
>>
>> In a project we had to analyse the time series influenza from the package
>> tscount and make a prediction for one year. For the prediction we used the
>> function predict from the package raster.
>>
>> Since our data ends not at the end of a year, but at week 23 in the year
>> 2012, we need to predict till the 23th week of 2013.
>>
>>
>>
>> As identified in the Figure (boxplot of the original data) attached, in the
>> first months of
>>
>> every year the recorded cases were always higher than in the rest of the
>> year.
>>
>> The other figure shows the prediction with three models (the 3 colored
>> lines) from week 23 in the year 2012 to week 22 in the year 2013 and the
>> original data (the black line) for the same time. Due to the fact that the
>> the peaks of the prediction lines are not even close to the original data,
>> we are not sure whether the predict function is correct. We suspect that
>> the predict function just works for a prediction of exactly one year, which
>> starts at week 1 and ends at week 52.
>>
>>
>>
>>
>>
>> Kind regards,
>> Doris Kuttner, Michaela Berndl
>> ______________________________________________
>> R-help using 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.
>>
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using 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.
>



More information about the R-help mailing list