Information theory and statistical nuclear reactions. I. General theory and applications to few-channel problems