add functionality to interpolate in look-up tables
維護者通常 1 天內回覆
@SteveBronder 已經在處理了。
開始於 2026年8月26日。
評估
這個 Issue 還沒有評估資料。
描述
Many scientific and technical models incoporate tabulated data as part of the model definition. For example, to model temperature changes in some material where the heat capacity depends on temperature, one may need to compute the heat capacities at arbitrary temperatures even if measured values are only available at some specific temperatures. Many scientific computing tools implement various methods to interpolate in tabulated data, but Stan does not (as far as I know).
I think it would be good to add such functionality, as this would expand the scope of problems that can be modelled with Stan.
There are a lot of interpolation methods out there. To start with, I used OPenAI Codex to generate simple stan code for two common interpolation methods: PCHIP (Piecewise Cubic Hermite Interpolating Polynomial) and cubic natural splines. Both have continuous first derivatives which I think is good for HMC simulations. (Piece-wise linear interpolation does not, and was not included). The code is available here: https://github.com/bmelinden/stan_interpolation, and include scripts that demonstrate both their use in Stan and good agreement with corresponding interpolation methods in R.
Both are implemented as two-step calls. First a setup using the tabulated data
W = pchip_setup(xk, yk);
and then interpolated values can be calculated as
y = pchip_eval(x, W);
Versions of these interpolation methods are available in for example Matlab (pchip, spline), Boost interpolation, scipy interpolate, and R (pracma pchip, splinefun). In fact, most software packages supply more interpolation methods than that, but these two may be a good enough start.
I would be happy to work more on this, but I am unsure on how to proceed.
- 主要語言
- C++
- 星號
- 845
- 分支
- 225
- 平均合併
- 4 天 21 小時
- 30 天內合併 PR
- 13
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
stan-dev/math 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 54/100
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 54/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
-
numerics performance
難度 5/5 一週以上 新手友好度 35/100
stan-dev/math#3481 · 1 個 reaction ·
維護者通常 1 天內回覆
-
`eigendecompose_sym`, `eigenvalues_sym` and `eigenvectors_sym` do not compile for complex matrices of `fvar<var>` or `fvar<fvar<double>>`可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug
難度 3/5 1-2 天 新手友好度 55/100
維護者通常 1 天內回覆
相似的 Issue
-
area:qmc bug
難度 2/5 1-3 小時 新手友好度 69/100
維護者通常 3 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 74/100
ASGC-Game-Jam/asgc-gamejam-2026#563 ·
維護者通常 1 天內回覆
-
area/ysql kind/bug priority/medium status/awaiting-triage
難度 2/5 1-3 小時 新手友好度 78/100
yugabyte/yugabyte-db#37523 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
Cockatrice/Cockatrice#7896 ·
維護者通常 1 天內回覆
-
mlir
難度 2/5 1-3 小時 新手友好度 72/100
llvm/llvm-project#241070 · 1 則留言 ·
維護者通常 1 天內回覆