Cubic Spline Interpolation
This package carries out cubic spline interpolation. The intended use of this package is to solve dynamic decision problems of heterogeneous agents in conjunction with the Sequence-Space Jacobian (SSJ) package.
The approach differs from the CubicSpline method of SciPy in that our package is compatible with Numba commands which increase performance in large problems. However, for now, the package is limited to the natural boundary condition.
In this package, we use basic spline interpolation of exactly degree 3, the cubic spline. We follow the methods found here: https://en.wikipedia.org/wiki/Spline_interpolation. We use the natural boundary condition, which is extends a straight line from the end points at the same slope as that end point. In formal terms, the second derivative at the end points is equal to 0. We make this choice to efficiently solve the interpolation problem. The natural boundary gives a tridiagonal matrix when the constraints are put in matrix form, and this allows for the Thomas algorithm to quickly solve the matrix problem. In SciPy, we can carry out the same interpolation and get very nearly the same results by running
interpolate.CubicSpline(x, y, bc_type='natural')
Installation
cubic_spline runs on NumPy and Numba. The pacakge was developed with Python 3.9 with NumPy version 1.21 and Numba version 0.55. To install run the following command
pip install cubic-spline
Using the Pacakge
cubic_spline.py and tools.py are the necessary files for carrying out cubic interpolation. Users will normally only need to interact with cubic_spline as it contains the high level wrapper functions. The other files, vfi_demo and firm_engine, provide an application of this cubic interpolation package to a heterogeneous firm optimization problem. firm_engine requires the SSJ pacakge to be installed. vfi_demo is a notebook that walks through the canonical lumpy investment problem with value function iteration making use of the cubic_spline methods.
Metadata
Release files for cubic-spline 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cubic-spline-0.1.1.tar.gz | 5.9 kB | Without provenance | Details for cubic-spline-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cubic_spline-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for cubic_spline-0.1.1-py3-none-any.whl |
Total release size: 12.3 kB
Release files / cubic-spline-0.1.1.tar.gz
| Download URL | cubic-spline-0.1.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70697ad9ccdf2277eb2599e367dba697853c272f79075a9182fb6933d934445f
|
|
BLAKE2b-256 checksum How to use checksums |
0c4cd23a81c4fcebcae66a481adcad033c9c3c9b35a924aed0da1ae985a6451a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / cubic_spline-0.1.1-py3-none-any.whl
| Download URL | cubic_spline-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99202cd4d3d72c70488a50754b8fd330e57ea2ed3132006edacce9ca7b4795ec
|
|
BLAKE2b-256 checksum How to use checksums |
903efbe26da405e886555e14894f1c1399bb04e3198ff38736ee3c6fea572201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for cubic-spline 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.