# Comparative Analysis of Water Quality Applying Statistic and Machine Learning Method: A Case Study in Coyuca Lagoon and Tecpan River, Mexico

^{1}

^{2}

^{3}

^{4}

^{*}

^{†}

## Abstract

**:**

## 1. Background

## 2. Methods

#### 2.1. Data

#### 2.2. Physicochemical Parameters

#### 2.2.1. pH

#### 2.2.2. Total Hardness

#### 2.2.3. Electrical Conductivity

#### 2.2.4. Chlorides

#### 2.2.5. Total Alkalinity

#### 2.2.6. Total Dissolved Solids

#### 2.2.7. Salinity

#### 2.2.8. Calcium Hardness

#### 2.2.9. Magnesium Hardness

#### 2.2.10. Bicarbonates

#### 2.3. Analysis Techniques

#### 2.3.1. Analysis of Variance and Tukey Test

#### 2.3.2. Spearman Coefficient Analysis

#### 2.3.3. Logistic Regression

#### 2.3.4. Support Vector Machine

#### 2.3.5. Performance Metric

#### 2.4. Experimental Setup

## 3. Results

#### Physicochemical Parameters

## 4. Discussions

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Khalil, B.; Ouarda, T.B.; St-Hilaire, A. Estimation of water quality characteristics at ungauged sites using artificial neural networks and canonical correlation analysis. J. Hydrol.
**2011**, 405, 277–287. [Google Scholar] [CrossRef] - Barreto, P.; Dogliotti, S.; Perdomo, C. Surface water quality of intensive farming areas within the Santa Lucia River basin of Uruguay. Air Soil Water Res.
**2017**, 10, 1178622117715446. [Google Scholar] [CrossRef] - Bora, F.D.; Bunea, A.; Pop, S.R.; Baniță, S.I.; Duşa, D.Ş.; Chira, A.; Bunea, C.I. Quantification and Reduction in Heavy Metal Residues in Some Fruits and Vegetables: A Case Study Galați County, Romania. Horticulturae
**2022**, 8, 1034. [Google Scholar] [CrossRef] - Pagano, R.R. El río como ecosistema. In Conceptos y Técnicas de Ecología Fluvial; Fundacion BBVA: Bilbao, Spain, 2009; pp. 23–37. [Google Scholar]
- Benetti, C.J.; Pérez-Bilbao, A.; Garrido, J. Macroinvertebrates as indicators of water quality in running waters: 10 years of research in rivers with different degrees of anthropogenic impacts. In Ecological Water Quality-Water Treatment and Reuse; IntechOpen: London, UK, 2012; pp. 23–44. [Google Scholar]
- Liévano-León, A. Calidad biológica de las aguas superficiales de la cuenca del río Apulo. Rev. Tecnol.
**2013**, 12, 60–71. [Google Scholar] [CrossRef] - Mogollón, J.; Ramírez, A.; García, B.; Bifano, C. Uso de los parámetros físico-químicos de las aguas fluviales como indicadoras de influencias naturales y antrópicas. Interciencia
**1993**, 18, 249–254. [Google Scholar] - Villamarín, C. Estructura y Composición de las Comunidades de Macroinvertebrados Acuáticos en ríos Altoandinos del Ecuador y Perú. Diseño de un Sistema de Medida de la Calidad del Agua con índices Multimétricos. Ph.D. Thesis, Universitat de Barcelona, Barcelona, Spain, 2008. [Google Scholar]
- Najafzadeh, M.; Ghaemi, A. Prediction of the five-day biochemical oxygen demand and chemical oxygen demand in natural streams using machine learning methods. Environ. Monit. Assess.
**2019**, 191, 380. [Google Scholar] [CrossRef] [PubMed] - Kiely, G.; Veza, J.M. Ingeniería Ambiental: Fundamentos, Entornos, Tecnologías y Sistemas de Gestión; McGraw-Hill: Madrid, Spain, 1999; Volume 1. [Google Scholar]
- Rossen, A.; Calvo, D.; Rodríguez, M.; Bustamante, A.; Korol, S.; Angelaccio, C. Evaluación de la Calidad del agua mediante modelación lineal de los indicadores de contaminación fecal en el embalse San Roque. In Proceedings of the XXII Congreso Nacional del Agua, Trelew, Argentina, 11–14 November 2009; pp. 325–330. [Google Scholar]
- Suárez, L.; Chávez, G.; Cordero, M.; Álvarez, N.; Espinoza, F.; Paz y Miño, C.; Vogel, J.; Bravo, E.; Vásquez, L.; Chiriboga, J.; et al. Biodiversidad, Bioprospección y Bioseguridad; Varea, A., Ed.; Abya-Yala: Quito, Ecuador, 1997. [Google Scholar]
- Botello, A.; Villanueva, F.; Ponce, V.G. La contaminación de las costas mexicanas. In Calidad del Agua. Un Enfoque Multidisciplinario para la Disponibilidad del Agua; UNAM, Instituto de Investigaciones Económicas: Mexico City, Mexico, 2010. [Google Scholar]
- Addisie, M.B. Evaluating Drinking Water Quality Using Water Quality Parameters and Esthetic Attributes. Air Soil Water Res.
**2022**, 15, 11786221221075005. [Google Scholar] [CrossRef] - Kirschke, S.; Avellán, T.; Bärlund, I.; Bogardi, J.J.; Carvalho, L.; Chapman, D.; Dickens, C.W.; Irvine, K.; Lee, S.; Mehner, T.; et al. Capacity challenges in water quality monitoring: Understanding the role of human development. Environ. Monit. Assess.
**2020**, 192, 298. [Google Scholar] [CrossRef] - Montes, C.; Sala, O. La Evaluación de los Ecosistemas del Milenio. Las relaciones entre el funcionamiento de los ecosistemas y el bienestar humano. Ecosistemas
**2007**, 16, 137–147. [Google Scholar] - Wang, Y.; Borthwick, A.G.; Ni, J. Human affinity for rivers. River
**2022**, 1, 4–14. [Google Scholar] [CrossRef] - Bartram, J.; Ballance, R. Water Quality Monitoring: A Practical Guide to the Design and Implementation of Freshwater Quality Studies and Monitoring Programmes; CRC Press: Boca Raton, FL, USA, 1996. [Google Scholar]
- Simeonov, V.; Stratis, J.; Samara, C.; Zachariadis, G.; Voutsa, D.; Anthemidis, A.; Sofoniou, M.; Kouimtzis, T. Assessment of the surface water quality in Northern Greece. Water Res.
**2003**, 37, 4119–4124. [Google Scholar] [CrossRef] [PubMed] - Reyes-Toscano, C.A.; Alfaro-Cuevas-Villanueva, R.; Cortes-Martinez, R.; Morton-Bermea, O.; Hernandez-Alvarez, E.; Buenrostro-Delgado, O.; Ávila-Olivera, J.A. Hydrogeochemical characteristics and assessment of drinking water quality in the urban area of Zamora, Mexico. Water
**2020**, 12, 556. [Google Scholar] [CrossRef] [Green Version] - American Public Health Association (APHA). Standard Methods for the Examination of Water and Wastewater; Technical Report; Federation, W. E., & Aph Association: Washington, DC, USA, 2005. [Google Scholar]
- Boyacioglu, H. Development of a water quality index based on a European classification scheme. Water Sa
**2007**, 33. [Google Scholar] [CrossRef] - Samboni Ruiz, N.E.; Carvajal Escobar, Y.; Escobar, J.C. Revisión de parámetros fisicoquímicos como indicadores de calidad y contaminación del agua. Ing. Investig.
**2007**, 27, 172–181. [Google Scholar] - Fernández, N.; Solano, F. Índices de Calidad y de Contaminación del Agua; Universidad de Pamplona: Pamplona, Colombia, 2005; Volume 1. [Google Scholar]
- Basáez, L.; Luis, R. ¿Qué es el pH?: Formas de medirlo. Rev. Cienc. Ahora
**2009**, 23, 1–4. [Google Scholar] - MINAE. Reglamento para la Clasificación y Evaluación de la Calidad de Cuerpos de Agua Superficiales para la Clasificación y la Evaluación de la Calidad de Cuerpos de Agua Superficiales; Technical Report; Gaceta: Amsterdam, The Netherlands, 2007; Volume 178. [Google Scholar]
- Manahan, S.E. Introducción a la Química Ambiental; Reverté: Barcelona, Spain, 2006. [Google Scholar]
- Alfaro, R. Estudio de la Movilidad y Toxicidad de Metales Pesados y Arsénico en Agua y Sedimentos del lago de Cuitzeo, Michoacán. Ph.D. Thesis, Universidad Autónoma del Estado de México, Toluca, Mexico, 2010. [Google Scholar]
- WHO. Hardness in Drinking-Water. Documento de Referencia Para la Elaboración de las Guías de la OMS Para la Calidad del Agua Potable. Technical Report, WHO/SDE/WSH/03.04/6. [en línea]. 2012. Available online: https://www.who.int/es/publications/i/item/9789241549950 (accessed on 12 May 2022).
- Rodier, J. Análisis de las aguas. Aguas naturales, aguas residuales, aguas de mar: Barcelona. Omega
**1990**, 1059, 543. [Google Scholar] - García, M.; Sánchez, F.; Marín, R.; Guzmán, H.; Verdugo, N.; Domínguez, E.; Vargas, O.; Panizzo, L.; Sánchez, N.; Gómez, J.; et al. El agua; Instituto de Hidrología, Meteorología y Estudios Ambientales: Bogotá, Colombia, 2005; Volume 1. [Google Scholar]
- Iowa, D. Water quality standards review: Chloride, sulfate and total dissolved solids. In Iowa Department of Natural Resources Consultation Package; Iowa Department of Natural Resources: Des Moines, IA, USA, 2009. [Google Scholar]
- Carrión, J.; Villacrés, E.; Peralta, E.; Ramos, M. Reutilización del efluente del desamargado de chocho (Lupinus mutabilis Sweet). Aliment. Cienc. Ing.
**2008**, 1, 85–93. [Google Scholar] - Mora, V.; Cedeño, J. Determinación fisicoquímica y bacteriológica del agua en las etapas de tratamiento en planta de potabilización. Univ. Cienc. Tecnol.
**2006**, 10, 41–45. [Google Scholar] - Castillo, E. Diagnóstico Ambiental del Manglar en la Laguna de Coyuca de Benítez Guerrero. Ph.D. Thesis, Universidad Autónoma de Guerrero Acapulco, Gro., Mexico City, Mexico, 2010. [Google Scholar]
- Martínez-Villavicencio, N.; López-Alonzo, C.V.; Pérez-Leal, R.; Basurto-Sotelo, M. Efectos por salinidad en el desarrollo vegetativo. Tecnociencia Chihuah.
**2011**, 5, 156–161. [Google Scholar] - Rodríguez Donatien, A.; Ramírez Martín, C.E.; Bravo García, Y. Sistema para la Identificacion de Aguas en Pozos Petroleros (SIAPP). Bachelor’s Thesis, Universidad de las Ciencias Informáticas, la Habana, Cuba, 2009. [Google Scholar]
- Manzano Arrondo, V. Inferencia Estadística: Aplicaciones con SPSS/PC+; Grupo editor Alfa Omega, S.A. de C.V.: Mexico City, Mexico, 1995. [Google Scholar]
- Pagano, R.R. Estadística para las ciencias del comportamiento. In Estadística Para las Ciencias del Comportamiento; CRC Press: Boca Raton, FL, USA, 2011; p. 599. [Google Scholar]
- Ferré, J.; Rius, F.X. Introducción al Diseño Estadístico de Experimentos; Tecnicas DE Laboratorio: Barcelona, Spain, 2002; pp. 648–653. [Google Scholar]
- Terrádez, M.; Juan, A.A. Análisis de la Varianza (ANOVA); Universidad Oberta de Catalunya: Catalunya, Spain, 2003. [Google Scholar]
- Einot, I.; Gabriel, K.R. A study of the powers of several methods of multiple comparisons. J. Am. Stat. Assoc.
**1975**, 70, 574–583. [Google Scholar] - Wayne, W. Bioestadística. Bases para el análisis de las Ciencias de la Salud; Limusa: Mexico City, Mexico, 2002. [Google Scholar]
- Tousi, E.G.; Duan, J.G.; Gundy, P.M.; Bright, K.R.; Gerba, C.P. Evaluation of E. coli in sediment for assessing irrigation water quality using machine learning. Sci. Total Environ.
**2021**, 799, 149286. [Google Scholar] [CrossRef] [PubMed] - Bonett, D.G.; Wright, T.A. Sample size requirements for estimating Pearson, Kendall and Spearman correlations. Psychometrika
**2000**, 65, 23–28. [Google Scholar] [CrossRef] - Yerel, S.; Anagun, A.S. Assessment of water quality observation stations using cluster analysis and ordinal logistic regression technique. Int. J. Environ. Pollut.
**2010**, 42, 344–358. [Google Scholar] [CrossRef] - Boser, B.E.; Guyon, I.M.; Vapnik, V.N. A training algorithm for optimal margin classifiers. In Proceedings of the Fifth Annual Workshop on Computational Learning Theory, Pittsburgh, PA, USA, 27–29 July 1992; pp. 144–152. [Google Scholar]
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag.
**2009**, 45, 427–437. [Google Scholar] [CrossRef] - Secretaría de Salud (SSA). Norma Oficial Mexicana NOM-127-SSA1-1994. Salud Ambiental, Aguas Para Uso y Consumo Humano, líMites Permisibles de Calidad y Tratamientos a que Debe Someterse el Agua Para su Potabilización; Diario Oficial de la Federación: Ciudad de México, Mexico, 2000. [Google Scholar]
- Rendon Dircio, J.A.; De La Lanza Espino, G.J.; Rojas Herrera, A.A.; Flores Verdugo, F.J.; Arredondo Figueroa, J.L.; Ponce Palafox, J.T. Morfometría, hidrodinámica y físico-química del agua de la laguna de Chautengo, Guerrero, México. Revista Bio Ciencias
**2012**, 4, 25–37. [Google Scholar] - Ortiz Maldonado, J.F. Caracterización de la Contaminación de la Laguna de tres palos, Municipio de Acapulco de Juárez, Guerrero, una Consecuencia del Desarrollo Habitacional e Industrial Desordenado. Ph.D. Thesis, Universidad Autónoma de Guerrero (México), Chilpancingo, Mexico, 2014. [Google Scholar]
- Pérez-López, E. Control de calidad en aguas para consumo humano en la región occidental de Costa Rica. Rev. Tecnol. Marcha
**2016**, 29, 3–14. [Google Scholar] [CrossRef] - Fassbender, H.W.; Bornemisza, E. Química de Suelos con Énfasis en América Latina; Instituto Iberoamericano de Cooperación para la Agricultura: San José, Costa Rica, 1987. [Google Scholar]
- Ji, C.J.; Yang, Y.H.; Han, W.X.; He, Y.F.; Smith, J.; Smith, P. Climatic and edaphic controls on soil pH in alpine grasslands on the Tibetan Plateau, China: A quantitative analysis. Pedosphere
**2014**, 24, 39–44. [Google Scholar] [CrossRef] - Doran, J.W.; Parkin, T.B. Defining and assessing soil quality. Defin. Soil Qual. Sustain. Environ.
**1994**, 35, 1–21. [Google Scholar] - Parnis, J.M.; Mackay, D. Multimedia Environmental Models: The Fugacity Approach; CRC Press: Boca Raton, FL, USA, 2020. [Google Scholar]

