Skip to content

time series analysis for a time series without a regular frequency

3 messages · Erin Hestir, Gabor Grothendieck, Achim Zeileis

#
The zoo package supports irregularly spaced time series and if your
create a zoo object z from your data then tt <- as.ts(z) will give you
a ts object, tt.  Since a ts object must be regularly spaced this will
add NAs to ensure that it is.
On Fri, Jan 8, 2010 at 3:05 PM, Erin Hestir <elhestir at ucdavis.edu> wrote:
#
On Fri, 8 Jan 2010, Erin Hestir wrote:

            
As Gabor already pointed out: the zoo package can be used to store such 
data.

If you want to use the strucchange package for detecting changes then you 
can do two things:
   -  use a plain data.frame (without ts or some other time
      series class) which can be easily produced via
      as.data.frame(zoo_obj).
      Then the axis annotation in graphics won't be the time axis but
      the standard unit interval (= proportion of data). This is not so
      pretty but all statistical interpretations are still correct.
   - If zoo_obj is just a univariate series and you want to conduct a
     CUSUM test for a change in the mean you can do
       cus <- gefp(zoo_obj ~ 1)
       plot(cus)
       plot(cus, functional = meanL2BB)
     and so on. gefp() is the only function in strucchange that
     automatically supports "zoo".

hth,
Z