Giter Club home page Giter Club logo

Comments (7)

tbreloff avatar tbreloff commented on May 23, 2024

Actually is there a bug here? https://github.com/joshday/OnlineStats.jl/blob/master/src/summary.jl#L65

from onlinestats.jl.

tbreloff avatar tbreloff commented on May 23, 2024

It works ok for EqualWeight but ExponentialWeight is completely wrong.

from onlinestats.jl.

tbreloff avatar tbreloff commented on May 23, 2024

Here's a simple example:

julia> x = randn(100);

julia> var(x)
1.162888972180564

julia> v = Variance()
▌ Variance 
  ▶     value: -0.0
  ▶      nobs: 0

julia> fit!(v, x); v
▌ Variance 
  ▶     value: 1.1628889721805642
  ▶      nobs: 100


julia> v = Variance(ExponentialWeight(10))
▌ Variance 
  ▶     value: -0.0
  ▶      nobs: 0


julia> fit!(v, x); v
▌ Variance 
  ▶     value: -1.976802951354775e189
  ▶      nobs: 100

from onlinestats.jl.

joshday avatar joshday commented on May 23, 2024

That is quite the bug! I'll take a look.

from onlinestats.jl.

joshday avatar joshday commented on May 23, 2024

var(o::Variance) now behaves a bit better:

julia> xvar = Float64[(fit!(v, xi); std(v)) for xi in x]
100-element Array{Float64,1}:
 0.0
 0.03677
 0.265324
 0.537096
...

In my rewrite, I apparently missed a method for ExponentialWeight(minstep::Integer), so your example was using a nonsensical weight of 10 for each update. This has been fixed.

julia> x = randn(100);

julia> v = Variance(ExponentialWeight(20));

julia> fit!(v, x); v
▌ Variance
  ▶     value: 0.9294099372585689
  ▶      nobs: 100

The line you pointed out comes straight from Knuth's Art of Computer Programming, but I'm not sure it's correct for non-EqualWeight updates. I'll leave this open while I look into it.

from onlinestats.jl.

joshday avatar joshday commented on May 23, 2024

http://www-uxsup.csx.cam.ac.uk/~fanf2/hermes/doc/antiforgery/stats.pdf confirms the update is the same for ExponentialWeight (see equation 142, equation 143 has a typo).

from onlinestats.jl.

tbreloff avatar tbreloff commented on May 23, 2024

Great thanks for following up!

On Sat, Feb 13, 2016 at 3:42 PM, Josh Day [email protected] wrote:

Closed #51 #51.


Reply to this email directly or view it on GitHub
#51 (comment).

from onlinestats.jl.

Related Issues (20)

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.