Method mfh/multinest
MULTINEST.M
multinest is a Bayesian inference tool which calculates the evidence and
explores the parameter space which may contain multiple posterior modes
and pronounced (curving) degeneracies in moderately high dimensions.
For more information about the algorithm see arXiv:0809.3437
CALL:
p = multinest(c, plist);
where p - pest object containing the results of the fit
c - a cost function. Must be a mfh object
plist - a given plist
USE OF PRIORS:
The prior should be a cell array with each cell containing five values:
prior = { parameter_name (string); prior_type (string); prior_specs, prior_behaviour (string)};
where
prior_type -> 'uniform', 'gaussian' of 'jeffreys'
prior_specs -> prior specifications: min val, max val, mean, sigma
prior_behaviour -> 'reflect' - if the parameters reflect off the boundaries
'cyclic' - if the parameter space is cyclic
'fixed' - if the parameters have fixed boundaries
'' - for gaussian priors
e.g., prior = {'h0', 'uniform', 0, 1, 'reflect';
'r', 'gaussian', 0, 5, '';
'phi', 'uniform', 0, 2*pi, 'cyclic'};
EXAMPLE:
% Create some data and make a data set to fit
fs = 1;
nsecs = 2e3;
B1 = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', nsecs, 'yunits', 'T'));
B2 = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', nsecs, 'yunits', 'T'));
B3 = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', nsecs, 'yunits', 'T'));
n = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', nsecs, 'yunits', 'm'));
% Noise of the experiment
n_exp = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', 10*nsecs, 'yunits', 'm'));
% Combination parameters
c = [ao(1,plist('yunits','m/T')) ao(2,plist('yunits','m/T')) ao(3,plist('yunits','m T^-1'))];
% Define here the data to fit
y = c(1)*B1 + c(2)*B2 + c(3)*B3 + n;
y.simplifyYunits;
% Get a fit for c with a linear fitter
p_s = lscov(B1, B2, B3, y);
p_s.setName('lscov');
% do linear combination: using lincom
yfit = lincom(B1, B2, B3, p_s);
yfit.simplifyYunits;
% Create a MFH model of the above data analysis
mdl = mfh(plist(...
'name', 'temp',...
'built-in', 'custom',...
'numeric', true,...
'params', p_s,...
'func', 'C1.*B1 + C2.*B2 + C3.*B3',...
'constants', {'B1','B2','B3'},...
'constant objects', {B1,B2,B3}));
% Define a log-Likelihood function
llh = mfh(plist('built-in', 'loglikelihood', ...
'version', 'td core',...
'name', 'Gaussian td',...
'model', mdl,...
'data', y,...
'p0', p_s));
llh.setName('LLH');
%% Run multinest
% Define the prior
prior = {'C1', 'uniform', -1, 3, 'fixed'; ...
'C2', 'uniform', 0, 5, 'fixed'; ...
'C3', 'uniform', 1, 8, 'fixed'};
p = multinest(llh, plist('p0', p_s,...
'Nlive', 300, ...
'prior', prior));
% Plot the parameter PDFs
p.mcmcPlot(plist('chains',0,'plot fit curves',0,'nbins',60,...
'burnin',2, 'pdfs', true,'hist type', 'stairs', ...
'plot cumsum',0,'plotmatrix',true))
% Compare
table(p_s, p)
This function is an LTPDA wrapper of the Matlab version of the multinest
algorithm. The original functions are copied here verbatim, apart from
minor changes needed to support the LTPDA environment. The original code
is available here:
https://ccpforge.cse.rl.ac.uk/gf/project/multinest/
https://github.com/mattpitkin/matlabmultinest
Copyright (C) 2012 Matthew Pitkin & Joseph Romano
Translation to LTPDA by NK 2017
Method Details |
|
Access |
public |
Defining Class |
mfh |
Sealed |
0 |
Static |
0 |
Parameter Description
Sets for this method … |
Default |
Default |
no description |
Key |
Default Value |
Options |
Description |
multinest |
P0 |
[] |
none |
A pest object containing information about the parameters (parameter names and units). |
VERBOSE |
1 |
|
True-False flag for printing information on screen. |
DEBUG |
0 |
|
True-False flag for debuging purposes. |
NLIVE |
[] |
none |
The number of live points for the Nested Sampling algorithm |
TOL |
0.001 |
none |
The tolerance value for the stoping criteria |
PRIOR |
'' |
none |
The prior densities of the parameters. See example for usage. Currently only handles Gaussian and Uniform priors. |
EXTRAPARAMS |
'' |
none |
TBD |
OTHER OPTIONS |
{} [0x0] |
none |
A cell array of other specialised options to be passed to the algorithm. For more information check the Matlab Multinest examples. |
Example |
plist('P0', [[]], 'VERBOSE', [true], 'DEBUG', [false], 'NLIVE', [[]], 'TOL', [0.001], 'PRIOR', '', 'EXTRAPARAMS', '', 'OTHER OPTIONS', cell(0,0)) |
back to top
Some information of the method mfh/multinest are listed below: |
Class name |
mfh |
Method name |
multinest |
Category |
Signal Processing |
Package name |
ltpda |
Can be used as modifier |
1 |
Supported numeric types |
{'double'} |
|
Method: mfh/loglikelihood |
|
Method: mfh/paramCovMat |
 |
©LTP Team