-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add more Gaussian process kernels #234
Comments
Something like the following would cover the main forms discussed in : [https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function]
|
Thanks, this is very helpful! |
To use the Mattern covfun in approximate GP, we just to change the spectral density function (function 'spd' in the Stan code):
All the rest Stan code remains the same. |
Has there been an update on this? I'm new to this package and would like to use a Matern kernel in a model, but I'm not sure where to put the Stan code snippets. |
I think(?) that matern kernels are not supported in Stan itself so supporting them in brms should not be a major issue. Perhaps I find the time in the upcoming weeks. |
For future reference: It seems like the Matern covariance functions are available in The Stan Math library |
Just wanted to voice support for adding a Ornstein–Uhlenbeck option for running a brm() function with a phylogeny. This seems to be the new standard evolutionary covariance structure when dealing with phylogenies, as its more realistic than others (ie, consistent with stabilizing selection). An option of model = "OU", "Brownian" etc would be super helpful. As is, I can't use brms for most phylo analyses. Most recent evol packages (using MLE instead of Bayesian) have about 5 standard options (eg see ?phylopars in Rphylopars). But the most important, by far is the OU one. Would be fantastic to get it into brms! |
Hello, I would like to see the Matern covariance functions (specifically
Thanks! |
Edit: I now see @gabriuma's comment about approximate Matern covariances and see that it should be quite easy so perhaps my third question is moot. |
I will add this issue to the list of issues for the next release to make sure I will at least implement the Matern kernels. I will have to think about the best way to implement different kernels in the Stan code so it is a bit hard for me to suggest concrete steps that you could already take to implement this. |
This has been implemented in #1688. I added matern and exponential kernels including HSGP versions of the matern kernels. If people need other kernels at some point, I suggest to open new issues for these specific kernels. |
Fantastic, thank you! I will install and test it soon, but just a quick note/question: the exponential kernel is a matern kernel (smoothness 1/2), so I was hoping an HSGP approximation is supported but from the way your last comment is worded it seems maybe not? |
Good point. :-D I didn't see the math of the HSGP for Matern 1/2 in our HSGP paper and I didn't have time to do it myself. If you have time to compute the spectral density for this kernel (if it exists) then it would be easy to implement it. @avehtari was there a reason we didn't discuss the Matern 1/2 kernel in our paper? |
Hi,
The spectral density for Matern 1/2 is
s_{\frac{1}{2}}(\bm{\omega})&=
\alpha\,\frac{2^D\pi^{D/2}\Gamma(\frac{D+1}{2})}{\sqrt{\pi}\ell}\left(\frac{1}{\ell^2}+\bm{\omega}^\intercal
\bm{\omega} \right)^{-\frac{D+1}{2}} \label{eq_specdens_12}
For instance, with input dimensionality $D=3$ and
$\bm{\omega}=(\omega_1,\omega_2,\omega_3)^\intercal$, the spectral
density takes the form
s_{\frac{1}{2}}(\bm{\omega})&= \alpha \, 8\,\pi
\prod_{i=1}^{3}\ell_i\left(1+\sum_{i=1}^{3}\ell_i^2 \omega_i^2
\right)^{-2}
Hopely it helps.
Best,
Gabriel
FISABIO, Environment and Health
El lun, 23 sept 2024 a las 16:02, Paul-Christian Bürkner (<
***@***.***>) escribió:
… Good point. :-D
I didn't see the math of the HSGP for Matern 1/2 in our HSGP paper and I
didn't have time to do it myself. If you have time to compute the spectral
density for this kernel (if it exists) then it would be easy to implement
it.
@avehtari <https://github.com/avehtari> was there a reason we didn't
discuss the Matern 1/2 kernel in our paper?
—
Reply to this email directly, view it on GitHub
<#234 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHEXZGTFMIE4IRWGXT6QKF3ZYANPXAVCNFSM6AAAAABJGWVFR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYGM3DKMJTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Perfect! Thank you! |
Trying to get the paper out in finite time? |
Fair point. :-D Thanks! |
Trying to get the paper out in finite time?
basically:-)
We empirically calculated the relationship between HSGP factors (section
4.3) for Matern \inf, 3/2, 5/2, which requires quite a bit of work. In my
experience, these may be the most useful kernels for common applications.
Matern 1/2 is too rough (wiggly) I think.
Gabriel
FISABIO, Environment and Health
El lun, 23 sept 2024 a las 16:53, Paul-Christian Bürkner (<
***@***.***>) escribió:
… Fair point. :-D Thanks!
—
Reply to this email directly, view it on GitHub
<#234 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHEXZGVPNOEWKZ2YYFA25LDZYATNLAVCNFSM6AAAAABJGWVFR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYGUZDQMJZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@gabriuma Matern 1/2 is fairly common in soils and agriculture, maybe it's just a historical accident that should be corrected... or maybe it makes sense because these variables can be very rough with a lot of variation (not measurement error) on very short length scales. Maybe they would be better represented as a sum of two smoother kernels but matern 1/2 could be a decent choice for simplicity. |
HSGPs for the exponential kernel are now supported (via #1688) |
How about HSGP with periodic kernel? I was going to test the Birthdays case study with brms + Pathfinder, but would need periodic HSGP |
yeah should be doable. periodic kernel needs a bit more work because it has
an additional parameter I think. would you mind opening a new issue for it?
Aki Vehtari ***@***.***> schrieb am Sa., 28. Sept. 2024,
20:37:
… How about HSGP with periodic kernel? I was going to test the Birthdays
case study with brms + Pathfinder, but would need periodic HSGP
—
Reply to this email directly, view it on GitHub
<#234 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AADKBMV6EYBWHXGUNTZY3SODAVCNFSM6AAAAABJGWVFR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBQHA2DGOBYHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hi,
We implemented an approximate linear representation of a periodic squared
exponential kernel in our paper. Please read section 3.3, then appendix B,
then section 4.4, and finally case study 5.2.
Gabriel
FISABIO, Environment and Health
El sáb, 28 sept 2024 a las 20:39, Paul-Christian Bürkner (<
***@***.***>) escribió:
… yeah should be doable. periodic kernel needs a bit more work because it
has
an additional parameter I think. would you mind opening a new issue for
it?
Aki Vehtari ***@***.***> schrieb am Sa., 28. Sept. 2024,
20:37:
> How about HSGP with periodic kernel? I was going to test the Birthdays
> case study with brms + Pathfinder, but would need periodic HSGP
>
> —
> Reply to this email directly, view it on GitHub
> <
#234 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ADCW2AADKBMV6EYBWHXGUNTZY3SODAVCNFSM6AAAAABJGWVFR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBQHA2DGOBYHE>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#234 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHEXZGTAVPMFJNAABYZE5G3ZY3ZVHAVCNFSM6AAAAABJGWVFR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBQHA3DANJRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Right now, only the exponentiated-quadratic kernel is supported as it has a native implementation in Stan. However, there seem to be quite a few other kernels worth considering. This issue is ment to provide a list of kernels with results concerning their feasibility in Stan.
The text was updated successfully, but these errors were encountered: