Implement log spectral density for squared exponential#2143
Open
elliottperryman wants to merge 1 commit intopyro-ppl:masterfrom
Open
Implement log spectral density for squared exponential#2143elliottperryman wants to merge 1 commit intopyro-ppl:masterfrom
elliottperryman wants to merge 1 commit intopyro-ppl:masterfrom
Conversation
Added a new function to compute the log spectral density for the squared exponential kernel,
Collaborator
|
Hi! @elliottperryman Can you elaborate a bit more? (Do you have a reference or example?) |
fehiepsi
reviewed
Feb 27, 2026
| c3 = special.gamma(nu) | ||
| return c1 * c2 / c3 | ||
|
|
||
| # def log_diag_spectral_density_squared_exponential( |
| e = jnp.exp(-0.5 * jnp.sum(w**2 * length**2, axis=-1)) | ||
| return c * e | ||
|
|
||
| def log_spectral_density_squared_exponential( |
Author
|
I have two points that may be of interest to users:
I can make a jupyter notebook demoing the differences if that helps. |
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.
Added a new function to compute the log spectral density for the squared exponential kernel.
I was using HSGP in my numpyro model and found that using the eigenvalues can be computed more stably using the log domain. Treating them in log-space is perfectly fine (alpha > 0 & length > 0 & other term is an exponential). I am not saying my implementation is the best code or something, but I would like to ask if this could be useful.