Skip to content

Commit 9c79a27

Browse files
committed
changed wording
1 parent 18e78d2 commit 9c79a27

8 files changed

Lines changed: 27 additions & 24 deletions

File tree

LICENSE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021
3+
Copyright (c) 2025
44
Floris van Breugel, The University of Nevada, Reno, Mechanical Engineering Department
5+
Pavel Komarov, Univerity of Washington Electrical and Computer Engineering
56
Yuying Liu, The University of Washington Applied Math Department
67

78
Permission is hereby granted, free of charge, to any person obtaining a copy

docs/source/LICENSE.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
License
2-
==============
2+
=======
33

44
The MIT License (MIT)
55

6-
Copyright (c) 2021
6+
Copyright (c) 2025
77
Floris van Breugel, The University of Nevada, Reno, Mechanical Engineering Department
8-
Yuying Liu, The University of Washington Applied Math Department
98
Pavel Komarov, Univerity of Washington Electrical and Computer Engineering
9+
Yuying Liu, The University of Washington Applied Math Department
1010

1111
Permission is hereby granted, free of charge, to any person obtaining a copy
1212
of this software and associated documentation files (the "Software"), to deal

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'PyNumDiff'
23-
copyright = '2025, Floris van Breugel, Yuying Liu, Pavel Komarov'
24-
author = 'Floris van Breugel, Yuying Liu, Pavel Komarov'
23+
copyright = '2025, Floris van Breugel, Pavel Komarov, Yuying Liu'
24+
author = 'Floris van Breugel, Pavel Komarov, Yuying Liu'
2525

2626
# The full version, including alpha/beta/rc tags
2727
release = '0.1.2'

docs/source/contact.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Contact
44
Feel free to contact the author for any information.
55

66
- Floris van Breugel: fvanbreugel@unr.edu
7+
- Pavel Komarov: pvlkmrv@uw.edu
78
- Yuying Liu: liuyuyingufo@gmail.com

