https://github.com/mlefkir/pioran.jl
Power spectrum inference of irregularly sampled time series using Gaussian Processes in Julia
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
Power spectrum inference of irregularly sampled time series using Gaussian Processes in Julia
Basic Info
- Host: GitHub
- Owner: mlefkir
- License: mit
- Language: Julia
- Default Branch: main
- Homepage: https://mlefkir.github.io/Pioran.jl/
- Size: 114 MB
Statistics
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 2
- Releases: 9
Topics
Metadata Files
README.md
Pioran is a Julia package to estimate bending power-law power spectrum of time series. This method uses Gaussian process regression with the fast algorithm of Foreman-Mackey, et al. 2017. The bending power-law model is approximated using basis functions as shown in the Figure below:
The method is described in Lefkir et. al 2025, where it is used to model the random flux variability observed in active galaxies.
Installation
julia
using Pkg; Pkg.add("Pioran")
Documentation
Read the documentation here: https://mlefkir.github.io/Pioran.jl/stable/.
Examples
Example scripts are provided in the examples directory. To infer the parameters of the power spectrum, I use either Turing.jl for Hamiltonian Monte Carlo or the Python library ultranest for nested sampling.
Ultranest
Here a very quick example on how to use it with ultranest. I assume you have installed PyCall and ultranest following the guide in the documentation here.
Assuming you have a Gaussian time series y at times t with errorbars σ. The GP can be built using a function as follows:
```julia using Pioran, Distributions
function GPmodel(t, y, σ, params, ncomponents = 20, basis_function = "DRWCelerite") T = (t[end] - t[1]) # duration of the time series Δt = minimum(diff(t)) # min time separation
f_min, f_max = 1 / T, 1 / Δt / 2
# Get the parameters
α₁, f₁, α₂, variance, ν, μ = params
# Rescale the measurement variance
σ² = ν .* σ .^ 2
# Define the power spectral density function
𝓟 = SingleBendingPowerLaw(α₁, f₁, α₂)
# Approximate the PSD to form a covariance function
𝓡 = approx(𝓟, f_min, f_max, n_components, variance, basis_function = basis_function)
# Build the GP
GP = ScalableGP(μ, 𝓡)
# return the conditioned GP on the times and errors and the transformed values
return GP(t, σ²)
end ```
The log-likelihood can be obtained using the logpdf function from Distributions.jl:
julia
function loglikelihood(t, y, σ, params)
GP = GP_model(t, y, σ, params)
return logpdf(GP, y)
end
logl(pars) = loglikelihood(t, y, yerr, pars)
We use distributions from Distributions.jl to define the priors for nested sampling. For this example, we can have:
julia
function prior_transform(cube)
α₁ = quantile(Uniform(0.0, 1.5), cube[1])
f₁ = quantile(LogUniform(1e-3, 1e3), cube[2])
α₂ = quantile(Uniform(α₁, 4.0), cube[3])
variance = quantile(LogNormal(0, 1), cube[4])
ν = quantile(Gamma(2, 0.5), cube[5])
μ = quantile(Normal(x̄, 5 * sqrt(va)), cube[6])
return [α₁, f₁, α₂, variance, ν, μ]
end
paramnames = ["α₁", "f₁", "α₂", "variance", "ν", "μ"]
We can load ultranest using PyCall:
julia
using PyCall
ultranest = pyimport("ultranest")
and start sampling the posterior:
julia
sampler = ultranest.ReactiveNestedSampler(paramnames, logl, resume = true, transform = prior_transform, log_dir = "path/to/dir", vectorized = false)
results = sampler.run()
sampler.print_results()
sampler.plot()
Citing the method
If this method or code was useful to you, you can cite Lefkir et. al 2025 for method and Foreman-Mackey, et al. 2017 for the celerite algorithm.
If you have used ultranest or Turing.jl to sample the posterior, have a look at their documentation on how to cite them properly.
Owner
- Name: Mehdy Lefkir
- Login: mlefkir
- Kind: user
- Location: Toulouse
- Repositories: 2
- Profile: https://github.com/mlefkir
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Lefkir
given-names: Mehdy
orcid: https://orcid.org/0000-0002-6972-2429
title: "Pioran.jl"
version: 1.0.0
identifiers:
- type: doi
value: 10.1093/mnras/staf532
date-released: 2025-07-08
url: "https://github.com/mlefkir/Pioran.jl"
GitHub Events
Total
- Create event: 14
- Commit comment event: 5
- Release event: 3
- Issues event: 7
- Watch event: 9
- Delete event: 15
- Issue comment event: 27
- Push event: 71
- Pull request event: 17
Last Year
- Create event: 14
- Commit comment event: 5
- Release event: 3
- Issues event: 7
- Watch event: 9
- Delete event: 15
- Issue comment event: 27
- Push event: 71
- Pull request event: 17
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 7
- Total pull requests: 38
- Average time to close issues: 3 months
- Average time to close pull requests: 8 days
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 2.43
- Average comments per pull request: 0.34
- Merged pull requests: 33
- Bot issues: 0
- Bot pull requests: 20
Past Year
- Issues: 4
- Pull requests: 17
- Average time to close issues: 10 days
- Average time to close pull requests: 20 days
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 0.5
- Average comments per pull request: 0.76
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 7
Top Authors
Issue Authors
- mlefkir (7)
Pull Request Authors
- github-actions[bot] (30)
- mlefkir (26)
- pre-commit-ci[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 2 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 7
juliahub.com: Pioran
Power spectrum inference of irregularly sampled time series using Gaussian Processes in Julia
- Homepage: https://mlefkir.github.io/Pioran.jl/
- Documentation: https://docs.juliahub.com/General/Pioran/stable/
- License: MIT
-
Latest release: 1.0.0
published about 1 year ago
Rankings
Dependencies
- actions/checkout v2 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v4 composite
- julia-actions/setup-julia v1 composite
- julia-actions/setup-julia v1 composite