Method matrix/mcmc


  MCMC estimates paramters using a Monte Carlo Markov Chain.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  DESCRIPTION: MCMC estimate the parameters of a given model given
               inputs, outputs and noise using a Metropolis algorithm.
 
  CALL:        [b smplr] = mcmc(out,pl)
 
  INPUTS:      out     -  matrix objects with measured outputs
               pl      -  parameter list
 
  OUTPUTS:     b   - pest object contatining estimate information
               smplr - matrix containing info about the rejected points
 
  Parameters Description
 
  References:  M Nofrarias et al. Phys. Rev. D 82, 122002 (2010)
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Method Details
Access public
Defining Class matrix
Sealed 0
Static 0

Parameter Description

Default

no description
Key Default Value Options Description
mcmc
LIKELIHOOD VERSION, LLH VERSION, LLH VER 'core' none The version of the likelihood, for the case of MFH models. For more information type: >> help mfh_model_loglikelihood.
SIMPLEX 0
  • 0
  • 1
Set to true to perform a simplex search to find the starting parameters of the MCMC chain.
MHSAMPLE 1
  • 1
  • 0
Set to true to perform a mhsample search. This is set to true by default. Only to be set to false by the user if we does not want to perform the mcmc search.
FREQUENCIES [] none Array of frequencies where the analysis is performed. NOTE: Not the maximum and minimum frequency. In this case please use the 'F1' and 'F2' keys.
F1 [] none Initial frequency for the analysis.
F2 [] none Maximum frequency for the analysis.
FSOUT [] none Desired sampling frequency to resample the input time series.
FS 1 none Sampling frequency of the data time-series. Used in the case where the model is a MFH object.
TRIM [100 -100] none A 2x1 vector that denotes the samples to split from the star and end of the time-series.
INNAMES '' none The input names. Used in the SSM case.
OUTNAMES '' none The output names. Used in the SSM case.
PINV 0
  • 0
  • 1
Use the Penrose-Moore pseudoinverse.
TOL [] none Tolerance for the Penrose-Moore pseudoinverse.
JDES 1000 none The desired number of spectral frequencies to compute. Used in the case of 'LPSD' method.
DOPLOT 0
  • 0
  • 1
True-False flag to plot the FFT of the signal time-series.
REGULARIZE 0
  • 0
  • 1
If the resulting fisher matrix is not positive definite, try a numerical trick to continue sampling.
NEARESTSPD 0
  • 0
  • 1
Try to find the nearest symmetric and positive definite covariance matrix, with the 'nearestSPD' method from MATLAB file exchange.
YUNITS 'm s^-2' none The Y units of the noise time series, in case the MFH object is a 'core' type.
NFFT -1 none The number of samples in each fft [default: length of input data].
A string value containing the variable 'fs' can also be used, e.g.,
plist('Nfft', '2*fs')
WIN 'Hanning'
  • 'Rectangular'
  • 'Welch'
  • 'Bartlett'
  • 'Hanning'
  • 'Hamming'
  • 'Nuttall3'
  • 'Nuttall4'
  • 'Nuttall3a'
  • 'Nuttall3b'
  • 'Nuttall4a'
  • 'Nuttall4b'
  • 'Nuttall4c'
  • 'BH92'
  • 'SFT3F'
  • 'SFT3M'
  • 'FTNI'
  • 'SFT4F'
  • 'SFT5F'
  • 'SFT4M'
  • 'FTHP'
  • 'HFT70'
  • 'FTSRS'
  • 'SFT5M'
  • 'HFT90D'
  • 'HFT95'
  • 'HFT116D'
  • 'HFT144D'
  • 'HFT169D'
  • 'HFT196D'
  • 'HFT223D'
  • 'HFT248D'
  • 'Kaiser'
  • 'levelledHanning'
The window to be applied to the data to remove the discontinuities at edges of segments. [default: taken from user prefs]
Only the design parameters of the window object are used. Enter a string value containing the window name e.g.
plist('Win', 'Kaiser', 'psll', 200)
plist('Win', 'BH92')
PSLL 200 none The peak sidelobe level for Kaiser windows.
Note: it is ignored for all other windows
OLAP -1 none The segment percent overlap [-1 == take from window function]
ORDER, N 0
  • -1
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
The order of segment detrending:
  • -1 - no detrending
  • 0 - subtract mean
  • 1 - subtract linear fit
  • N - subtract fit of polynomial, order N
