5

We consider a random vector $\vec{v} = \left(x_{1}, x_{2}, \dots, x_{n}\right)$ built from $n$ real random variables drawn from a real continuous uniform distribution $\mathcal{U\left(a, b\right)}$, $a$ and $b$ being the same for all $x_{i}$.

What is the distribution $D$ of the $L^{2}$-norm of such random vectors $\vec{v}$: $\left\lVert\vec{v}\right\rVert_{2} = \sqrt{x_{1}^{2}+x_{2}^{2}+\dots+x_{n}^{2}}$?

In other words, what is the analytical expression of the distribution obtained through this numerical experiment:

    # Packages
    import numpy as np
    import random as rd
    import matplotlib.pyplot as plt
    
    # Parameters
    a = 5
    b = 20
    n = 10
    count = 100000
    
    # Compute a random norm
    def random_norm(a, b, n):
        v = [rd.uniform(a, b) for i in range(0, n)]
        return sum([x ** 2 for x in v]) ** (1./2.)
    
    # Generate random vectors and compute their norm
    norms = [random_norm(a, b, n) for i in range(0, count)]

    # Plot the resulting distribution
    plt.hist(norms, 100)
    plt.show()
kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Vincent
  • 205
  • 2
  • 7
  • 2
    Here is an answer for the distribution of a single squared uniform: https://math.stackexchange.com/questions/305997/does-the-square-of-uniform-distribution-have-density-function I would be surprised if there were a neat expression for the square root of their sum. – Christoph Hanck Feb 08 '19 at 10:42
  • 1
    For the (simpler, special) case $a=0,$ the distribution of the sum of uniforms is derived and described at https://stats.stackexchange.com/questions/41467/consider-the-sum-of-n-uniform-distributions-on-0-1-or-z-n-why-does-the/43075?r=SearchResults&s=1|18.0504#43075. Your case generalizes this a little, but the same complexities apply: in particular, when $a\ge 0,$ the distribution can be described only in a piecewise fashion with $n+2$ components; when $a\lt 0,$ it might get even more complicated. – whuber Feb 08 '19 at 12:53
  • This is a generalization of https://stats.stackexchange.com/questions/317095/expectation-of-square-root-of-sum-of-independent-squared-uniform-random-variable/317475#317475 which do have an answer – kjetil b halvorsen Feb 09 '19 at 17:51
  • For $n=10$, the distribution of $v^2$ will be approximately normal. That seems good enough for most applications — do you have an application in mind where the normal approximation is not good enough? – Matt F. Dec 13 '21 at 04:26

0 Answers0