**MSC:**- 28A80 Fractals, See also {58Fxx}
- 60F10 Large deviations

weak Gibbs measures both defined on a symbolic shift space. We prove that the

free Helmholtz energy of the stochastic process of a randomly stopped

Birkhoff sum measured by a weak Gibbs measure can be expressed in terms of the

topological pressure. This leads to the notion of the multifractal entropy function

which provides large deviation bounds. The multifractal entropy function

can be considered as a generalization of the multifractal spectrum as

they coincide (up to constants) when for instance Gibbs or \( g \)--measures are

involved.