# Information dimension

In information theory, information dimension is an information measure for random vectors in Euclidean space, based on the normalized entropy of finely quantized versions of the random vectors. This concept was first introduced by Alfréd Rényi in 1959.
Simply speaking, it is a measure of the fractal dimension of a probability distribution. It characterizes the growth rate of the Shannon entropy given by successively finer discretizations of the space.
In 2010, Wu and Verdú gave an operational characterization of Rényi information dimension as the fundamental limit of almost lossless data compression for analog sources under various regularity constraints of the encoder/decoder.

## Definition and Properties

The entropy of a discrete random variable $Z$ is
    $\mathbb {H} _{0}(Z)=\sum _{z\in supp(P_{Z})}P_{Z}(z)\log _{2}{\frac {1}{P_{Z}(z)}}$
where $P_{Z}(z)$ is the probability measure of $Z$ when $Z=z$, and the $supp(P_{Z})$ denotes a set $\{z|z\in {\mathcal {Z}},P_{Z}(z)>0\}$.
Let $X$ be an arbitrary real-valued random variable. Given a positive integer $m$, we create a new discrete random variable
    $\langle X\rangle _{m}={\frac {\lfloor mX\rfloor }{m}}$
where the $\lfloor \cdot \rfloor$ is the floor operator which converts a real number to the greatest integer less than it. Then
    ${\underline {d}}(X)=\liminf _{m\rightarrow \infty }{\frac {\mathbb {H} _{0}(\langle X\rangle _{m})}{\log _{2}m}}$
and
    ${\bar {d}}(X)=\limsup _{m\rightarrow \infty }{\frac {\mathbb {H} _{0}(\langle X\rangle _{m})}{\log _{2}m}}$
are called lower and upper information dimensions of $X$ respectively. When ${\underline {d}}(X)={\bar {d}}(X)$, we call this value information dimension of $X$,
    $d(X)=\lim _{m\rightarrow \infty }{\frac {\mathbb {H} _{0}(\langle X\rangle _{m})}{\log _{2}m}}$
Some important properties of information dimension $d(X)$:
* If the mild condition $\mathbb {H} (\lfloor X\rfloor )<\infty$ is fulfilled, we have $0\leq {\underline {d}}(X)\leq {\bar {d}}(X)\leq 1$.
* For an $n$-dimensional random vector ${\vec {X}}$, the first property can be generalized to $0\leq {\underline {d}}({\vec {X}})\leq {\bar {d}}({\vec {X}})\leq n$.
* It is sufficient to calculate the upper and lower information dimensions when restricting to the exponential subsequence $m=2^{l}$.
* ${\underline {d}}(X)$ and ${\bar {d}}(X)$ are kept unchanged if rounding or ceiling functions are used in quantization.

## d-Dimensional Entropy

If the information dimension $d$ exists, one can define the $d$-dimensional entropy of this distribution by
    $\mathbb {H} _{d(X)}(X)=\lim _{n\rightarrow +\infty }(\mathbb {H} _{0}(\langle X\rangle _{n})-d(X)\log _{2}n)$
provided the limit exists. If $d=0$, the zero-dimensional entropy equals the standard Shannon entropy $\mathbb {H} _{0}(X)$. For integer dimension $d=n\geq 1$, the $n$-dimensional entropy is the $n$-fold integral defining the respective differential entropy.

## An equivalent definition of Information Dimension

In 1994, Kawabata and Dembo in Kawabata & Dembo 1994 proposed a new way of measuring information based on rate distortion value of a random variable. The measure is defined as
    $d_{R}(X)=-2{\frac {R(X,D)}{\log D}},$
where $R(X,D)$ is the rate-distortion function that is defined as
    $R(X,D)=\min _{\|X-{\hat {X}}\|_{2}\leq D}I(X,{\hat {X}}),$
or equivalently, minimum information that could lead to a $D$-close approximation of $X$.
They further, proved that such definition is equivalent to the definition of information dimension. Formally,
    $d_{R}(X)=d(X).$

## Dimensional-Rate Bias

Using the above definition of Rényi information dimension, a similar measure to d-dimensional entropy is defined in Charusaie, Amini & Rini 2022 . This value $b(X)$ that is named dimensional-rate bias is defined in a way to capture the finite term of rate-distortion function. Formally,
    $R(X,D)=-{\frac {d(X)}{2}}\log {\frac {2\pi eD}{d(X)}}+b(X).$
The dimensional-rate bias is equal to d-dimensional rate for continuous, discrete, and discrete-continuous mixed distribution. Furthermore, it is calculable for a set of singular random variables, while d-dimensional entropy does not necessarily exist there.
Finally, dimensional-rate bias generalizes the Shannon's entropy and differential entropy, as one could find the mutual information $I(X;Y)$ using the following formula:
    $I(X;Y)=b(X)+b(Y)-b(X,Y).$

