We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a4ef0b3 + 2cae18a commit 3c7e453Copy full SHA for 3c7e453
1 file changed
pynumdiff/utils/evaluate.py
@@ -134,4 +134,4 @@ def total_variation(x, padding=0):
134
padding = max(padding, 1)
135
x = x[padding: len(x)-padding]
136
137
- return np.sum(np.abs(x[1:]-x[:-1]))/(len(x)-1) # mostly equivalent to cvxpy.tv(x2-x1).value
+ return np.sum(np.abs(x[1:]-x[:-1]))/len(x) # normalized version of cvxpy.tv(x2-x1).value
0 commit comments