diff options
| author | ziejd2 | 2017-09-28 15:04:40 -0500 |
|---|---|---|
| committer | ziejd2 | 2017-09-28 15:04:40 -0500 |
| commit | 8070dc963753142bb86c4ed698d91fd623ed28e7 (patch) | |
| tree | d0f6dd8fc46a49b819aa55c1a90faa14d8448883 /sourcecodes/bnt-master/nethelp3.3/metrop.htm | |
| parent | 7cc31810d53176e805532b2789955f4eedbce6bb (diff) | |
| download | BNW-8070dc963753142bb86c4ed698d91fd623ed28e7.tar.gz | |
BNW using Octave instead of Matlab.
This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning. I am calling this BNW_1.02. It can be accessed at: compbio.uthsc.edu/BNW_1.02
Diffstat (limited to 'sourcecodes/bnt-master/nethelp3.3/metrop.htm')
| -rw-r--r-- | sourcecodes/bnt-master/nethelp3.3/metrop.htm | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/nethelp3.3/metrop.htm b/sourcecodes/bnt-master/nethelp3.3/metrop.htm new file mode 100644 index 00000000..93c3ed49 --- /dev/null +++ b/sourcecodes/bnt-master/nethelp3.3/metrop.htm @@ -0,0 +1,108 @@ +<html> +<head> +<title> +Netlab Reference Manual metrop +</title> +</head> +<body> +<H1> metrop +</H1> +<h2> +Purpose +</h2> +Markov Chain Monte Carlo sampling with Metropolis algorithm. + +<p><h2> +Synopsis +</h2> +<PRE> + +samples = metrop(f, x, options) +samples = metrop(f, x, options, [], P1, P2, ...) +[samples, energies, diagn] = metrop(f, x, options) +s = metrop('state') +metrop('state', s) +</PRE> + + +<p><h2> +Description +</h2> + +<CODE>samples = metrop(f, x, options)</CODE> uses +the Metropolis algorithm to sample from the distribution +<CODE>p ~ exp(-f)</CODE>, where <CODE>f</CODE> is the first argument to <CODE>metrop</CODE>. +The Markov chain starts at the point <CODE>x</CODE> and each +candidate state is picked from a Gaussian proposal distribution and +accepted or rejected according to the Metropolis criterion. + +<p><CODE>samples = metrop(f, x, options, [], p1, p2, ...)</CODE> allows +additional arguments to be passed to <CODE>f()</CODE>. The fourth argument is +ignored, but is included for compatibility with <CODE>hmc</CODE> and the +optimisers. + +<p><CODE>[samples, energies, diagn] = metrop(f, x, options)</CODE> also returns +a log of the energy values (i.e. negative log probabilities) for the +samples in <CODE>energies</CODE> and <CODE>diagn</CODE>, a structure containing +diagnostic information (position and +acceptance threshold) for each step of the chain in <CODE>diagn.pos</CODE> and +<CODE>diagn.acc</CODE> respectively. All candidate states (including rejected +ones) are stored in <CODE>diagn.pos</CODE>. + +<p><CODE>s = metrop('state')</CODE> returns a state structure that contains the +state of the two random number generators <CODE>rand</CODE> and <CODE>randn</CODE>. +These are contained in fields +<CODE>randstate</CODE>, +<CODE>randnstate</CODE>. + +<p><CODE>metrop('state', s)</CODE> resets the state to <CODE>s</CODE>. If <CODE>s</CODE> is an integer, +then it is passed to <CODE>rand</CODE> and <CODE>randn</CODE>. +If <CODE>s</CODE> is a structure returned by <CODE>metrop('state')</CODE> then +it resets the generator to exactly the same state. + +<p>The optional parameters in the <CODE>options</CODE> vector have the following +interpretations. + +<p><CODE>options(1)</CODE> is set to 1 to display the energy values and rejection +threshold at each step of the Markov chain. If the value is 2, then the +position vectors at each step are also displayed. + +<p><CODE>options(14)</CODE> is the number of samples retained from the Markov chain; +default 100. + +<p><CODE>options(15)</CODE> is the number of samples omitted from the start of the +chain; default 0. + +<p><CODE>options(18)</CODE> is the variance of the proposal distribution; default 1. + +<p><h2> +Examples +</h2> +The following code fragment samples from the posterior distribution of +weights for a neural network. +<PRE> + +w = mlppak(net); +[samples, energies] = metrop('neterr', w, options, 'netgrad', net, x, t); +</PRE> + + +<p><h2> +Algorithm +</h2> + +The algorithm follows the procedure outlined in Radford Neal's technical +report CRG-TR-93-1 from the University of Toronto. + +<p><h2> +See Also +</h2> +<CODE><a href="hmc.htm">hmc</a></CODE><hr> +<b>Pages:</b> +<a href="index.htm">Index</a> +<hr> +<p>Copyright (c) Ian T Nabney (1996-9) + + +</body> +</html> \ No newline at end of file |
