All Pages
histogrambead

A function that can be used to calculate whether quantities are between fixed upper and lower bounds. A function that can be used to calculate whether quantities are between fixed upper and lower bounds.

If we have multiple instances of a variable we can estimate the probability distribution (pdf) for that variable using a process called kernel density estimation:

\[ P(s) = \sum_i K\left( \frac{s - s_i}{w} \right) \]

In this equation \(K\) is a symmetric funciton that must integrate to one that is often called a kernel function and \(w\) is a smearing parameter. From a pdf calculated using kernel density estimation we can calculate the number/fraction of values between an upper and lower bound using:

\[ w(s) = \int_a^b \sum_i K\left( \frac{s - s_i}{w} \right) \]

All the input to calculate a quantity like \(w(s)\) is generally provided through a single keyword that will have the following form:

KEYWORD={TYPE UPPER= \(a\) LOWER= \(b\) SMEAR= \(\frac{w}{b-a}\)}

This will calculate the number of values between \(a\) and \(b\). To calculate the fraction of values you add the word NORM to the input specification. If the function keyword SMEAR is not present \(w\) is set equal to \(0.5(b-a)\). Finally, type should specify one of the kernel types that is present in plumed. These are listed in the table below:

TYPE FUNCTION
GAUSSIAN \(\frac{1}{\sqrt{2\pi}w} \exp\left( -\frac{(s-s_i)^2}{2w^2} \right)\)
TRIANGULAR \( \frac{1}{2w} \left( 1. - \left| \frac{s-s_i}{w} \right| \right) \quad \frac{s-s_i}{w}<1 \)

Some keywords can also be used to calculate a descretized version of the histogram. That is to say the number of values between \(a\) and \(b\), the number of values between \(b\) and \(c\) and so on. A keyword that specifies this sort of calculation would look something like

KEYWORD={TYPE UPPER= \(a\) LOWER= \(b\) NBINS= \(n\) SMEAR= \(\frac{w}{n(b-a)}\)}

This specification would calculate the following vector of quantities:

\[ w_j(s) = \int_{a + \frac{j-1}{n}(b-a)}^{a + \frac{j}{n}(b-a)} \sum_i K\left( \frac{s - s_i}{w} \right) \]