Giter VIP home page Giter VIP logo

Comments (4)

brianstock avatar brianstock commented on August 12, 2024

Yes. If you're running the GUI, the raw rjags output exists in the "mixsiar" environment. You can print it to the screen with:

mixsiar$jags.1

To output the pD by itself with:

mixsiar$jags.1$BUGSoutput$pD

from mixsiar.

robynpaice avatar robynpaice commented on August 12, 2024

The mixsiar$jags.1 command still gives summary statistics, can I access raw data for all iterations somehow to combine sources and determine the statistics myself?

from mixsiar.

brianstock avatar brianstock commented on August 12, 2024

mixsiar$jags.1 is the rjags object, which contains the MCMC chains. To access the MCMC chains (p.global, p.fac1, p.fac2, depending on the random/fixed effects you included), use:

attach.jags(mixsiar$jags.1)

Now if you type dim(p.global) you should see that p.global is a matrix, where the number of columns is n.sources, and the number of rows is chain.length*n.chains. Full chain for proportion source 2 (overall/global population):

p.global[,2]

If you have random/fixed effects in your model, you'll see that p.fac1 and p.fac2 are 3-D arrays, where the dimensions are chain.length*n.chains x factor level x source.

Full chain for proportion source 1, level 1 of factor 1 (Region 1 Deer in wolves ex):

p.fac1[,1,1]

Full chain for proportion source 3, level 8 of factor 2 (Pack 8 Salmon in wolves ex):

p.fac2[,8,3]

To confirm you understand the indexing correctly, quickly plot a histogram of the chain and compare it to the output plot, e.g.

hist(p.fac2[,8,3])

should match the blue curve in "posterior_density_diet_p_Pack 8.pdf".

from mixsiar.

robynpaice avatar robynpaice commented on August 12, 2024

Thank you very much Brian that worked perfectly.

from mixsiar.

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.