[R] using deltat parameter in time series in HoltWinters prediction

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jan 7 14:34:53 CET 2012


On 07/01/2012 13:18, Antonio Tirri wrote:
> Excuseme Prof Ripley, but on the help page of ts() there is written:
> ||
>
> "deltat = the fraction of the sampling period between successive
> observations; e.g., 1/12 for monthly data. Only one of frequency or
> deltat should be provided."
>
> I have a collection of bitrate values over a link and the distance in
> time between two successive observations is 0.05 sec. How set correctly
> deltat parmeter? I thought it was the number of observations in a year.

And what did your statistics advisor say?  The problem is your 
understanding of the words 'sampling period'.

> Thanks a lot.
>
>
> On 7 January 2012 13:28, Prof Brian Ripley <ripley at stats.ox.ac.uk
> <mailto:ripley at stats.ox.ac.uk>> wrote:
>
>     Do check the help page for ts.  You are trying to fit a seasonal
>     model with a period of about 600 million observations.  I don't know
>     what seasonality you are actually trying to model, but it cannot be
>     yearly for data of that frequency (and you would need several years
>     of data).
>
>     This is not an R issue, so please discuss with your statistics
>     advisor what you are really trying to do.
>
>
>     On 07/01/2012 10:47, Antonio Tirri wrote:
>
>         Hi.
>         I have to forecast a time series of a Internet network traffic
>         bitrate.
>         The data are in file
>         http://www.forumaltavilla.it/__joomla/datitesi/dati.datand
>         <http://www.forumaltavilla.it/joomla/datitesi/dati.datand> the
>         sampling
>
>         time is every 0.05 seconds.
>         Now, i want to use HoltWinters forecasting. This is my script.
>
>         dt=1.58443823e-9 #0.05 seconds in years
>         dati.ts=ts(scan("dati.dat"),__start=0,deltat=dt)
>         model=HoltWinters(dati.ts)
>         dati.forecast=forecast(model,__h=100)
>         plot(dati.forecast)
>
>         When I type the command
>
>         model=HoltWinters(dati.ts)
>
>         R gives me the error
>         "Error in NextMethod("[") : cannot allocate vector of length
>         1262277040"
>
>         even if I take a shorter dati.dat (50 samples) i get the same error.
>
>         If i set deltat=1, the error after HoltWinters command is:
>         "Error in decompose(ts(x[1L:wind], start = start(x), frequency = f),
>         seasonal) :
>            time series has no or less than 2 periods"
>
>         How can I solve my problem?
>         Thanks
>
>                 [[alternative HTML version deleted]]
>
>         ________________________________________________
>         R-help at r-project.org <mailto:R-help at r-project.org> mailing list
>         https://stat.ethz.ch/mailman/__listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>         PLEASE do read the posting guide
>         http://www.R-project.org/__posting-guide.html
>         <http://www.R-project.org/posting-guide.html>
>         and provide commented, minimal, self-contained, reproducible code.
>
>
>
>     --
>     Brian D. Ripley, ripley at stats.ox.ac.uk <mailto:ripley at stats.ox.ac.uk>
>     Professor of Applied Statistics,
>     http://www.stats.ox.ac.uk/~__ripley/
>     <http://www.stats.ox.ac.uk/%7Eripley/>
>     University of Oxford,             Tel: +44 1865 272861
>     <tel:%2B44%201865%20272861> (self)
>     1 South Parks Road, +44 1865 272866 <tel:%2B44%201865%20272866> (PA)
>     Oxford OX1 3TG, UK                Fax: +44 1865 272595
>     <tel:%2B44%201865%20272595>
>
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list