NAVS -1 none Force number of averages. If set, and if Nfft was set to 0 or -1,
the number of points for each window will be calculated to match the request.
DROP WINDOW SAMPLES 1
  • 1
  • 0
Drop the recommended (by the window) number of samples of the final computed spectral series.
TIMES, SPLIT [] none The time range to analyze. If not empty, sets the time interval to operate on.
As in ao/split, the interval can be specified by:
  • a vector of doubles
  • a timespan object
  • a cell array of time strings
  • a vector of time objects
NAME 'LLH' none The name of the likelihood function handle.
TIME SERIES MFH [] none The time series function handles to perform the FFT. Must be in an array.
NOISE MODEL [] none The given noise model. It may be a) an AO time-series with the appropriate Y units, b) an AO frequency-series of the correct size (NoutputsXNoutputs), c) a SMODEL (function of freqs) of the correct size (NoutputsXNoutputs) d) a MFH object.
TRANSFORM, TRANSFORMATIONS {} [0x0] none A list of transformations to be applied to the inputs before evaluating the expression.
K0 1 none The first FFT coefficient of the analysis.
K1 [] none The k1 coefficient to downsample in frequency domain. More info found in Phys. Rev. D 90, 042003. If left empty, all the spectra is used.
BIN GROUPS [] none A numerical vector that denotes to the start and end frequency value that corresponds to the given frequency block amplitude. The min(freqs) and max(freqs) is taken from the key 'FREQUENCIES'. Each ETA amplitude value is automatically taken into account in the likelihood function as in 'Phys. Rev. D 80, 063007 (2009)' and 'Phys. Rev. D 88, 084044 (2013)'.
NOISE PARAMETERS INDEX, NOISE PARAMETER INDICES, ETA INDICES [] none The index of the noise parameters.
P0 NOISE [] none The initial guess for the noise parameters.
ALPHA 10000 none The scale parameter for the prior distributions of the noise parameters. Applied to the case of the 'NOISE FIT V1' likelihood.
NU 'common'
  • 'common'
  • 'by bins groups'
  • 'by bins'
The 'degrees of freedom' parameter for the student-t distribution, as proposed in PRD 84, 122004 (2011). There are three posibilities to ad th nu coefficient. The 'COMMON' choise, follows the simplified logic that the noise frequency bins follow the same distribution. The second 'BY BIN GROUPS' considers common value for the coefficient for neighboring frequency bins, defined with the key 'BIN GROUPS'. The last choice considers a different degree of freedom for each frequency bin.
ERROR RATIO 0.5 none The percentage of error allowed for each frequency bin (or group of bins).
computeICSMatrix
INPUT '' none The injection signals.
NOUT '' none The number of outputs.
INVERSE 1
  • 1
  • 0
Set to false to return the spectrum matrix, but not inverted.
ISDIAG 0
  • 0
  • 1
For the case of systems where the cross-spectrum matrix is diagonal it can be set to true to skip estimating the non-diagonal elements. Useful for multiple inputs/outputs.
INTERPOLATION METHOD, INTERP METHOD 'LINEAR'
  • 'LINEAR'
  • 'SPLINE'
  • 'PCHIP'
  • 'CUBIC'
The interpolation method.
FREQS [] none Array of frequencies where the analysis is performed.
NOISE SCALE 'PSD'
  • 'PSD'
  • 'LPSD'
Select the way to handle the noise/weight data. Can use the PSD/CPSD or the LPSD/CLPSD functions.
BIN DATA 0
  • 0
  • 1
Set to true to re-bin the measured noise data.
FIT NOISE MODEL 0
  • 0
  • 1
Set to true to attempt a fit on the noise spectra using the 'polyfitSpectrum' function.
POLYNOMIAL ORDER [-4 -3 -2 -1 0 1 2 3 4] none The order of the polynomial to be used in the 'polyfitSpectrum' function.
PLOT FITS 0
  • 0
  • 1
Set to true to produce plots of the fits in case of 'fit noise model' is set to true.
lpsd
KDES 100 none The desired number of averages.
LMIN 0 none The minimum segment length.
SCALE 'PSD'
  • 'PSD'
  • 'ASD'
  • 'PS'
  • 'AS'