**Figure 3.**pH values in each location; the grey points refer to the data dispersion in relation to the mean represented by the blue line.

**Figure 4.**Total hardness values in each location; the grey points refer to the data dispersion in relation to the mean represented by the blue line.

**Figure 5.**Chlorides values in each location; the grey points refer to the data dispersion in relation to the mean represented by the blue line.

**Figure 6.**Total alkalinity values in each location; the grey points refer to the data dispersion in relation to the mean represented by the blue line.

**Figure 7.**Total dissolved solids values in each location; the grey points refer to the data dispersion in relation to the mean represented by the blue line.

Station | Latitude | Longitude | Altitude |
---|---|---|---|

Paraiso de los Manglares | 16${}^{\circ}$57${}^{\prime}$59${}^{\u2033}$ N | 100${}^{\circ}$01${}^{\prime}$44${}^{\u2033}$ W | 7 masl |

Pedregoso | 16${}^{\circ}$55${}^{\prime}$05${}^{\u2033}$ N | 099${}^{\circ}$58${}^{\prime}$23${}^{\u2033}$ W | 6 masl |

Base Aérea | 16${}^{\circ}$54${}^{\prime}$41${}^{\u2033}$ N | 099${}^{\circ}$58${}^{\prime}$58${}^{\u2033}$ W | 7 masl |

