[R] High Frequency Time Series

Adrian Trapletti adrian.trapletti at lmttrading.com
Wed Oct 2 09:28:26 CEST 2002


> Date: Tue, 1 Oct 2002 15:05:51 -0500 (CDT)
> From: Erin Hodgess <hodgess at uhddx01.dt.uh.edu>
> Subject: [R] High Frequency Time Series
>
> Dear R People:
>
> I have a weekly time series.  How do I put this into the
> ts command, please?
>
> That is, what do I use for frequency, please?
>
> R version 1.5.1 for Windows.
>
> Thanks in advance.
>
> Sincerely,
> Erin
> mailto: hodgess at uhddx01.dt.uh.edu

Dear Erin

>From the documentation of ts:

     The value of argument `frequency' is used when the series is
     sampled an integral number of times in each unit time interval.
     For example, one could use a value of `7' for `frequency' when the
     data are sampled daily, and the natural time period is a week, or
     `12' when the data are sampled monthly and the natural time period
     is a year.  Values of `4' and `12' are assumed in (e.g.) `print'
     methods to imply a quarterly and monthly series respectively.

Hence, the frequency is chosen according to the "natural time period". For a natural time period of one year, frequency = 52:

ts(data,start=c(start.year,start.week),frequency=52)

best
Adrian

--
Dr. Adrian Trapletti             Phone :             +41 (0) 1 994 5631
Trapletti Statistical Computing  Mobile:             +41 (0)76 370 5631
Wildsbergstrasse 31              Fax   :             +41 (0) 1 994 5633
CH-8610 Uster                    Email :  mailto:a.trapletti at bluewin.ch
Switzerland                      WWW   : http://trapletti.homelinux.com



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list