This analysis tries to use Rssa package for SSA analsysis using my data. There are following steps that need to be considered: * Monte-carlo method for calculating the surrogate * Different window length * Different method
data2007 <- read.csv(file = 'newdata2007.csv', header = TRUE, sep = ",")
ts.07 <- ts(data = data2007$t.ave, start = c(1960,1), end = c(2015, 365), frequency = 365)
t.mean = mean(ts.07, na.rm = TRUE)
ts.07.ano = ts.07 - t.mean
data2011 <- read.csv(file = 'newdata2011.csv', header = TRUE, sep = ",")
ts.11 <- ts(data = data2011$t.ave, start = c(1960,1), end = c(2015, 365), frequency = 365)
t.mean = mean(ts.11, na.rm = TRUE)
ts.11.ano = ts.11 - t.mean
data2012 <- read.csv(file = 'newdata2013.csv', header = TRUE, sep = ",")
ts.12 <- ts(data = data2012$t.ave, start = c(1960,1), end = c(2015, 365), frequency = 365)
t.mean = mean(ts.12, na.rm = TRUE)
ts.12.ano = ts.12 - t.mean
data2015 <- read.csv(file = 'newdata2015-1.csv', header = TRUE, sep = ",")
ts.15 <- ts(data = data2015$t.ave, start = c(1960,1), end = c(2015, 365), frequency = 365)
t.mean = mean(ts.15, na.rm = TRUE)
ts.15.ano = ts.15 - t.mean
data2015.2 <- read.csv(file = 'newdata2015-2.csv', header = TRUE, sep = ",")
ts.15.2 <- ts(data = data2015.2$t.ave, start = c(1960,1), end = c(2015, 365), frequency = 365)
t.mean = mean(ts.15.2, na.rm = TRUE)
ts.15.2.ano = ts.15.2 - t.mean
library(Rssa)
ts.07.ano.ssa = ssa(ts.07.ano, L = 365*2 )
## Warning in ssa(ts.07.ano, L = 365 * 2): Some field elements were not
## covered by shaped window. 2966 elements will be ommited
ts.11.ano.ssa = ssa(ts.11.ano, L = 365*2 )
ts.12.ano.ssa = ssa(ts.12.ano, L = 365*2 )
## Warning in ssa(ts.12.ano, L = 365 * 2): Some field elements were not
## covered by shaped window. 600 elements will be ommited
ts.15.ano.ssa = ssa(ts.15.ano, L = 365*2 )
## Warning in ssa(ts.15.ano, L = 365 * 2): Some field elements were not
## covered by shaped window. 7418 elements will be ommited
ts.15.2.ano.ssa = ssa(ts.15.2.ano, L = 365*2 )
plot(ts.07.ano.ssa, type = "values")
plot(ts.11.ano.ssa, type = "values")
plot(ts.12.ano.ssa, type = "values")
plot(ts.15.ano.ssa, type = "values")
plot(ts.15.2.ano.ssa, type = "values")
library(Rssa)
ts.07.ano.ssa = ssa(ts.07.ano, L = 365*2 )
## Warning in ssa(ts.07.ano, L = 365 * 2): Some field elements were not
## covered by shaped window. 2966 elements will be ommited
ts.07.ano.ssa1 = ssa(ts.07.ano, L = 365)
## Warning in ssa(ts.07.ano, L = 365): Some field elements were not covered by
## shaped window. 1812 elements will be ommited
plot(ts.07.ano.ssa$sigma, pch = 17, col = "red")
points(ts.07.ano.ssa1$sigma, pch = 18, col = "blue")
ts.07.ssa = ssa(ts.07, L = 365*2)
## Warning in ssa(ts.07, L = 365 * 2): Some field elements were not covered by
## shaped window. 2966 elements will be ommited
plot(ts.07.ssa, "series", groups = 1:20)
plot(ts.07.ano.ssa, "series", groups = 1:20)
ts.07.ano.ssa.eigen = ssa(ts.07.ano, L = 365*2, svd.method = "eigen")
## Warning in ssa(ts.07.ano, L = 365 * 2, svd.method = "eigen"): Some field
## elements were not covered by shaped window. 2966 elements will be ommited
plot(ts.07.ano.ssa, "series", groups = 1:20)
plot(ts.07.ano.ssa.eigen, "series", groups = 1:20)
Other datasets have no problem with it
ts.11.ano.ssa2 = ssa(ts.11.ano, L = 365*14)
plot(ts.11.ano.ssa, "values")
plot(ts.11.ano.ssa2, "values")