Last data update: 2014.03.03

R: Simple Exponential Smoothing
SESR Documentation

Simple Exponential Smoothing

Description

Calculate simple exponential smoothing for a time series.

Usage

SES(ts, alpha = 0.5, s0 = NULL)

Arguments

ts

Observation series.

alpha

The smoothing parameter, 0 < alpha < 1 (default 0.5).

s0

Original estimate of s0 value.

Details

alpha = 2 / (n + 1) in n is moving periodic.

Value

Observation series after.

Note

Before, name of this function is TM.

Author(s)

Doan Hai Nghi <Hainghi1426262609121094@gmail.com>

Hong Viet Minh <hongvietminh@gmail.com>

References

https://www.otexts.org/fpp/7/1

See Also

CMA

Examples

SES(lh,alpha=0.5)
SES(lh,alpha=0.8)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AnalyzeTS)
Loading required package: MASS
Loading required package: TSA
Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-12. For overview type 'help("mgcv-package")'.
Loading required package: tseries

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

The following object is masked from 'package:utils':

    tar

Loading required package: TTR
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AnalyzeTS/SES.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SES
> ### Title: Simple Exponential Smoothing
> ### Aliases: SES
> ### Keywords: ~kwd1 ~kwd2
> 
> ### ** Examples
> 
> SES(lh,alpha=0.5)
 [1] 2.400000 2.400000 3.600000 3.900000 3.950000 3.875000 3.537500 3.631250
 [9] 3.953125 4.114062 3.994531 3.734766 3.542383 3.658691 3.666846 4.208423
[17] 4.879211 4.789606 4.369803 4.097401 3.873701 3.686850 3.580925 3.952963
[25] 4.526481 4.425741 4.012870 3.818935 4.209468 4.629734 4.627367 4.576183
[33] 4.375592 4.325296 4.325148 3.937574 3.568787 3.334393 3.129697 3.377348
[41] 4.288674 5.056837 5.340919 5.257959 4.866480 4.345740 4.672870 5.023935
> SES(lh,alpha=0.8)
 [1] 2.400000 2.400000 2.880000 2.956800 2.812160 2.695232 2.189446 2.705089
 [9] 2.845018 3.026604 2.670921 2.498184 2.303637 2.657527 2.429905 3.484381
[17] 3.754476 3.397295 2.905859 2.791572 2.532714 2.468943 2.378589 3.076518
[25] 3.492904 3.020981 2.656196 2.576839 3.283368 3.460674 3.328935 3.294587
[33] 2.969317 3.128263 3.015253 2.502251 2.297250 2.097050 1.969810 2.501962
[41] 3.597192 4.018638 4.101328 3.796266 3.319253 2.807051 3.728610 3.648922
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>