## Discrete-Continuous Mixture Distributions

According to Lebesgue decomposition theorem, a probability distribution can be uniquely represented by the mixture
   $v=pP_{Xd}+qP_{Xc}+rP_{Xs}$
where $p+q+r=1$ and $p,q,r\geq 0$; $P_{Xd}$ is a purely atomic probability measure (discrete part), $P_{Xc}$ is the absolutely continuous probability measure, and $P_{Xs}$ is a probability measure singular with respect to Lebesgue measure but with no atoms (singular part).
Let $X$ be a random variable such that $\mathbb {H} (\lfloor X\rfloor )<\infty$. Assume the distribution of $X$ can be represented as
   $v=(1-\rho )P_{Xd}+\rho P_{Xc}$
where $P_{Xd}$ is a discrete measure and $P_{Xc}$ is the absolutely continuous probability measure with $0\leq \rho \leq 1$. Then
   $d(X)=\rho$
Moreover, given $\mathbb {H} _{0}(P_{Xd})$ and differential entropy $h(P_{Xc})$, the $d$-Dimensional Entropy is simply given by
   $\mathbb {H} _{\rho }(X)=(1-\rho )\mathbb {H} _{0}(P_{Xd})+\rho h(P_{Xc})+\mathbb {H} _{0}(\rho )$
where $\mathbb {H} _{0}(\rho )$ is the Shannon entropy of a discrete random variable $Z$ with $P_{Z}(1)=\rho$ and $P_{Z}(0)=1-\rho$ and given by
   $\mathbb {H} _{0}(\rho )=\rho \log _{2}{\frac {1}{\rho }}+(1-\rho )\log _{2}{\frac {1}{1-\rho }}$

### Example

Consider a signal which has a Gaussian probability distribution.
We pass the signal through a half-wave rectifier which converts all negative value to 0, and maintains all other values. The half-wave rectifier can be characterized by the function
   $f(x)={\begin{cases}x,&{\text{if }}x\geq 0\\0,&x<0\end{cases}}$
Then, at the output of the rectifier, the signal has a rectified Gaussian distribution. It is characterized by an atomic mass of weight 0.5 and has a Gaussian PDF for all $x>0$.
With this mixture distribution, we apply the formula above and get the information dimension $d$ of the distribution and calculate the $d$-dimensional entropy.
   $d(X)=\rho =0.5$
The normalized right part of the zero-mean Gaussian distribution has entropy $h(P_{Xc})={\frac {1}{2}}\log _{2}(2\pi e\sigma ^{2})-1$, hence
   ${\begin{aligned}\mathbb {H} _{0.5}(X)&=(1-0.5)(1\log _{2}1)+0.5h(P_{Xc})+\mathbb {H} _{0}(0.5)\\&=0+{\frac {1}{2}}({\frac {1}{2}}\log _{2}(2\pi e\sigma ^{2})-1)+1\\&={\frac {1}{4}}\log _{2}(2\pi e\sigma ^{2})+{\frac {1}{2}}\,{\text{ bit(s)}}\end{aligned}}$

## Connection to Differential Entropy

It is shown that information dimension and differential entropy are tightly connected.
Let $X$ be a random variable with continuous density $f(x)$.
Suppose we divide the range of $X$ into bins of length $\Delta$. By the mean value theorem, there exists a value $x_{i}$ within each bin such that
    $f(x_{i})\Delta =\int _{i\Delta }^{(i+1)\Delta }f(x)\;\mathrm {d} x$
Consider the discretized random variable $X^{\Delta }=x_{i}$ if $i\Delta \leq X<(i+1)\Delta$.
The probability of each support point $X^{\Delta }=x_{i}$ is
    $P_{X^{\Delta }}(x_{i})=\int _{i\Delta }^{(i+1)\Delta }f(x)\;\mathrm {d} x=f(x_{i})\Delta$
Let $S=\operatorname {supp} (P_{X^{\Delta }})$. The entropy of $X^{\Delta }$ is
    ${\begin{aligned}\mathbb {H} _{0}(X^{\Delta })&=-\sum _{x_{i}\in S}P_{X^{\Delta }}\log _{2}P_{X^{\Delta }}\\&=-\sum _{x_{i}\in S}f(x_{i})\Delta \log _{2}(f(x_{i})\Delta )\\&=-\sum _{x_{i}\in S}\Delta f(x_{i})\log _{2}f(x_{i})-\sum _{x_{i}\in S}f(x_{i})\Delta \log _{2}\Delta \\&=-\sum _{x_{i}\in S}\Delta f(x_{i})\log _{2}f(x_{i})-\log _{2}\Delta \\\end{aligned}}$
