Coder Social home page Coder Social logo

Comments (9)

TankredO avatar TankredO commented on August 20, 2024

6a21143
ca095a3

from bayesiantools.

florianhartig avatar florianhartig commented on August 20, 2024

Hi Tankred,

is this tested and fully functional?

from bayesiantools.

florianhartig avatar florianhartig commented on August 20, 2024

Unit tests added?

from bayesiantools.

TankredO avatar TankredO commented on August 20, 2024

Tests will be added today.

from bayesiantools.

stefan-paul avatar stefan-paul commented on August 20, 2024

I get an error if I try to use the getSample function for coda objects.
At least for coda objects created by the runMCMC function (which shouldn't
be different from any other coda mcmc objects).

# Create setup
ll <- function(x) sum(dnorm(x, log = T))
setup <- createBayesianSetup(ll, lower = c(-10), upper = c(10))
settings <- list(iterations = 1000, adapt = F, optimize = F)

# Run sampler
out <- runMCMC(setup, sampler = "Metropolis", settings = settings)

# Get sample
sam <- getSample(out$codaChain)

Produces:

Error in getSample.matrix(as.matrix(sampler), parametersOnly = parametersOnly,  : 
  object 'includesProbabilities' not found 

Defining an boolean object 'includesProbabilities' in the global workspace solves the
issue but I guess it should work without doing so.

For coda::mcmc.list objects I get:

Error in data[[1]] : object of type 'closure' is not subsettable

Also documentation of the new functionality is missing.

from bayesiantools.

TankredO avatar TankredO commented on August 20, 2024

Seems like I introduced this error in 5ea3310. The problem is that the methods have different signatures (which they must not have according to cran) and I didn't realize that. I will sort that out as soon as possible.

from bayesiantools.

TankredO avatar TankredO commented on August 20, 2024

bf7f4da
should be solved. Documentation is another issue, the "old" methods (getSample.Matrix / getSample.MCMCSampler ....) do not have an own description, so i did not know if that is desired.

from bayesiantools.

stefan-paul avatar stefan-paul commented on August 20, 2024

Yes, it works now (again). Thanks for the fix!
In the description I'd just add that the argument 'sampler' can also
be a coda object.

from bayesiantools.

TankredO avatar TankredO commented on August 20, 2024

a35eee6

from bayesiantools.

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.