# Sensitivity Analysis¶

Neet provides an API for computing various measures of sensitivity on Networks via the SensitivityMixin. Sensitivity, in its simplest form, is a measure of how small perturbations of the network’s state change under the dynamics. In the sensitivity parlance, a network is called, sub-critical, critical, or chaotic if the perturbation tends to shrink, stay the same, or grow over time.

Note

As of the v1.0.0 release, only the neet.boolean module provides implementations of the sensitivity interface. A subsequent release will generalize this mixin to support a wider range of network models.

## Boolean Sensitivity¶

The standard definition of sensitivity at a given state of a Boolean network is defined in terms of the Hamming distance:

$D_H(x,y) = \sum_{i} x_i \oplus y_i.$

That is, the number of bits differing between two binary states, $$x$$ and $$y$$. A Hamming neighbor of a state $$x$$ is a state that differs from it by exactly $$1$$ bit. We can write $$x \oplus e_i$$ to represent the Hamming neighbor of $$x$$ which differs in the $$i$$-th bit. The sensitivity of the state $$x$$ is then defined as

$s_f(x) = \frac{1}{N} \sum_{i = 1}^N D_H(f(x), f(x \oplus e_i))$

where $$f$$ is the network’s update function, and $$N$$ is the number of nodes in the network.

Neet makes computing sensitivity at a given network state as straightforward as possible:

>>> s_pombe.sensitivity([0, 0, 0, 0, 0, 0, 0, 0 ,0])
1.5555555555555556


More often than not, though, you’ll want to compute the average of the sensitivity over all of the states of the network. That is

$s_f = \frac{1}{2^N} \sum_{x} s_f(x).$

In Neet, just ask for it

>>> s_pombe.average_sensitivity()
0.9513888888888888


For a full range of sensitivity-related features offered by Neet, see the API References.