Height ( ā š h i ā ): The height of each trapezoid can be interpreted as the average of the two y-values (since the trapezoid is bounded by these values and the x-axis). For the š i-th trapezoid, we can compute it as:
2 y i ā +y iā1 ā
ā
Width ( š¤ š w i ā ): The width is simply the difference between the x-coordinates of the points:
š„ š ā š„ š ā 1 w i ā =x i ā āx iā1 ā
Area computation: Finally, the AUC (the sum of the areas of all the trapezoids) is given by:
1 š ā š ā š¤ š AUC= i=1 ā n ā h i ā ā w i ā
Where each ā š h i ā is the average of the y-values at š i-th and ( š ā 1 ) (iā1)-th points, and š¤ š w i ā is the distance between consecutive x-coordinates.