Giter VIP home page Giter VIP logo

Comments (9)

bob-carpenter avatar bob-carpenter commented on June 7, 2024

from bayesplot.

betanalpha avatar betanalpha commented on June 7, 2024

from bayesplot.

wds15 avatar wds15 commented on June 7, 2024

Hi!

Ok, getting the bias is simple using what is there like this:

library(rstanarm)
alpha <- 1; beta <- c(-.5, .5); sigma <- 2
X <- matrix(rnorm(200), 100, 2)
y <- rnorm(100, mean = c(alpha + X %*% beta), sd = sigma)
fit <- stan_glm(y ~ X)
draws <- as.matrix(fit)
print(colnames(draws))
true <- c(alpha, beta, sigma)
mcmc_recover_intervals(draws, true)

draws_bias <- sweep(draws, 2, true)
mcmc_recover_intervals(draws_bias, rep(0, 4))

that gives me what I want for the bias. Let's see if I figure out the coverage. BTW, the package is awesome!

from bayesplot.

jgabry avatar jgabry commented on June 7, 2024

from bayesplot.

wds15 avatar wds15 commented on June 7, 2024

This is so simple that we could just include it as an example in the documentation maybe? What I have done is just a good use of what is there, so I am not sure if you really want to make this part of bayesplot as you need to maintain it. The gain of including it explicitly is that you encourage people to look at the their problems in this viewangle more likely as the option is more prominent. Up to you to decide.

from bayesplot.

jgabry avatar jgabry commented on June 7, 2024

from bayesplot.

wds15 avatar wds15 commented on June 7, 2024

So we got the bias in now which leaves the coverage. For that one would need multiple posteriors each coming from an independent fit of (usually) fake data. I am not sure of the "batch" concept is exactly that or is it?

from bayesplot.

jgabry avatar jgabry commented on June 7, 2024

from bayesplot.

wds15 avatar wds15 commented on June 7, 2024

I thought so. Should we then close this issue as it seems out of scope?

However, I do have to say that I have done such experiments, i.e. repeated fake-data simulations and then look at the coverage and correlation in the bias. Both of which were very interesting to learn about in the model as it did tell me a new aspect of my model how it performs under repetition. A correlated bias and the coverage is something one wants to know, I think; would be curious what others think. Possibly worth to discuss in a Stan meeting?

from bayesplot.

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.