Damage diagnosis algorithms using statistical pattern recognition for civil structures subjected to earthquakes