The R Project SVN R

Rev

Rev 59629 | Rev 65999 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59629 Rev 61433
Line 28... Line 28...
28
\details{
28
\details{
29
  The additive model used is:
29
  The additive model used is:
30
  \deqn{Y_t = T_t + S_t + e_t}{Y[t] = T[t] + S[t] + e[t]}
30
  \deqn{Y_t = T_t + S_t + e_t}{Y[t] = T[t] + S[t] + e[t]}
31
  The multiplicative model used is:
31
  The multiplicative model used is:
32
  \deqn{Y_t = T_t\,S_t\, e_t}{Y[t] = T[t] * S[t] * e[t]}
32
  \deqn{Y_t = T_t\,S_t\, e_t}{Y[t] = T[t] * S[t] * e[t]}
33
  
33
 
34
  The function first determines the trend component using a moving
34
  The function first determines the trend component using a moving
35
  average (if \code{filter} is \code{NULL}, a symmetric window with
35
  average (if \code{filter} is \code{NULL}, a symmetric window with
36
  equal weights is used), and removes it from the time series.  Then,
36
  equal weights is used), and removes it from the time series.  Then,
37
  the seasonal figure is computed by averaging, for each time unit, over
37
  the seasonal figure is computed by averaging, for each time unit, over
38
  all periods.  The seasonal figure is then centered.   Finally, the error
38
  all periods.  The seasonal figure is then centered.   Finally, the error
Line 71... Line 71...
71
m <- decompose(co2)
71
m <- decompose(co2)
72
m$figure
72
m$figure
73
plot(m)
73
plot(m)
74
 
74
 
75
## example taken from Kendall/Stuart
75
## example taken from Kendall/Stuart
76
x <- c(-50, 175, 149, 214, 247, 237, 225, 329, 729, 809, 
76
x <- c(-50, 175, 149, 214, 247, 237, 225, 329, 729, 809,
77
       530, 489, 540, 457, 195, 176, 337, 239, 128, 102, 232, 429, 3, 
77
       530, 489, 540, 457, 195, 176, 337, 239, 128, 102, 232, 429, 3,
78
       98, 43, -141, -77, -13, 125, 361, -45, 184)
78
       98, 43, -141, -77, -13, 125, 361, -45, 184)
79
x <- ts(x, start = c(1951, 1), end = c(1958, 4), frequency = 4)
79
x <- ts(x, start = c(1951, 1), end = c(1958, 4), frequency = 4)
80
m <- decompose(x)
80
m <- decompose(x)
81
## seasonal figure: 6.25, 8.62, -8.84, -6.03
81
## seasonal figure: 6.25, 8.62, -8.84, -6.03
82
round(decompose(x)$figure / 10, 2)
82
round(decompose(x)$figure / 10, 2)