Coder Social home page Coder Social logo

bayesian-dm-code-examples's Introduction

Bayesian-DM-code-examples

BDM Code examples from Win/OpenBUGS, Nimble, CARBayes and INLA This repository is intended as an open source for code examples from a range of packages that fit hierarchical Bayesian models to small area health data. The examples represent a range of applications: spatial; Spatio-temporal; multivariate, multi-scale. Also they represnt a range of packages: MCMC -based packages such as Win/OpenBUGS, CARBayes, Nimble; and LAplace approximation via INLA.

Win/OpenBUGS:

Georgia_multiscale_WBugs.txt; Georgia_MVCAR_WBugs.txt; map_modelWB_pred.txt; R2WB_runfile_pred.txt; Ohio_resp_cancer_ST_Knorr_Held_model_WBugs.txt; Georgia_oral_cancer 2004_Convolution_Wbugs.txt

CARBayes:

carbayes_lipcancer_SCcongen90.txt; SCcongen90_CARBayesRcode

Nimble:

SC_congen_90_CONV_Nimble.txt; SC_congen90_lognormal_Nimble.txt; Gamma_Poisson_toy_data_Nimble.txt; STinT_models_Ohio_Nimble.txt; Georgia_MultiScale_CONV_Nimble.txt;

INLA:

SCcongen_INLA_models.txt; SCcongen_INLA_models_plusBYM.txt; FMD_INLA_ST_Rcode.txt; OHIO_STmapping_INLA_RcodeFAL

bayesian-dm-code-examples's People

Contributors

andrew9lawson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bayesian-dm-code-examples's Issues

The problem of binomial distribution modeling

Hi, excuse me. I have met some problems in learning spatio-temporal modeling by INLA.
My data includes year, the total number of trials(N), number of successes, number of failures, rate of success, longitude, latitude, and independent variable (water). as shown in the following figure.

屏幕截图 2021-06-12 124111

I want to predict the rate of success in each region, Here is my code, but occured an error.

## Formula
myformula <- cbind(success,failure) ~ -1+Intercept+water
  f(spatial.field,
    model = myspde,
    group = spatial.field.group,
    control.group = list(model = "ar1",
                         hyper = myrho_hyper))

myoutput<-inla(myformula,
               data=inla.stack.data(mystack,spde=myspde,
                                    family="binomial(link=logit)"),
               control.predictor = list(A=inla.stack.A(mystack),
                                        compute=TRUE))

##Error in inla(myformula, data = inla.stack.data(mystack, spde = myspde, :
dim(y...orig)[2] == 1 is not TRUE
In addition, I'm confused that you just use count as the dependent variable, does that satisfy the binomial distribution?
Looking forward to your reply. Thank you!
sincerely,
Sue

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.