Giter Club home page Giter Club logo

rstansim's People

Contributors

ewan-keith avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

guhjy

rstansim's Issues

Compatibility with upcoming major update to loo package

Hi @Ewan-Keith, as I mentioned in the email I sent a while back we will be releasing a major update to the loo package (this week I hope) and I wanted to follow up and give you a bit more detail specific to your package. In order to accommodate some new features, the structure of the object returned by loo() is changing slightly. In your case I think you only need to make a few small tweaks to rstansim.

The new loo objects will have a component estimates which is a matrix from which you can pull the required info. For example, if loo_obj is the result from a call to loo then loo_obj$estimates will be a matrix like this:

           Estimate       SE
elpd_loo -83.614057 4.289943
p_loo      3.353629 1.159908
looic    167.228115 8.579885

So in your fit_models-utilities file, you can replace these lines

loo_params <-
c("elpd_loo",
"se_elpd_loo",
"p_loo",
"se_p_loo",
"looic",
"se_looic")
loo_value <- as.vector(loo_1[loo_params], "numeric")
loo_output <- data.frame(
"parameter" = c(rep("elpd_loo", 2),
rep("p_loo", 2),
rep("looic", 2)),
"estimate" = c("estimate", "se"),
"value" = loo_value
)

with something like this:

    loo_est_matrix <- loo_1$estimates
    loo_output <- data.frame(
      parameter = rep(rownames(loo_est_matrix), 2),
      estimate = rep(c("estimate", "se"), each = 3),
      value = c(loo_est_matrix)
    )

I think that's basically all you need to do, unless there are other files in the package that also compute loo, in which case the same thing applies.

I will send a follow-up email once the loo update is on CRAN but until then you can install it from the master branch at stan-dev/loo if you want to test.

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.