calculation of alpha matrix