aboutsummaryrefslogtreecommitdiffstats
path: root/R/ema.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/ema.R')
-rw-r--r--R/ema.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/R/ema.R b/R/ema.R
new file mode 100644
index 00000000..b4af957e
--- /dev/null
+++ b/R/ema.R
@@ -0,0 +1,3 @@
+ ema<-function(x, beta = 0.1, init=x[1]){
+filter(beta*x,filter = 1-beta,method = "recursive", init= init)
+}