Giter VIP home page Giter VIP logo

rethinking's People

Contributors

courtiol avatar jofam avatar nayyarv avatar noamross avatar

Watchers

 avatar

rethinking's Issues

Sample.naive.posterior doesn't work on lists of functions

It is currently advertised as a legacy function, but its functionality is broken. Specifially:

  • when using the default AICc, it gives an error as AICc() cannot be found
  • when using AIC, it returns columns filled with zero's
  • when using add.names = TRUE, it adds a column with NA values.

In my humble opinion, this function should simply go. @rmcelreath any remarks on this?

Roxygenize the documentation

In order to get rid of all the warnings in R CMD check, using roxygen will be a ton of help. So all help pages have to be converted to roxygen2 pages.

HPDI doesn't return a correct result when passed the result of extract.samples()

Trying the following code :

data(cars)
flist <- alist(
  dist ~ dnorm( mu , sigma ) ,
  mu <- a+b*speed ,
  c(a,b) ~ dnorm(0,1) , 
  sigma ~ dexp(1)
)

fit <- quap( flist , 
             start=list(a=40,b=0.1,sigma=20) , 
             data=cars )

samp <- extract.samples(fit, n = 100)
HPDI(samp)

gives :

> HPDI(samp)
    |0.89     0.89| 
-1.942856  2.685888 

Whereas one would expect :

> coda::HPDinterval(coda::as.mcmc(x), prob = 0.89)
          lower     upper
a     -1.724315  1.735476
b      2.721952  3.141751
sigma 12.080041 16.184893
attr(,"Probability")
[1] 0.89

This is due to the sapply() wrongly flattening the result returned by the coda code.

replace concat() with paste0()

There's no need for a concat() function when paste0 suffices. It's exactly that.
Contained in the file map2stan.templates. Used all over the place.

Clean up imports etc

There's a bunch of confusion around the depends, imports and calling non-exported functions from other packages. This needs to be cleaned up.

extract.samples needs correct S4 dispatching

The generic (in file map-quap-class.r actually calls class (instead of inherits), and contains quite a lot of code. This function definition should be the method for the specific classes (or at least for "ANY") and the generic turned into a standardGeneric.

Otherwise it won't survive code review by CRAN.

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.