The scaling of output. Choose from:
  • PSD - Power Spectral Density
  • ASD - Amplitude (linear) Spectral Density
  • PS - Power Spectrum
  • AS - Amplitude (linear) Spectrum
simplex
OUTPUT '' none The measured output data.
NOISE '' none The noise data.
MODEL '' none The model to use.
X0, PARAMVALUES, P0 [] none The starting point.
DISPLAY 'iter'
  • 'iter'
  • 'off'
  • 'notify'
  • 'final'
Level of display..
FUNVALCHECK 'off'
  • 'off'
  • 'on'
Check whether objective function values are valid. 'on' displays an error when the objective function returns a value that is complex, Inf or NaN. 'off' (the default) displays no error.
MAXFUNEVALS 1000 none Maximum number of function evaluations allowed.
MAXITER 1000 none Maximum number of iterations allowed.
OUTPUTFCN [] none User-defined function that is called at each iteration.
PLOTFCNS [] none Plots various measures of progress while the algorithm executes.
TOLFUN 1.0000000000000001e-05 none Termination tolerance on the function value.
TOLX 1.0000000000000001e-05 none Termination tolerance on x.
FITPARAMS '' none The names of the parameters to fit.
LOG PARAMETERS '' none The parameters to sample in log-scale.
TXT 0
  • 0
  • 1
Set to true if a print of the parameters into a txt file is desired.
FUNC '' none The function handle to minimize.
APPLY NEGATIVE 1
  • 1
  • 0
For the case of a log-likelihood function, a negative sign is added to the numerical value, because the SIMPLEX is a minimisation algorithm
mhsample
DIFF MODEL '' none Model to use for the update of the covariance matrix during the search phase. It should be an unprocessed version of the model to fit.
NSAMPLES 1000 none number of samples of the chain.
COV '' none covariance of the gaussian jumping distribution.
SCALE COV 1
  • 1
  • 0
True-False flag to scale the covariance matrix with N_pars^(-1/2) for a more suitable proposal distribution.
LOGLIKELIHOOD [] none A log-likelihood function. Must be a 'mhf' LTPDA object.
RANGE {} [0x0] none Range where the parameteters are sampled. They are used as uniform priors if no prior knowledge of the parameters is present. For example, for a two parameter problem [x1, x2], the ranges are set as r = {[min_x1 max_x1], [min_x2 max_x2]}. If the input inital values x0 are outside those limits, a random parameteer vector from r will be chosen.
SEARCH 1
  • 1
  • 0
Set to true to use bigger jumps in parameter space during annealing and cool down.
PROPOSAL SAMPLER [] none Set the proposal PDF to sample from. If left empty the multivariate Gaussian is used.
PROPOSAL PDF [] none Input the proposal PDF. This is needed when the proposal PDF is not symmetric.If this field is empty, a symmetric PDF is assumed. Check help for details.
HEAT 1 none The heat index flattening likelihood surface during annealing.
TC [0 1] none An array of two values [i j], setting the i-th and j-th sample for the cooling down.
UPDATE FIM FREQ [] none Provide with the desired frequency where the FIM should be updated.
JUMPS [2 10 1000 10000] none An array of four numbers setting the rescaling of the covariance matrix during the search phase.
PLOT TRACES 0
  • 0
  • 1
True-False flag to plot the chain traces during the run. The figures are printed every 'FPRINT' samples.
PLOT DIAGNOSTICS 0
  • 0
  • 1
Set to true to plot diagnostigs at the end of the sampling.
DEBUG 0
  • 0
  • 1
Set to true to get debug information of the MCMC process.
PRINT DIAGNOSTICS 1
  • 1
  • 0
Set to true to print information of the statistics of the MCMC chains.
FPRINT 100 none Print progress on screen every specified numeber of samples.
PRIOR '' none Must be an MFH object that calculates the prior probability at a given point.
ANNEAL 'simul'
  • 'simul'
  • 'thermo'
Choose type of annealing during sampling. Default value is simulated annealing. Choose "thermo" for annealing with a thermostat. SNR is computed and if it is larger than a fixed value SNR0 (provided also in the plist), then the chains are heated by a factor of (SNR(1)/SNR0)^2.
MODELFREQDEPENDENT 1
  • 1
  • 0
