Bayesian Updating
Methods for Bayesian updating.
Index
UncertaintyQuantification.AbstractBayesianMethod
UncertaintyQuantification.AbstractBayesianPointEstimate
UncertaintyQuantification.MaximumAPosterioriBayesian
UncertaintyQuantification.MaximumLikelihoodBayesian
UncertaintyQuantification.SingleComponentMetropolisHastings
UncertaintyQuantification.TransitionalMarkovChainMonteCarlo
UncertaintyQuantification.bayesianupdating
Types
UncertaintyQuantification.AbstractBayesianMethod Type
AbstractBayesianMethod
Subtypes are used to dispatch to the differenct MCMC methods in bayesianupdating
.
Subtypes are:
UncertaintyQuantification.SingleComponentMetropolisHastings Type
SingleComponentMetropolisHastings(proposal, x0, n, burnin, islog)
Passed to bayesianupdating
to run the single-component Metropolis-Hastings algorithm starting from x0
with univariate proposal distibution proposal
. Will generate n
samples after performing burnin
steps of the Markov chain and discarding the samples. The flag islog
specifies whether the prior and likelihood functions passed to the bayesianupdating
method are already given as logarithms.
Alternative constructor
SingleComponentMetropolisHastings(proposal, x0, n, burnin) # `islog` = true
UncertaintyQuantification.TransitionalMarkovChainMonteCarlo Type
TransitionalMarkovChainMonteCarlo(prior, n, burnin, β, islog)
Passed to [`bayesianupdating`](@ref) to run thetransitional Markov chain Monte Carlo algorithm with [`RandomVariable'](@ref) vector `prior`. At each transitional level, one sample will be generated from `n` independent Markov chains after `burnin` steps have been discarded. The flag `islog` specifies whether the prior and likelihood functions passed to the [`bayesianupdating`](@ref) method are already given as logarithms.
Alternative constructors
TransitionalMarkovChainMonteCarlo(prior, n, burnin, β) # `islog` = true
TransitionalMarkovChainMonteCarlo(prior, n, burnin) # `β` = 0.2, `islog` = true
References
[23]
UncertaintyQuantification.AbstractBayesianPointEstimate Type
AbstractBayesianPointEstimate
Subtypes are used to dispatch to the differenct point estimation methods in bayesianupdating
.
Subtypes are:
UncertaintyQuantification.MaximumAPosterioriBayesian Type
MaximumAPosterioriBayesian(prior, optimmethod, x0; islog, lowerbounds, upperbounds)
Passed to bayesianupdating
to estimate one or more maxima of the posterior distribution starting from x0
. The optimization uses the method specified in optimmethod
. Will calculate one estimation per point in x0. The flag islog
specifies whether the prior and likelihood functions passed to the bayesianupdating
method are already given as logarithms. lowerbounds
and upperbounds
specify optimization intervals.
Alternative constructors
MaximumAPosterioriBayesian(prior, optimmethod, x0; islog) # `lowerbounds` = [-Inf], # `upperbounds` = [Inf]
MaximumAPosterioriBayesian(prior, optimmethod, x0) # `islog` = true
See also MaximumLikelihoodBayesian
, bayesianupdating
, TransitionalMarkovChainMonteCarlo
.
UncertaintyQuantification.MaximumLikelihoodBayesian Type
MaximumLikelihoodBayesian(prior, optimmethod, x0; islog, lowerbounds, upperbounds)
Passed to bayesianupdating
to estimate one or more maxima of the likelihood starting from x0
. The optimization uses the method specified in optimmethod
. Will calculate one estimation per point in x0. The flag islog
specifies whether the prior and likelihood functions passed to the bayesianupdating
method are already given as logarithms. lowerbounds
and upperbounds
specify optimization intervals.
Alternative constructors
MaximumLikelihoodBayesian(prior, optimmethod, x0; islog) # `lowerbounds` = [-Inf], # `upperbounds` = [Inf]
MaximumLikelihoodBayesian(prior, optimmethod, x0) # `islog` = true
Notes
The method uses prior
only as information on which parameters are supposed to be optimized. The prior itself does not influence the result of the maximum likelihood estimate and can be given as a dummy distribution. For example, if two parameters a
and b
are supposed to be optimized, the prior could look like this
prior = RandomVariable.(Uniform(0,1), [:a, :b])
See also MaximumAPosterioriBayesian
, bayesianupdating
, TransitionalMarkovChainMonteCarlo
.
Methods
UncertaintyQuantification.bayesianupdating Function
bayesianupdating(likelihood, models, pointestimate; prior)
Perform bayesian updating using the given likelihood
, models
and any point estimation method AbstractBayesianPointEstimate
.
Notes
Method can be called with an empty Vector of models, i.e.
bayesianupdating(likelihood, [], pointestimate)
If prior
is not given, the method will construct a prior distribution from the prior specified in AbstractBayesianPointEstimate.prior
.
likelihood
is a Julia function which must be defined in terms of a DataFrame
of samples, and must evaluate the likelihood for each row of the DataFrame
For example, a loglikelihood based on normal distribution using 'Data':
likelihood(df) = [sum(logpdf.(Normal.(df_i.x, 1), Data)) for df_i in eachrow(df)]
If a model evaluation is required to evaluate the likelihood, a vector of UQModel
s must be passed to bayesianupdating
. For example if the variable x
above is the output of a numerical model.
For a general overview of the function, see bayesianupdating
.
bayesianupdating(prior, likelihood, models, mcmc)
Perform bayesian updating using the given prior
, likelihood
, models
and any MCMC sampler AbstractBayesianMethod
.
Alternatively the method can be called without models
.
bayesianupdating(prior, likelihood, mcmc)
When using TransitionalMarkovChainMonteCarlo
the prior
can automatically be constructed.
bayesinupdating(likelihood, models, tmcmc)
bayesianupdating(likelihood, tmcmc)
Notes
likelihood
is a Julia function which must be defined in terms of a DataFrame
of samples, and must evaluate the likelihood for each row of the DataFrame
For example, a loglikelihood based on normal distribution using 'Data':
likelihood(df) = [sum(logpdf.(Normal.(df_i.x, 1), Data)) for df_i in eachrow(df)]
If a model evaluation is required to evaluate the likelihood, a vector of UQModel
s must be passed to bayesianupdating
. For example if the variable x
above is the output of a numerical model.