likelihood | R Documentation |
Prior density, likelihood, posterior density, and marginal likelihood
functions for the posterior distributions specified through a
bspec
object.
dprior(x, ...) likelihood(x, ...) marglikelihood(x, ...) dposterior(x, ...) ## S3 method for class 'bspec' dprior(x, theta, two.sided=x$two.sided, log=FALSE, ...) ## S3 method for class 'bspec' likelihood(x, theta, two.sided=x$two.sided, log=FALSE, ...) ## S3 method for class 'bspec' marglikelihood(x, log=FALSE, ...) ## S3 method for class 'bspec' dposterior(x, theta, two.sided=x$two.sided, log=FALSE, ...)
x |
a |
theta |
a |
two.sided |
a |
log |
a |
... |
currently unused. |
Prior and posterior are both scaled inverse chi-squared distributions, and the likelihood is Normal.
A numeric
function value.
Christian Roever, christian.roever@med.uni-goettingen.de
Roever, C., Meyer, R., Christensen, N. Modelling coloured residual noise in gravitational-wave signal processing. Classical and Quantum Gravity, 28(1):015010, 2011. doi: 10.1088/0264-9381/28/1/015010. See also arXiv preprint 0804.3853.
bspec
,
quantile.bspec
,
expectation
lhspec <- bspec(lh, priordf=1, priorscale=0.6) # draw sample from posterior: posteriorsample <- sample(lhspec) # plot the sample: plot(lhspec) lines(lhspec$freq, posteriorsample, type="b", col="red") # compute prior, likelihood, posterior: print(c("prior" = dprior(lhspec, posteriorsample), "likelihood" = likelihood(lhspec, posteriorsample), "posterior" = dposterior(lhspec, posteriorsample), "marginal likelihood"= marglikelihood(lhspec)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.