Thermostatistical theory of plastic deformation in metals