Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Выведите на один график исходный временной ряд и сглаженный временной ряд.
- На практике для выделения тренда часто применяется параметр α = 0.2. Подбирая нужные параметры
- α,β,γ можно добиться желаемого сглаживания.
- Проведите простое экспоненциальное сглаживание ряда rainseries с использованием функции
- HoltWinters() для разных значений параметр α (0,9; 0,8; 0,6). Выведите графики.
- link https://yadi.sk/d/528aAPrTfbOfsg
- */
- kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3)
- kings
- kingstimeseries <- ts(kings)
- kingstimeseries
- births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat")
- birthstimeseries <- ts(births, frequency=12, start=c(1946,1))
- birthstimeseries
- plot.ts(birthstimeseries)
- souvenir <- scan("http://robjhyndman.com/tsdldata/data/fancy.dat")
- souvenirtimeseries <- ts(souvenir, frequency=12, start=c(1987,1))
- souvenirtimeseries
- plot.ts(souvenirtimeseries)
- logsouvenirtimeseries <- log(souvenirtimeseries)
- plot.ts(logsouvenirtimeseries)
- plot.ts(birthstimeseries)
- birthstimeseriescomponents <- decompose(birthstimeseries)
- birthstimeseriescomponents$seasonal
- plot(birthstimeseriescomponents)
- birthstimeseriescomponents <- decompose(birthstimeseries)
- birthstimeseriesseasonallyadjusted <- birthstimeseries-birthstimeseriescomponents$seasonal
- plot(birthstimeseriesseasonallyadjusted)
- rain <- scan("http://robjhyndman.com/tsdldata/hurst/precip1.dat",skip=1)
- rainseries <- ts(rain,start=c(1813))
- plot.ts(rainseries)
- rainseriesforecasts <- HoltWinters(rainseries, beta=FALSE, gamma=FALSE)
- rainseriesforecasts
- rainseriesforecasts$fitted
- plot(rainseriesforecasts$fitted)
Add Comment
Please, Sign In to add comment