Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions notebooks/1_basic_tutorial.ipynb

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions notebooks/2_optimizing_hyperparameters.ipynb

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions notebooks/4_performance_analysis.ipynb

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions notebooks/6_multidimensionality_demo.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pynumdiff/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def _lineardiff(x, dt_or_t, order, gamma): # just to read a shape, so it warns w
raise np.linalg.LinAlgError(f"CVXPY failed to fit the linear model on a window of {N} samples at order "
f"{order}, gamma {gamma}. Try a wider `window_size` or a lower `order`.") from e

x_hat = a_v.value @ Y_integrals[:-1] + c_v.value @ B + mu
dxdt_hat = (a_v.value @ Y_integrals[1:] + c_v.value[:order-1] @ B[1:])/T # undo the time scaling
x_hat = a_v.value @ Y_integrals[:-1] + c_v.value @ B + mu # use x_hat instead of y in calculation of dxdt_hat
dxdt_hat = (a_v.value @ np.vstack([Y_integrals[1:-1], x_hat - mu]) + c_v.value[:order-1] @ B[1:])/T # undo the time scaling

return x_hat, dxdt_hat

Expand Down
4 changes: 2 additions & 2 deletions pynumdiff/tests/test_diff_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ def lineardiff_irreg_step(*args, **kwargs): return lineardiff(*args, **kwargs)
[(1, 1), (3, 3), (1, 1), (3, 3)]],
lineardiff: [[(flr, flr), (flr, flr), (0, -1), (1, 1)],
[(-1, -1), (0, 0), (0, -1), (1, 0)],
[(-1, -1), (1, 1), (0, -1), (1, 1)],
[(-1, -1), (1, 0), (0, -1), (1, 1)],
[(-1, -1), (0, 0), (0, -1), (1, 1)],
[(0, 0), (2, 2), (0, 0), (2, 2)],
[(-1, -1), (2, 2), (0, -1), (2, 2)]],
lineardiff_irreg_step: [[(flr, flr), (flr, flr), (0, -1), (1, 1)],
lineardiff_irreg_step: [[(flr, flr), (flr, flr), (0, -1), (1, 0)],
[(-1, -1), (1, 0), (0, -1), (1, 0)],
[(-1, -1), (0, 0), (0, -1), (1, 1)],
[(-1, -2), (0, 0), (0, -1), (1, 0)],
Expand Down
Loading