Differentiate a z-series. The derivative is with respect to x, not z. This is achieved using the chain rule and the value of dx/dz given in the module notes. Parameters ---------- zs : z-series The z-series to differentiate. Returns ------- derivative : z-s
(zs)
| 274 | |
| 275 | |
| 276 | def _zseries_der(zs): |
| 277 | """Differentiate a z-series. |
| 278 | |
| 279 | The derivative is with respect to x, not z. This is achieved using the |
| 280 | chain rule and the value of dx/dz given in the module notes. |
| 281 | |
| 282 | Parameters |
| 283 | ---------- |
| 284 | zs : z-series |
| 285 | The z-series to differentiate. |
| 286 | |
| 287 | Returns |
| 288 | ------- |
| 289 | derivative : z-series |
| 290 | The derivative |
| 291 | |
| 292 | Notes |
| 293 | ----- |
| 294 | The zseries for x (ns) has been multiplied by two in order to avoid |
| 295 | using floats that are incompatible with Decimal and likely other |
| 296 | specialized scalar types. This scaling has been compensated by |
| 297 | multiplying the value of zs by two also so that the two cancels in the |
| 298 | division. |
| 299 | |
| 300 | """ |
| 301 | n = len(zs) // 2 |
| 302 | ns = np.array([-1, 0, 1], dtype=zs.dtype) |
| 303 | zs *= np.arange(-n, n + 1) * 2 |
| 304 | d, r = _zseries_div(zs, ns) |
| 305 | return d |
| 306 | |
| 307 | |
| 308 | def _zseries_int(zs): |
nothing calls this directly
no test coverage detected
searching dependent graphs…