pynumdiff/kalman_smooth/_kalman_smooth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def kalman_filter(y, _t, xhat0, P0, A, Q, C, R, B=None, u=None, save_P=True):
88
99
:param np.array y: series of measurements, stacked along axis 0.
1010
:param float or array[float] _t: This function supports variable step size. This parameter is either the constant
11-
dt if given as a single float, or sample locations if given as an array of same length as :code:`x`.
11+
step size if given as a single float, or sample locations if given as an array of same length as :code:`x`.
1212
:param np.array xhat0: a priori guess of initial state at the time of the first measurement
1313
:param np.array P0: a priori guess of state covariance at the time of first measurement (often identity matrix)
1414
:param np.array A: state transition matrix, in discrete time if constant dt, in continuous time if variable dt
@@ -77,7 +77,7 @@ def rts_smooth(_t, A, xhat_pre, xhat_post, P_pre, P_post, compute_P_smooth=True)
7777
"""Perform Rauch-Tung-Striebel smoothing, using information from forward Kalman filtering.
7878
7979
:param float or array[float] _t: This function supports variable step size. This parameter is either the constant
80-
dt if given as a single float, or sample locations if given as an array of same length as the state histories.
80+
step size if given as a single float, or sample locations if given as an array of same length as the state histories.
8181
:param np.array A: state transition matrix, in discrete time if constant dt, in continuous time if variable dt
8282
:param list[np.array] xhat_pre: a priori estimates of xhat from a kalman_filter forward pass
8383
:param list[np.array] xhat_post: a posteriori estimates of xhat from a kalman_filter forward pass
@@ -110,7 +110,7 @@ def rtsdiff(x, _t, order, qr_ratio, forwardbackward):
110110
111111
:param np.array[float] x: data series to differentiate
112112
:param float or array[float] _t: This function supports variable step size. This parameter is either the constant
113-
dt if given as a single float, or data locations if given as an array of same length as :code:`x`.
113+
step size if given as a single float, or data locations if given as an array of same length as :code:`x`.
114114
:param int order: which derivative to stabilize in the constant-derivative model
115115
:param qr_ratio: the process noise level of the divided by the measurement noise level, because,
116116
per `our analysis <https://github.com/florisvb/PyNumDiff/issues/139>`_, the mean result is

pynumdiff/linear_model/_linear_model.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,17 @@ def spectraldiff(x, dt, params=None, options=None, high_freq_cutoff=None, even_e
231231

232232

233233
def rbfdiff(x, _t, sigma=1, lmbd=0.01):
234-
"""Find smoothed function and derivative estimates by fitting noisy data against a radial-basis-function-filled
235-
kernel (naively NxN but made sparse by truncating tiny values). This function uses a Gaussian kernel, thereby
236-
assuming the signal is generated from a Gaussian process, effectively the same assumption the Kalman filter makes.
237-
It can handle variable step size just as easily as uniform step size.
234+
"""Find smoothed function and derivative estimates by fitting noisy data with radial-basis-functions. Naively,
235+
fill a matrix with basis function samples, similar to the implicit inverse problem of spectral methods, but
236+
truncate tiny values to make columns sparse. Each basis function "hill" is topped with a "tower" of height
237+
:code:`lmbd` to reach noisy data samples, and the final smoothed reconstruction is found by razing these and only
238+
keeping the hills.
238239
239240
:param np.array[float] x: data to differentiate
240241
:param float or array[float] _t: This function supports variable step size. This parameter is either the constant
241242
:math:`\\Delta t` if given as a single float, or data locations if given as an array of same length as :code:`x`.
242-
:param float sigma: controls width of radial basis function
243-
:param float lmbd: controls strength of bias toward data
243+
:param float sigma: controls width of radial basis functions
244+
:param float lmbd: controls smoothness
244245
245246
:return: tuple[np.array, np.array] of\n
246247
- **x_hat** -- estimated (smoothed) x
@@ -255,10 +256,10 @@ def rbfdiff(x, _t, sigma=1, lmbd=0.01):
255256
# The below does the approximate equivalent of this code, but sparsely in O(N sigma^2), since the rbf falls off rapidly
256257
# t_i, t_j = np.meshgrid(t,t)
257258
# r = t_j - t_i # radius
258-
# rbf = np.exp(-(r**2) / (2 * sigma**2)) # radial basis function kernel
259+
# rbf = np.exp(-(r**2) / (2 * sigma**2)) # radial basis function kernel, O(N^2) entries
259260
# drbfdt = -(r / sigma**2) * rbf # derivative of kernel
260261
# rbf_regularized = rbf + lmbd*np.eye(len(t))
261-
# alpha = np.linalg.solve(rbf_regularized, x)
262+
# alpha = np.linalg.solve(rbf_regularized, x) # O(N^3)
262263

263264
cutoff = np.sqrt(-2 * sigma**2 * np.log(1e-4))
264265
rows, cols, vals, dvals = [], [], [], []
@@ -272,9 +273,9 @@ def rbfdiff(x, _t, sigma=1, lmbd=0.01):
272273
dv = -radius / sigma**2 * v
273274
rows.append(n); cols.append(j); vals.append(v); dvals.append(dv)
274275

275-
rbf = sparse.csr_matrix((vals, (rows, cols)), shape=(len(t), len(t))) # Build sparse kernels
276+
rbf = sparse.csr_matrix((vals, (rows, cols)), shape=(len(t), len(t))) # Build sparse kernels, O(N sigma) entries
276277
drbfdt = sparse.csr_matrix((dvals, (rows, cols)), shape=(len(t), len(t)))
277-
rbf_regularized = rbf + lmbd*sparse.eye(len(t), format="csr")
278-
alpha = sparse.linalg.spsolve(rbf_regularized, x) # solve sparse system
278+
rbf_regularized = rbf + lmbd*sparse.eye(len(t), format="csr") # identity matrix gives a little extra height at the centers
279+
alpha = sparse.linalg.spsolve(rbf_regularized, x) # solve sparse system targeting the noisy data, O(N sigma^2)
279280

280-
return rbf @ alpha, drbfdt @ alpha
281+
return rbf @ alpha, drbfdt @ alpha # find samples of reconstructions using the smooth bases

pynumdiff/utils/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def integrate_dxdt_hat(dxdt_hat, _t):
101101
"""Wrapper for scipy.integrate.cumulative_trapezoid
102102
103103
:param np.array[float] dxdt_hat: estimate derivative of timeseries
104-
:param float _t: stepsize if given as a scalar or a vector of sample locations
104+
:param float _t: step size if given as a scalar or a vector of sample locations
105105
106106
:return: **x_hat** (np.array[float]) -- integral of dxdt_hat
107107
"""

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ readme = "README.md"
1010
license = {text = "MIT"}
1111
maintainers = [
1212
{name = "Floris van Breugel", email = "fvanbreugel@unr.edu"},
13-
{name = "Yuying Liu", email = "yliu814@uw.edu"},
14-
{name = "Pavel Komarov", email = "pvlkmrv@uw.edu"}
13+
{name = "Pavel Komarov", email = "pvlkmrv@uw.edu"},
14+
{name = "Yuying Liu", email = "yliu814@uw.edu"}
1515
]
1616
keywords = ["derivative", "smoothing", "curve fitting", "optimization", "total variation"]
1717
classifiers = [

0 commit comments

Comments
 (0)