Repository navigation
Add plasma model (review required) - #351
Draft
michalkamin wants to merge 1 commit into
Draft
michalkamin wants to merge 1 commit into
michalkamin wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Draft] Add plasma spectroscopy inverse-problem models (Langmore et al. 2022)
Summary
This PR adds a family of Bayesian inverse problems from fusion-plasma spectroscopy, based on
Langmore, I., Dikovsky, M., Geraedts, S., Norgaard, P., von Behren, R. (2022). Hamiltonian Monte Carlo in Inverse Problems; Ill-Conditioning and Multi-Modality. arXiv:2103.07515.
The paper uses this problem to study two difficulties HMC meets in inverse problems: ill-conditioning and multi-modality. It is a physics forward model with a low-rank integration operator, signal-dependent noise and a non-linear geometric parameter. The paper publishes neither its data nor several constants, so all datasets are simulated from the prior with fixed seeds, and the generator scripts are included.
We propose three tiers, from an exactly Gaussian toy to the full non-linear model:
plasma_linear-plasma_linear_noncenteredplasma_linear_noncenteredplasma_linearplasma_linear-plasma_linear_centeredplasma_linear_centeredplasma_linearplasma_shell_lite-plasma_shellplasma_shellplasma_shell_liteplasma_shell_full-plasma_shellplasma_shellplasma_shell_fullThe model
Intuition
A hot plasma (a cloud of ions) glows, but it cannot be observed directly. Detectors look through it along straight lines (chords) and record a spectrum: intensity as a function of frequency. Three spatial fields determine the light each point emits:
Each detector measures only the sum along its chord, so the 2-D fields must be reconstructed from line integrals. The inverse problem is under-determined, so the answer is a posterior over fields.
Shell model (paper Sec. 2.3)
Prior. Each field is described by a radial profile on$R$ nodes $r_1 < \dots < r_R$ , with a smooth Gaussian-process prior
The field is constant on circles around a random centre$c \sim \mathcal N(0, \sigma_c^2 I_2)$ . For pixel $p$ at $x_p \in [-1,1]^2$ , with $r_p = \lVert x_p - c \rVert$ , the profiles are interpolated at $r_p$ and mapped to physical quantities:
Forward model. Each pixel emits a Gaussian line in inverse frequency:
A fixed integration matrix$I \in \mathbb R^{M\times P}$ sums emission along each chord: $\mu_{m}(\nu_k) = \sum_p I_{mp} E_p(\nu_k)$ .
Likelihood (paper eq. 4). There is an additive noise floor plus proportional noise representing model error:
Parameters:$Z_A, Z_T, Z_V \in \mathbb R^R$ and $c_{raw} \in \mathbb R^2$ (with $c = \sigma_c c_{raw}$ ), for a dimension of $3R+2$ . Everything else is data.
Linear Gaussian toy (paper eqs. 1–2, Fig. 4)
The paper's own simplification keeps only the amplitude and drops the softplus and the proportional noise:
The posterior is exactly Gaussian. Two parameterizations are provided:
With the included data, the paper's condition number (eq. 8) of the posterior is 117 (centred) against 3.2 (non-centred), which reproduces the effect shown in the paper's Fig. 4. The two models share one dataset and have the same posterior over
Why these posteriors are interesting
Data: what comes from the paper and what is chosen
The paper does not publish its data. Each dataset is a single draw from the prior followed by simulated noisy measurements, with the seed recorded in the generator script.
Shell model constants
Linear toy constants
Open decisions
These are points where the paper is ambiguous or silent. For each, we state what we implemented and the alternative. Feedback welcome, particularly on D1–D3.
eight_schools)A purely numerical reformulation: the code uses$\tilde\nu^{-1} = (1-\mathcal V)/\nu_0$ directly instead of $\tilde\nu = \nu_0/(1-\mathcal V)$ . This is mathematically identical and avoids a division by zero at $\mathcal V = 1$ .
Questions
lite/fullswitch. Is it fine to have one script perdata-rawfolder that calls the shared generator, or should the code be duplicated?