Method ao/mhsample


  MHSAMPLE The Metropolis - Hastings algorithm
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  The Metropolis - Hastings algorithm: Samples a given likelihood function.
                   
               Warning: The function mhsample does not performs sanity
                        checks on the inputs. It assumes that the given
                        data-sets are in frequency domain and correctly
                        defined.
 
  CALL:        b = mhsample(out, pl)
 
  INPUTS:      out     - analysis objects with measured outputs
 
               pl      - parameter list
 
  OUTPUTS:     b       - pest object contatining estimated information
 
  Parameters Description
        
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Method Details
Access public
Defining Class ao
Sealed 0
Static 0

Parameter Description

Default

no description
Key Default Value Options Description
mhsample
INNAMES '' none Input names. Used for ssm models
OUTNAMES '' none Output names. Used for ssm models
MODEL '' none Model to fit.
FITPARAMS [] none A cell array of evaluated parameters.
INPUT '' none A matrix array of input signals.
NSAMPLES 1000 none number of samples of the chain.
COV [] none covariance of the gaussian jumping distribution.
SCALE MATRIX '' none A matrix array of noise spectrum (PSD) used to compute the likelihood. It is possible to input just a scale matrix, containing the desirable weights.
LOG-LIKELIHOOD '' none The log-likelihood to sample with the MH or Simplex algorithm. If left empty, then the standard Gaussian approximation will be employed.
RANGE [] none Range where the parameteters are sampled.
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.
X0 [] none The proposed initial values.
UPDATE FIM FREQ [] none Provide with the desired frequency where the FIM should be updated.
JUMPS [] none An array of four numbers setting the rescaling of the covariance matrix during the search phase.
PLOT TRACES [] none Select indexes of the parameters to be plotted.
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.
INMODEL '' none Input model. Still under test
OUTMODEL '' none Output model. Still under test
FPRINT 100 none Print progress on screen every specified numeber of samples.
TXT 0
  • 0
  • 1
Set to true to print the acceptance ratio to a txt file during the MH sampling.
PRIOR '' none blah
LOG PARAMETERS '' none Select the parameters to be treated in log scale.
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
LOGSPACE 1
  • 1
  • 0
False-True key to choose the way of sampling.
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.
crb
PINV 0
  • 0
  • 1
Use the Penrose-Moore pseudoinverse
TOL [] none Tolerance for the Penrose-Moore pseudoinverse
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.
FREQUENCIES [] none The frequencies to perform the analysis.
FSOUT [] none Resampling.
F1 [] none Initial frequency for the analysis.
F2 [] none Final frequency for the analysis.
NOISE SCALE 'PSD'
  • 'PSD'
  • 'LPSD'
Select the way to handle the noise/weight data. Can use the PSD/CPSD or the LPSD/CLPSD functions.
YUNITS 'm s^-2' none The Y units of the noise time series, in case the MFH object is a 'core' type.
TRIM [100 -100] none A 2x1 vector that denotes the samples to split from the star and end of the time-series (split in offsets).
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.
VERSION 'core'
  • 'core'
  • 'ao'
Choose between 'AO' and 'CORE' types. Applies to MFH models.
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 'BH92'
  • '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
computeICSMatrix
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.
FS 1 none The sampling frequency of the data.
INTERPOLATION METHOD, INTERP METHOD 'LINEAR'
  • 'LINEAR'
  • 'SPLINE'
  • 'PCHIP'
  • 'CUBIC'
The interpolation method.
FREQS [] none Array of frequencies where the analysis is performed.
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.
JDES 1000 none The desired number of spectral frequencies to compute.
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

Example

plist('INNAMES', '', 'OUTNAMES', '', 'MODEL', '', 'FITPARAMS', [[]], 'INPUT', '', 'NSAMPLES', [1000], 'COV', [[]], 'SCALE MATRIX', '', 'LOG-LIKELIHOOD', '', 'RANGE', [[]], 'SEARCH', [true], 'PROPOSAL SAMPLER', [[]], 'PROPOSAL PDF', [[]], 'HEAT', [1], 'TC', [[0 1]], 'X0', [[]], 'UPDATE FIM FREQ', [[]], 'JUMPS', [[]], 'PLOT TRACES', [[]], 'PLOT DIAGNOSTICS', [false], 'DEBUG', [false], 'INMODEL', '', 'OUTMODEL', '', 'FPRINT', [100], 'TXT', [false], 'PRIOR', '', 'LOG PARAMETERS', '', 'ANNEAL', 'simul', 'MODELFREQDEPENDENT', [true], 'LOGSPACE', [true], 'SNR0', [200], 'FREQUENCIES VECTOR', [200], 'PINV', [false], 'TOL', [[]], 'DIFFSTEP', [[]], 'NGRID', [[]], 'STEPRANGES', [[]], 'FREQUENCIES', [[]], 'FSOUT', [[]], 'F1', [[]], 'F2', [[]], 'NOISE SCALE', 'PSD', 'YUNITS', 'm s^-2', 'TRIM', [[100 -100]], 'REGULARIZE', [false], 'NEARESTSPD', [false], 'VERSION', 'core', 'NFFT', [-1], 'WIN', 'BH92', 'PSLL', [200], 'OLAP', [-1], 'ORDER', [0], 'NAVS', [-1], 'DROP WINDOW SAMPLES', [true], 'TIMES', [[]], 'NOUT', '', 'INVERSE', [true], 'ISDIAG', [false], 'FS', [1], 'INTERPOLATION METHOD', 'LINEAR', 'FREQS', [[]], 'BIN DATA', [false], 'FIT NOISE MODEL', [false], 'POLYNOMIAL ORDER', [[-4 -3 -2 -1 0 1 2 3 4]], 'PLOT FITS', [false], 'KDES', [100], 'JDES', [1000], 'LMIN', [0], 'SCALE', 'PSD')

back to top back to top

Some information of the method ao/mhsample are listed below:
Class name ao
Method name mhsample
Category Signal Processing
Package name ltpda
VCS Version 967b0eec0dece803a81af8ef54ad2f8c784b20b2
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