Comments (3)
Hi Adam,
The posterior densities are probability distributions for the proportion of each source. The values of the y-axis cannot be interpreted as probabilities--probabilities are measured over intervals by taking the integral (area under the curve). So yes, if the curve is higher there, then more area will be under the curve nearby. Yes, you're right that the width of the distributions are used to calculate the quantiles. The 95% credible interval is the middle portion of the distribution, with 2.5% of the area to the left and 2.5% of the area to the right.
Short answer: The y-axis units are pretty much meaningless in both scaled and unscaled plots. I scaled the posterior densities because in some situations the y-axis would be very high for one source (ex. when one source is known to be close to 0, the y-axis can be very high), and you couldn't see the other sources well. The scaled posterior densities are no longer true probability distributions, because they don't integrate to 1. But visually they are the same, in that 95% of the area under the curve shows you 95% probability.
To demonstrate, let's say we just fit the Wolves example in MixSIAR.
In the summary statistics, we see the following line for Region 2 Deer:
p.Region 2.Deer 0.594 0.083 0.431 0.457 0.540 0.594 0.651 0.727 0.753
Above, the 2.5% and 97.5% quantiles are given as 0.431
and 0.753
. We can report the median as 0.59 with a 95% CI of (0.43, 0.75). The MCMC chain for Region 2 Deer diet proportion is mixsiar$jags.1$p.fac1[,2,1]
, and we can calculate the 95% CI limits with:
attach.jags(mixsiar$jags.1) # attach.jags(jags.1) if using mixsiar_script.r
median(p.fac1[,2,1])
quantile(p.fac1[,2,1],.025)
quantile(p.fac1[,2,1],.975)
If you wanted the probability that the Region 2 Deer diet proportion is greater than 0.7:
# Total num draws
(tot <- length(p.fac1[,2,1]))
# Num draws above 0.7
(above <- length(which(p.fac1[,2,1]>0.7)))
# Prob that the diet proportion is above 70%
(prob <- above/tot)
Or maybe we want the probability that Pack 4 eats more Deer than Pack 7:
Mean SD 2.5% 5% 25% 50% 75% 95% 97.5%
p.Pack 4.Deer 0.466 0.051 0.362 0.379 0.435 0.469 0.503 0.543 0.555
p.Pack 7.Deer 0.369 0.046 0.266 0.284 0.342 0.374 0.401 0.432 0.442
prob.Deer.Pack4.Pack7 <- sum(p.fac2[,4,1] > p.fac2[,7,1])/dim(p.fac2)[1]
> prob.Deer.Pack4.Pack7
[1] 0.938
We can also get a complete posterior probability for the difference between Pack 4 and Pack 7 (i.e. is Pack4 - Pack7 greater than 0?)
p.Deer.Pack4.Pack7 <- p.fac2[,4,1] - p.fac2[,7,1]
hist(p.Deer.Pack4.Pack7,breaks=50,col="grey")
abline(v=0,col="red",lty=2,lwd=3)
See also: http://www.sumsar.net/blog/2014/10/probable-points-and-credible-intervals-part-one/
from mixsiar.
Thanks for the quick reply Brian. That was extremely helpful.
-Adam
On Mon, Mar 2, 2015 at 2:46 PM, Brian Stock [email protected]
wrote:
β
Reply to this email directly or view it on GitHub
#21 (comment).
from mixsiar.
Hi, I am trying to do this (MixSIAR v. 3.1.10.9000) but the console just says "could not find function "attach.jags"" and then the rest won't work. Or am I missing an additional package? or something else? Thanks in advance for your answer!
from mixsiar.
Related Issues (20)
- Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace βrlangβ 1.0.1 is already loaded, but >= 1.0.2 is required
- What does the epsilon values mean? How to interpret? HOT 4
- Isospace plot seems to plot incorrect values HOT 5
- IsoSpace plot data labels too far from the data points HOT 4
- "plot_intervals" scale problem HOT 7
- "output_stats" function no longer works? HOT 10
- 'Extreme' version of MixSiar model produces an error.
- Error when running output_JAGS HOT 1
- Error in load_source_data: sources for each level do not match
- Error Running the Jags model
- Error in UseMethod and Error in grid.Call.graphics HOT 3
- Can we use only 3 food sources in MixSIAR? If less than 5 sources, I get an error message when loading the source file. HOT 9
- Is it possible to have a different number of sources in different regions? HOT 1
- Can we include different sample sizes for each isotope in the source file?
- Problem installing GUI HOT 1
- "incorrect number of dimensions" error when running output_JAGS HOT 1
- How do you add more models to jags.mod without running every model over each time? HOT 1
- Modify output posterior continuous effect
- ILR slope terms are inconsistent with ggplot visual output HOT 1
- Warning message concerning deprecation of `..scaled..`, to use 'after_stat(scaled)' instead.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mixsiar.