If we set $\Delta =1/m$ and $x_{i}=i/m$ then we are doing exactly the same quantization as the definition of information dimension. Since relabeling the events of a discrete random variable does not change its entropy, we have
    $\mathbb {H} _{0}(X^{1/m})=\mathbb {H} _{0}(\langle X\rangle _{m}).$
This yields
    $\mathbb {H} _{0}(\langle X\rangle _{m})=-\sum {\frac {1}{m}}f(x_{i})\log _{2}f(x_{i})+\log _{2}m$
and when $m$ is sufficiently large,
    $-\sum \Delta f(x_{i})\log _{2}f(x_{i})\approx \int f(x)\log _{2}{\frac {1}{f(x)}}\mathrm {d} x$
which is the differential entropy $h(x)$ of the continuous random variable. In particular, if $f(x)$ is Riemann integrable, then
    $h(X)=\lim _{m\rightarrow \infty }\mathbb {H} _{0}(\langle X\rangle _{m})-\log _{2}(m).$
Comparing this with the $d$-dimensional entropy shows that the differential entropy is exactly the one-dimensional entropy
    $h(X)=\mathbb {H} _{1}(X).$
In fact, this can be generalized to higher dimensions. Rényi shows that, if ${\vec {X}}$ is a random vector in a $n$-dimensional Euclidean space $\Re ^{n}$ with an absolutely continuous distribution with a probability density function $f_{\vec {X}}({\vec {x}})$ and finite entropy of the integer part ($H_{0}(\langle {\vec {X}}\rangle _{m})<\infty$), we have $d({\vec {X}})=n$
and
    $\mathbb {H} _{n}({\vec {X}})=\int \cdots \int f_{\vec {X}}({\vec {x}})\log _{2}{\frac {1}{f_{\vec {X}}({\vec {x}})}}\mathrm {d} {\vec {x}},$
if the integral exists.

## Lossless data compression

The information dimension of a distribution gives a theoretical upper bound on the compression rate, if one wants to compress a variable coming from this distribution. In the context of lossless data compression, we try to compress real number with less real number which both have infinite precision.
The main objective of the lossless data compression is to find efficient representations for source realizations $x^{n}\in {\mathcal {X}}^{n}$ by $y^{n}\in {\mathcal {Y}}^{n}$. A $(n,k)-$code for $\{X_{i}:i\in {\mathcal {N}}\}$ is a pair of mappings:
* encoder: $f_{n}:{\mathcal {X}}^{n}\rightarrow {\mathcal {Y}}^{k}$ which converts information from a source into symbols for communication or storage;
* decoder: $g_{n}:{\mathcal {Y}}^{k}\rightarrow {\mathcal {X}}^{n}$ is the reverse process, converting code symbols back into a form that the recipient understands.
The block error probability is ${\mathcal {P}}\{g_{n}(f_{n}(X^{n}))\neq X^{n}\}$.
Define $r(\epsilon )$ to be the infimum of $r\geq 0$ such that there exists a sequence of $(n,\lfloor rn\rfloor )-$codes such that ${\mathcal {P}}\{g_{n}(f_{n}(X^{n}))\neq X^{n}\}\leq \epsilon$ for all sufficiently large $n$.
So $r(\epsilon )$ basically gives the ratio between the code length and the source length, it shows how good a specific encoder decoder pair is. The fundamental limits in lossless source coding are as follows.
Consider a continuous encoder function $f(x):{\mathbb {R} }^{n}\rightarrow {\mathbb {R} }^{\lfloor Rn\rfloor }$ with its continuous decoder function $g(x):{\mathbb {R} }^{\lfloor Rn\rfloor }\rightarrow {\mathbb {R} }^{n}$. If we impose no regularity on $f(x)$ and $g(x)$, due to the rich structure of $\Re$, we have the minimum $\epsilon$-achievable rate $R_{0}(\epsilon )=0$ for all $0<\epsilon \leq 1$. It means that one can build an encoder-decoder pair with infinity compression rate.
In order to get some nontrivial and meaningful conclusions, let $R^{*}(\epsilon )$ the minimum $\epsilon -$achievable rate for linear encoder and Borel decoder. If random variable $X$ has a distribution which is a mixture of discrete and continuous part. Then $R^{*}(\epsilon )=d(X)$ for all $0<\epsilon \leq 1$ Suppose we restrict the decoder to be a Lipschitz continuous function and ${\bar {d}}(X)<\infty$ holds, then the minimum $\epsilon -$achievable rate $R(\epsilon )\geq {\bar {d}}(X)$ for all $0<\epsilon \leq 1$.
The fundamental role of information dimension in lossless data compression further extends beyond the i.i.d. data. It is shown that for specified processes (e.g., moving-average processes) the ratio of lossless compression is also equal to the information dimension rate. This result allows for further compression that was not possible by considering only marginal distribution of the process.