data <- read.csv("H://day_shuaka.csv")
raw0 <- data[359:752,]
raw0$weekday <- as.factor(weekdays(as.Date(as.character(raw0$ds),"%Y%m%d")))
data1 <- raw0[1:365,]
data2 <- raw0[366:394,]
fit.lm <- lm(shuaka ~ weekday ,data1)
fit.lm.res <- residuals(fit.lm)
fit.lm.resreq <- ts(fit.lm.res, start=c(2017,1),frequency=365)
fit.ets <- ets(fit.lm.resreq, model='AAN')
fit.ets.fore <- forecast(fit.ets,29)
fit.ets.fore <- ts(round(c(fit.ets.fore$fitted, fit.ets.fore$mean),0),start=c(2017,1),frequency=365)
fit.ets.res<-fit.ets$residuals
fit.arima<-auto.arima(fit.ets.res)