La Barra | 16${}^{\circ}$56${}^{\prime}$58${}^{\u2033}$ N | 100${}^{\circ}$06${}^{\prime}$53${}^{\u2033}$ W | 1 masl |

Boca Chica | 17${}^{\circ}$08${}^{\prime}$18${}^{\u2033}$ N | 100${}^{\circ}$38${}^{\prime}$’ 46” W | 9 masl |

Tetitlan | 17${}^{\circ}$09${}^{\prime}$03${}^{\u2033}$ N | 100${}^{\circ}$39${}^{\prime}$08${}^{\u2033}$ W | 11 masl |

Puente libramiento | 17${}^{\circ}$12${}^{\prime}$02${}^{\u2033}$ N | 100${}^{\circ}$38${}^{\prime}$15${}^{\u2033}$ W | 15 masl |

Puente roto | 17${}^{\circ}$13${}^{\prime}$24${}^{\u2033}$ N | 100${}^{\circ}$38${}^{\prime}$07${}^{\u2033}$ W | 20 masl |

Puente prepa | 17${}^{\circ}$14${}^{\prime}$06${}^{\u2033}$ N | 100${}^{\circ}$37${}^{\prime}$32${}^{\u2033}$ W | 29 masl |

Pozumiche | 17${}^{\circ}$15${}^{\prime}$35${}^{\u2033}$ N | 100${}^{\circ}$37${}^{\prime}$45${}^{\u2033}$ W | 43 masl |

