aboutsummaryrefslogtreecommitdiffstats
path: root/ema.R
diff options
context:
space:
mode:
Diffstat (limited to 'ema.R')
-rw-r--r--ema.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/ema.R b/ema.R
new file mode 100644
index 00000000..b4af957e
--- /dev/null
+++ b/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)
+}