function predict

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

function predict

Michaela Berndl
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

______________________________________________
[hidden email] 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.

prediction.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: function predict

Bert Gunter-2
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 <[hidden email]> 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
> ______________________________________________
> [hidden email] 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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: function predict

J C Nash
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 <[hidden email]> 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
>> ______________________________________________
>> [hidden email] 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]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.