Git Product home page Git Product logo

ears-c1's Introduction

EARS-C1

Implementation of EARS-C1 algorithm in Julia. To run just include the function in your code:

#Setup in Julia
include("EARS_C1.jl")

and run the function over any list of cases observed at the same time step:

#Running in Julia
cases = [1,2,1,0,0,1,2,3,1,1,0,0,0,1,2,1,1,1,1,0,0,0,1,1]
detected = EARS_C1(cases, initial_date = 1)

You can also run the algorithm from R using JuliaCall:

#Setup in R
library(JuliaCall)
julia <- julia_setup()
julia_command('include("EARS_C1.jl")')

and then call the function:

cases    <- rpois(100,20)                #Simulate cases
julcases <- julia_eval("EARS_C1")(cases) #Evaluate function

The algorithm is faster than current implementation in the surveillance package:

library(surveillance)
library(microbenchmark)
#Comparación de tiempos
mb <- microbenchmark(
  cases    <- rpois(100, 20),
  julcases <- julia_eval("EARS_C1")(cases),
  surv     <- earsC(as(ts(cases, start = 1),"sts"), 
                    control = list(method = "C1", alpha = 0.05, baseline = 7, minSigma = 0)),
  times = 1000
)

With results 10 times faster:

expr min lq mean median uq max neval
cases <- rpois(100, 20) 12.356 18.329 24.32397 23.7460 26.8080 99.146 1000
julcases <- julia_eval("EARS_C1")(cases) 425.427 573.103 766.03114 654.5255 749.8775 53798.048 1000
surv <- earsC(as(ts(cases, start = 1), "sts"), control = list(method = "C1", alpha = 0.05, baseline = 7, minSigma = 0)) 4400.425 5103.316 6045.99175 5582.3825 6040.5920 45565.106 1000

ears-c1's People

Contributors

rodrigozepeda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.