Statistical characterization of galaxies in groups and isolated galaxies. Luminosity Function