AMI calculation