El verde | 17${}^{\circ}$17${}^{\prime}$14${}^{\u2033}$ N | 100${}^{\circ}$36${}^{\prime}$40${}^{\u2033}$ W | 94 masl |

El paraje | 17${}^{\circ}$18${}^{\prime}$02${}^{\u2033}$ N | 100${}^{\circ}$36${}^{\prime}$19${}^{\u2033}$ W | 108 masl |

Physicochemical Parameter | Analytical Method | Official Mexican Standard |
---|---|---|

pH | Potentiometric | NMX-AA-008-SCFI-2000 |

Electrical conductivity (μS/cm) | Potentiometric | NMX-AA-093-SCFI-2000 |

Total alkalinity | Volumetric (acid base) | NMX-AA-036-SCFI-2001 |

Total hardness | Volumetric (complexometry) | NMX-AA-072-SCFI-2001 |

Chlorides | Volumetric (argentometric) | NMX-AA-073-SCFI-2001 |

Total dissolved solids | Gravimetry | NMX-AA-034-SCFI-2001 |

Characteristic | Maximum Limit |
---|---|

Chlorides | 250 mg/L |

Total hardness (TH) | 500 mg/L |

pH | 6.5–8.5 |

Total dissolved solids (TDS) | 1000 mg/L |

Electrolytic conductivity | - |

