View source: R/TestFunctions.R
valueTest_SDDR | R Documentation |
Performs a hypothesis test of whether a single parameter, P
, has a given value, with the value chosen with testVal
. Uses the Savage-Dickey density ratio.
valueTest_SDDR(prior, posterior, testVal, pKept = 0.96, bounds = TRUE)
prior |
A vector of samples from the prior of the parameter. |
posterior |
A vector of samples from the posterior of the parameter. |
testVal |
The value that will be tested. The null hypothesis is that |
pKept |
The proportion of the prior and posterior distributions that will be kept. The rest will be discarded from the tails. |
bounds |
If |
This function assumes that the prior and posterior are both unbounded and potentially diffuse. To account for diffuse priors, it truncates both the prior and posterior in some way. By default, it keeps some proportion of the prior and posterior, which is set by the pKept
argument. You use some combination of the pKept
and bounds
arguments to set the bounds.
A list with several elements:
success
: Whether density estimation was successful. If FALSE
, all of the other values will be NA
or NULL
.
bf10
: The Bayes factor in favor of the hypothesis that P == testVal
.
bf01
: The Bayes factor in favor of the hypothesis that P =/= testVal
.
prior_pKept
: The actual proportion of the prior that was kept. Should usually be equal to pKept
.
post_pKept
: The actual proportion of the posterior that was kept. Should usually be equal to pKept
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.