Damage Diagnosis Algorithms using Statistical Pattern Recognition for Civil Structures Subjected to Earthquakes