Total alkalinity | - |

Ecosystem | Place | pH | Conductivity | TH | Chlorides | Alkalinity | TDS |
---|---|---|---|---|---|---|---|

Lagoon | Paraiso manglares | 6.6 | 6265 | 1008 | 1832 | 670 | 3099 |

Pedregoso | 7.0 | 7060 | 1366 | 1958 | 761 | 3291 | |

Base aérea | 6.8 | 6429 | 953 | 1719 | 465 | 3091 | |

La barra | 6.6 | 1752 | 479 | 344 | 395 | 1494 | |

River | Boca chica | 6.2 | 318 | 249 | 77 | 236 | 161 |

Tetitlan | 6.2 | 141 | 124 | 44 | 99 | 75 | |

Puente libramiento | 5.9 | 241 | 232 | 67 | 213 | 124 | |

Puente roto | 6.1 | 107 | 97 | 29 | 96 | 52 | |

Puente prepa | 6.0 | 102 | 86 | 27 | 83 | 51 | |

Pozulmiche | 6.1 | 128 | 96 | 31 | 93 | 64 | |

El verde | 6.2 | 110 | 103 | 32 | 95 | 59 | |

El paraje | 5.9 | 119 | 103 | 35 | 95 | 59 |

**Table 5.**Tukey’s pairwise comparisons, grouping of information using the Tukey method confidence of 95%.

