I am trying to analyze and forecast the European Emission Allowance (EUA) prices by using the data from January 2008 to March, 2016 and also using other series that might be related to that price, as Brent or IBEX35 prices (I will use correlations or divergences between those series).
The problem is that, in my case, I do not know how to modify the frequency correctly when using the ‘ts’ function on my series because I have taken the data from investing.com and sendeco2.com and the time frequency they use is just everyday the stock market opens, so ‘365’ should not be the correct frequency value… I have checked how many values I have for each year and the results are:
-2008: 252 values -2009: 250 values -2010: 252 values -2011: 249 values -2012: 254 values -2013: 254 values -2014: 255 values -2015: 254 values -2016 (March): 105 values
It means that my series are irregular. What i do is to store each series (EUA, Brent…etc) to a vector (total length of 2125 for each one) and I work with those variables:
BDD<-read.csv('BDD.csv',colClasses=c("Date","numeric","numeric","numeric","numeric"), header=TRUE, sep=";") Date <- BDD[1:nrow(BDD),1]; EUA <- BDD[1:nrow(BDD),2]; Brent <- BDD[1:nrow(BDD),3]; IBEX35 <- BDD[1:nrow(BDD),4]; PME <- BDD[1:nrow(BDD),5];
I have also tested with freq=1 (but it is obviously a mistake because they are not yearly values) and i got this error:
> EUA_ts<-ts(EUA, frequency=1, start=c(2008,1), end=c(2016,3)) > EUA_decomp<-decompose(EUA_ts, type=c("additive")) Error in decompose(EUA_ts, type = c("additive")) : time series has no or less than 2 periods
Is there another possibility to decompose a series? Am I doing something wrong?
I have uploaded my database in Drive to bring out more detail, if necessary: https://drive.google.com/open?id=0B7nP03_LfDvQZS1WNUdqbWM1X1U