I have a data set including daily prices and demand of a commodity. I am sure that, price and demand weekly and monthly changing. So it has a seasonality effect. How can I decompose it by using daily data ?
My data looks like this ;
The row number is 335 . So the last date is 2016-11-30.
I will try to catch a relationship between price and demand. But, not to face with a spurious regression, I have to decompose it first. Using weekly and monthly dummies is an option, but I want to use stl() or decompose() functions, or another one maybe.
I start with : ts(data$Price, start=c(2016,1,1),frequency=365)
But that one also does not work! I couldn't achieve to transform it to timeseries data!
as.ts()
. The link below may help: anomaly.io/seasonal-trend-decomposition-in-r $\endgroup$