Set to true to use frequency dependent s models, set to false when using constant models
SNR0 200 none Fixed value for thermostated annealing.
FREQUENCIES VECTOR 200 none A vector of frequencies. Used for the update of the Fisher Matrix during the MH sampling.
DIFFSTEP [] none Numerical differentiation step for ssm models
NGRID [] none Number of points in the grid to compute the optimal differentiation step for ssm models
STEPRANGES [] none An array with upper and lower values for the parameters ranges. To be used to compute the optimal differentiation step for ssm models.
LOGA 1
  • 1
  • 0
True-False flag. Set to true when the logarithm of the likelihood is used.
RAND_STREAM [] none Internal MATLAB state of the pseudorandom number generator. You can set the state with a structure which should contain all properties of the MATLAB class RandStream

Example

plist('LIKELIHOOD VERSION', 'core', 'SIMPLEX', [false], 'MHSAMPLE', [true], 'FREQUENCIES', [[]], 'F1', [[]], 'F2', [[]], 'FSOUT', [[]], 'FS', [1], 'TRIM', [[100 -100]], 'INNAMES', '', 'OUTNAMES', '', 'PINV', [false], 'TOL', [[]], 'JDES', [1000], 'DOPLOT', [false], 'REGULARIZE', [false], 'NEARESTSPD', [false], 'YUNITS', 'm s^-2', 'NFFT', [-1], 'WIN', 'Hanning', 'PSLL', [200], 'OLAP', [-1], 'ORDER', [0], 'NAVS', [-1], 'DROP WINDOW SAMPLES', [true], 'TIMES', [[]], 'INPUT', '', 'NOUT', '', 'INVERSE', [true], 'ISDIAG', [false], 'INTERPOLATION METHOD', 'LINEAR', 'FREQS', [[]], 'NOISE SCALE', 'PSD', 'BIN DATA', [false], 'FIT NOISE MODEL', [false], 'POLYNOMIAL ORDER', [[-4 -3 -2 -1 0 1 2 3 4]], 'PLOT FITS', [false], 'KDES', [100], 'LMIN', [0], 'SCALE', 'PSD', 'OUTPUT', '', 'NOISE', '', 'MODEL', '', 'X0', [[]], 'DISPLAY', 'iter', 'FUNVALCHECK', 'off', 'MAXFUNEVALS', [1000], 'MAXITER', [1000], 'OUTPUTFCN', [[]], 'PLOTFCNS', [[]], 'TOLFUN', [1.0000000000000001e-05], 'TOLX', [1.0000000000000001e-05], 'FITPARAMS', '', 'LOG PARAMETERS', '', 'TXT', [false], 'FUNC', '', 'APPLY NEGATIVE', [true], 'DIFF MODEL', '', 'NSAMPLES', [1000], 'COV', '', 'SCALE COV', [true], 'LOGLIKELIHOOD', [[]], 'RANGE', cell(0,0), 'SEARCH', [true], 'PROPOSAL SAMPLER', [[]], 'PROPOSAL PDF', [[]], 'HEAT', [1], 'TC', [[0 1]], 'UPDATE FIM FREQ', [[]], 'JUMPS', [[2 10 1000 10000]], 'PLOT TRACES', [false], 'PLOT DIAGNOSTICS', [false], 'DEBUG', [false], 'PRINT DIAGNOSTICS', [true], 'FPRINT', [100], 'PRIOR', '', 'ANNEAL', 'simul', 'MODELFREQDEPENDENT', [true], 'SNR0', [200], 'FREQUENCIES VECTOR', [200], 'DIFFSTEP', [[]], 'NGRID', [[]], 'STEPRANGES', [[]], 'LOGA', [true], 'RAND_STREAM', [[]], 'NAME', 'LLH', 'TIME SERIES MFH', [[]], 'NOISE MODEL', [[]], 'TRANSFORM', cell(0,0), 'K0', [1], 'K1', [[]], 'BIN GROUPS', [[]], 'NOISE PARAMETERS INDEX', [[]], 'P0 NOISE', [[]], 'ALPHA', [10000], 'NU', 'common', 'ERROR RATIO', [0.5])

back to top back to top

Some information of the method matrix/mcmc are listed below:
Class name matrix
Method name mcmc
Category Signal Processing
Package name ltpda
VCS Version f49947b4d40c07b9530bc0c802266409348aad0e
Min input args 1
Max input args -1
Min output args 1
Max output args -1
Can be used as modifier 1
Supported numeric types {'double'}




©LTP Team