Factor | N | Mean | Pair |
---|---|---|---|

Pedregoso | 12 | 7.0108 | A |

Base aérea | 12 | 6.8425 | A B |

La barra | 12 | 6.672 | A B |

Paraíso mangle | 12 | 6.6025 | B C |

Tetitlan | 12 | 6.2675 | C D |

El Verde | 12 | 6.2650 | C D |

Boca chica | 12 | 6.2200 | D |

Puente Roto | 12 | 6.1442 | D |

Pozulmiche | 12 | 6.1400 | D |

Puente Prepa | 12 | 6.0675 | D |

Punte Libramiento | 12 | 5.9775 | D |

El Paraje | 12 | 5.9525 | D |

Place | Mean | |
---|---|---|

River | Boca Chica | 318 μS/cm |

Tetitlan | 141 μS/cm | |

Puente libramiento | 241 μS/cm | |

Puente roto | 107 μS/cm | |

Puente prepa | 102 μS/cm | |

Pozulmiche | 128 μS/cm | |

El verde | 110 μS/cm | |

El paraje | 119 μS/cm | |

Lagoon | Paraiso de los manglares | 2459 μS/cm |

El Pedregoso | 2322 μS/cm | |

Base aérea | 2253 μS/cm | |

La barra | 1831 μS/cm |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Avila-Perez, H.; Flores-Munguía, E.J.; Rosas-Acevedo, J.L.; Gallardo-Bernal, I.; Ramirez-delReal, T.A.
Comparative Analysis of Water Quality Applying Statistic and Machine Learning Method: A Case Study in Coyuca Lagoon and Tecpan River, Mexico. *Water* **2023**, *15*, 640.
https://doi.org/10.3390/w15040640

**AMA Style**

Avila-Perez H, Flores-Munguía EJ, Rosas-Acevedo JL, Gallardo-Bernal I, Ramirez-delReal TA.
Comparative Analysis of Water Quality Applying Statistic and Machine Learning Method: A Case Study in Coyuca Lagoon and Tecpan River, Mexico. *Water*. 2023; 15(4):640.
https://doi.org/10.3390/w15040640

**Chicago/Turabian Style**

Avila-Perez, Humberto, Enrique J. Flores-Munguía, José L. Rosas-Acevedo, Iván Gallardo-Bernal, and Tania A. Ramirez-delReal.
2023. "Comparative Analysis of Water Quality Applying Statistic and Machine Learning Method: A Case Study in Coyuca Lagoon and Tecpan River, Mexico" *Water* 15, no. 4: 640.
https://doi.org/10.3390/w15040640