Skip to content
Prev 276784 / 398506 Next

window?

The problem is when I use the window function an try to extract a subset of
the time series an specify the frequency as 1 (not only will ets not take a
time series with a frequency greater than 24, now that I am taking a subset
there is no frequency so I would like to set it to 1 (which is one of the
arguments to the window function) but it does not produce what I expect.
That is the problem.  I fail to see the relationship of the discussion of
what frequency is and how to use the forecast package with this problem.

-----Original Message-----
From: Dennis Murphy [mailto:djmuser at gmail.com] 
Sent: Tuesday, November 08, 2011 6:20 PM
To: Kevin Burton
Cc: R. Michael Weylandt; r-help at r-project.org
Subject: Re: [R] window?

The ets() function in the forecast package requires either a numeric vector
or a Time-Series object (produced from ts()). The frequency argument in ts()
refers to the time duration between observations; e.g., frequency = 7 means
that the data are weekly; frequency = 12 means that the data are monthly;
frequency = 4 means that the data are quarterly. You can see this from the
examples on the help page of ts:
?ts at the R prompt.

The example associated with the forecast::ets() function uses the
USAccDeaths data:

data(USAccDeaths)
USAccDeaths   ## monthly data for six years
# Simulate the same structure with ts:
u <- ts(rnorm(72), start = c(1973, 1), frequency = 12) u

# Evidently you want to produce a multivariate series; # here's one way with
monthly frequency:
v <- ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v

Is that more or less what you were after?

Dennis

On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton <rkevinburton at charter.net>
wrote:
ts?