Code Monkey home page Code Monkey logo

statisticalrethinking's People

Contributors

karajan9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

orangebacked

statisticalrethinking's Issues

re 4.15 (https://github.com/karajan9/statisticalrethinking/blob/master/scripts/snippet_04_07.jl)

Might be worth noting that given how we're dealing with normals (linear transform of normals is also normal), another way to get the prior predictive distribution would be:

function sample_h(μ, σ, n=10_000)
  sample_μ = rand(μ, n)
  sample_σ = rand(σ, n)

  ppd = sample_μ + sample_σ.*randn(n)
end

The crucial line is the ppd line; I included the rest because I was worried about making typos if I changed it to your notation/nomenclature.

5.1 spurious_associations.jl, line 168

Hi @karajan9

You are definitely making nice progress with the scripts! And I like how you are approaching/programming it.

Maybe it is time to continue our earlier discussion about packaging all StatisticalRethinking stuff. A suggestion, if I recall the discussion well, would be to store common useful methods in StatisticalRethinking.jl. This package has no notion about Turing, Stan, etc. StatisticalRethinking.jl would would depend on DataFrames, CSV, BSplines, StatsPlots, etc. So it won't be lightweight.

The (your) Turing scripts would go into StatisticalRethinkingTuring.jl, all Stan related stuff would move to StatisticalRethinkingStan.jl. I would be pretty ok if the approaches in StatisticalRethinkingTuring.jl and StatsiticalRethinkingStan.jl are not identical, there are many roads to Rome.

Each of the mcmc-specific packages will also have a src directory, e.g. in Turing's case it would contain your current quap().
The ...Models.jl repositories would just contain the models. Functions like currently in your tools.jl would move to StatisticalRethinking.jl.

Please let me know what you think of such an approach. I also have a question about the current 5.1 spurious_associations script. Which version of DataFrames do you use to allow line 168? I need to update that line as shown below:

julia> a = [1, 2, 3];

julia> b = [6, 7, 8];

julia> df = DataFrame(;a, b)
ERROR: syntax: invalid keyword argument syntax "a"
Stacktrace:
 [1] top-level scope at REPL[20]:1

julia> df = DataFrame(;a=a, b=b)
3×2 DataFrame
│ Row │ a     │ b     │
│     │ Int64 │ Int64 │
├─────┼───────┼───────┤
│ 1   │ 1     │ 6     │
│ 2   │ 2     │ 7     │
│ 3   │ 3     │ 8     │

(StatReth) pkg> st DataFrames
Status `~/Projects/statisticalrethinking/Project.toml`
  [a93c6f00] DataFrames v0.21.4

Slowly I'm starting to see the light at the end of the StructuralCausalModels.jl tunnel which I hope to register over the the next couple of weeks. My guess is it will take quite some work to get it to the level of dagitty.net 3.0 but it might be better to publish now and to get feedback and input from others.

Best,
Rob

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.