Displaying 1 result from an estimated 1 matches for "figure_alt".
2012 Jun 15
0
decomposing decompose(), issue?
...easonal factor for each month
periods <- l%/%f
index <- c(0, cumsum(rep(f, periods - 2)))
figure <- numeric(f)
for (i in 1L:f) figure[i] <- mean(season[index + i])
# Neutrality adjustment
figure <- figure/mean(figure)
# Here's an alternate method of calculating the monthly mean
figure_alt <- numeric(f)
for(i in 1L:f) figure_alt[i] <- mean((x/trend)[cycle(x)==i],na.rm=T)
figure_alt <- figure_alt/mean(figure_alt)
# For comparison
decompose(x,"multiplicative")$seasonal[1:12]
figure
figure_alt
Have I missed something fundamental, or is this a problem?
Peter