A statistical description of the local structure of condensed matter