pgmuvi.gps¶
- class pgmuvi.gps.AchromaticGPModel(*args: Any, **kwargs: Any)¶
Bases:
SeparableGPModel2D GP model for achromatic (wavelength-independent) variability.
Subclass of
SeparableGPModelthat uses aConstantKernelfor the wavelength dimension, enforcing perfect correlation across wavelengths so that all bands share the same temporal variability pattern (e.g. eclipses, transits, geometric occultations).- Parameters:
train_x (torch.Tensor) – Input of shape
(n, 2)— column 0 is time, column 1 is wavelength.train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
time_kernel_type (str or gpytorch.kernels.Kernel, optional) –
Type of time kernel. Accepted string values:
'matern'(default):ScaleKernel(MaternKernel(nu=1.5))'quasi_periodic':ScaleKernel(PeriodicKernel * RBFKernel)'rbf':ScaleKernel(RBFKernel())'spectral_mixture'/'sm':SpectralMixtureKernel(num_mixtures, ard_num_dims=1)
Alternatively, supply any
gpytorch.kernels.Kernelinstance directly.period (float, optional) – Initial period for the quasi-periodic option. Defaults to half the time span.
num_mixtures (int, optional) – Number of mixture components when
time_kernel_type='spectral_mixture'. Default 4.
Notes
Best suited for eclipses, transits, and other geometric effects that affect all wavelengths equally.
Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import AchromaticGPModel >>> t_data = torch.linspace(0, 10, 50) >>> wl = torch.ones(50) * 550.0 >>> x = torch.stack([t_data, wl], dim=1) >>> y = torch.sin(2 * torch.pi * t_data / 3) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = AchromaticGPModel( ... x, y, lik, time_kernel_type='quasi_periodic', period=3.0 ... )
- class pgmuvi.gps.CustomLinearConstantMean(*args: Any, **kwargs: Any)¶
Bases:
MeanCustom mean function that is linear in wavelength and constant in time.
This is useful for modelling stars whose mean flux changes with wavelength but not time, as most stars do (because they are approximately blackbodies with a fixed temperature).
- forward(x)¶
- class pgmuvi.gps.CustomQuadConstantMean(*args: Any, **kwargs: Any)¶
Bases:
MeanCustom mean function that is quadratic in wavelength and constant in time.
This is useful for modelling stars whose mean flux changes with wavelength but not time, as most stars do (because they are approximately blackbodies with a fixed temperature).
- forward(x)¶
- class pgmuvi.gps.DustMean(*args: Any, **kwargs: Any)¶
Bases:
MeanMean function with dust-extinction wavelength dependence for 2D GP models.
Computes the mean flux following a dust-attenuation law:
m(t, λ) = amplitude * exp(-tau * λ^(-alpha)) + offset
where
tauis the dust optical depth (a positive constant controlling the overall obscuration), andalphais the power-law index of the wavelength-dependent extinction (alpha > 0gives stronger extinction at shorter wavelengths, as observed for interstellar dust).This form is physically motivated for dust-obscured AGB stars, where optical fluxes can be two or three orders of magnitude fainter than infrared fluxes due to circumstellar dust shells.
- Parameters:
batch_shape (torch.Size, optional) – Batch shape for the mean function parameters.
- offset¶
Constant offset (background) term.
- Type:
torch.nn.Parameter
- log_amplitude¶
Log of the amplitude; the amplitude itself is
exp(log_amplitude), ensuring it is always positive.- Type:
torch.nn.Parameter
- log_tau¶
Log of the dust optical depth
tau; the optical depth itself isexp(log_tau), ensuring it is always positive.- Type:
torch.nn.Parameter
- log_alpha¶
Log of the extinction power-law index
alpha; the index itself isexp(log_alpha), ensuring it is always positive. Defaults tolog(1.7)≈ 0.53, corresponding to a typical interstellar dust-extinction law.- Type:
torch.nn.Parameter
Notes
The wavelength axis is expected to be the second column of the input tensor
x. It should be strictly positive (as is the case for physical wavelengths in microns). Wavelength values below1e-6(microns) are clamped to1e-6to avoid numerical overflow inλ^(-alpha); in practice any physically meaningful wavelength (optical ~0.4 μm or longer) is well above this threshold. Applying a wavelength transform (e.g.MinMax) before fitting is still recommended to keep wavelength values in a numerically convenient range.- forward(x)¶
- class pgmuvi.gps.DustMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
WavelengthDependentGPModel2D GP model combining a dust-extinction mean with separable simple kernels.
A convenience subclass of
WavelengthDependentGPModelthat replaces the default quadratic mean function withDustMean:mean: m(t, λ) = amplitude * exp(-tau * λ^(-alpha)) + offset cov: k(t,λ,t',λ') = k_time(t,t') * k_wavelength(λ,λ')
This provides a physically-motivated model for dust-obscured AGB stars built entirely from standard Matérn/RBF kernels rather than the more complex
SpectralMixtureKernel.- Parameters:
train_x (torch.Tensor) – Input of shape
(n, 2)— column 0 is time, column 1 is wavelength.train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
time_kernel_type (str or gpytorch.kernels.Kernel, optional) – Type of time kernel (see
WavelengthDependentGPModel). Defaults to'matern'.wavelength_kernel_type (str or gpytorch.kernels.Kernel, optional) – Type of wavelength kernel (see
WavelengthDependentGPModel). Defaults to'rbf'.period (float, optional) – Initial period for the quasi-periodic time kernel option.
wavelength_lengthscale (float, optional) – Initial wavelength correlation length.
num_mixtures (int, optional) – Number of mixture components when
time_kernel_type='spectral_mixture'. Default 4.**kwargs – Additional keyword arguments forwarded to
WavelengthDependentGPModel.
Notes
See
DustMeanfor the parameterisation of the mean function. For a spectral-mixture covariance variant seeTwoDSpectralMixtureDustMeanGPModel.Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import DustMeanGPModel >>> t_data = torch.linspace(0, 10, 50) >>> wl = torch.linspace(0.4, 2.5, 50) # microns (optical to IR) >>> x = torch.stack([t_data, wl], dim=1) >>> y = torch.exp(-1.0 * wl ** -1.7) + 0.05 * torch.randn(50) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = DustMeanGPModel(x, y, lik)
- class pgmuvi.gps.LinearMeanQuasiPeriodicGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGP1D GP model with a linear trend mean and quasi-periodic kernel.
Like
QuasiPeriodicGPModelbut assumes a linear mean function, suited for sources with a long-term trend plus periodic variations.- Parameters:
train_x (torch.Tensor) – Time stamps (1D tensor).
train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
period (float, optional) – Initial period guess. Defaults to half the data span.
- forward(x)¶
- class pgmuvi.gps.MaternGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGP1D GP model using a Matérn kernel for stochastic variability.
Suitable for red-noise processes such as accretion disk variability in AGN and other stochastic astronomical sources.
- Parameters:
train_x (torch.Tensor) – Time stamps (1D tensor).
train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
nu (float, optional) – Matérn smoothness (0.5 = Ornstein-Uhlenbeck, 1.5, or 2.5). Default 1.5.
lengthscale (float, optional) – Initial lengthscale. Defaults to one-quarter of the data span.
Notes
Recommended for accretion disk variability, AGN, and stochastic red-noise characteristics.
Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import MaternGPModel >>> t = torch.linspace(0, 20, 100) >>> y = torch.randn(100) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = MaternGPModel(t, y, lik, nu=0.5)
- forward(x)¶
- class pgmuvi.gps.PeriodicPlusStochasticGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGP1D GP model combining quasi-periodic and stochastic components.
Decomposes the signal as:
k(x,x') = k_quasi_periodic(x,x') + k_rbf(x,x')- Parameters:
train_x (torch.Tensor) – Time stamps (1D tensor).
train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
period (float, optional) – Initial period guess. Defaults to half the data span.
Notes
Recommended for spotted stars with rotation plus stochastic variations.
Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import PeriodicPlusStochasticGPModel >>> t = torch.linspace(0, 20, 100) >>> y = torch.sin(2 * torch.pi * t / 5) + 0.3 * torch.randn(100) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = PeriodicPlusStochasticGPModel(t, y, lik, period=5.0)
- forward(x)¶
- class pgmuvi.gps.PowerLawMean(*args: Any, **kwargs: Any)¶
Bases:
MeanMean function with power-law wavelength dependence for 2D GP models.
Computes the mean flux as a power law in the second input dimension (wavelength):
m(t, λ) = offset + weight * λ^exponent
This is more realistic than a linear mean function for AGB stars and other variable stars where the variability amplitude and mean flux can vary steeply with wavelength. A negative
exponentgives higher flux at shorter (optical) wavelengths; a positiveexponentgives higher flux at longer (infrared) wavelengths.- Parameters:
batch_shape (torch.Size, optional) – Batch shape for the mean function parameters.
- offset¶
Constant offset term.
- Type:
torch.nn.Parameter
- weight¶
Amplitude scaling factor (unconstrained; sign determines whether flux increases or decreases with wavelength).
- Type:
torch.nn.Parameter
- exponent¶
Power-law exponent for the wavelength dependence. Defaults to
-2.0, which gives a steep decline from optical to infrared (i.e., high optical amplitude).- Type:
torch.nn.Parameter
Notes
The
exponentparameter is unconstrained and can be learned to any real value during optimisation. Initialising it to a physically motivated value (e.g.-1.7for a typical dust-extinction law, or2.0for a Rayleigh-Jeans tail) can help convergence.- forward(x)¶
- class pgmuvi.gps.PowerLawMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
WavelengthDependentGPModel2D GP model combining a power-law wavelength mean with separable simple kernels.
A convenience subclass of
WavelengthDependentGPModelthat replaces the default quadratic mean function withPowerLawMean:mean: m(t, λ) = offset + weight * λ^exponent cov: k(t,λ,t',λ') = k_time(t,t') * k_wavelength(λ,λ')
This provides a physically-motivated model for variable stars with steep wavelength-dependent mean flux, built entirely from standard Matérn/RBF kernels rather than the more complex
SpectralMixtureKernel.- Parameters:
train_x (torch.Tensor) – Input of shape
(n, 2)— column 0 is time, column 1 is wavelength.train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
time_kernel_type (str or gpytorch.kernels.Kernel, optional) – Type of time kernel (see
WavelengthDependentGPModel). Defaults to'matern'.wavelength_kernel_type (str or gpytorch.kernels.Kernel, optional) – Type of wavelength kernel (see
WavelengthDependentGPModel). Defaults to'rbf'.period (float, optional) – Initial period for the quasi-periodic time kernel option.
wavelength_lengthscale (float, optional) – Initial wavelength correlation length.
num_mixtures (int, optional) – Number of mixture components when
time_kernel_type='spectral_mixture'. Default 4.**kwargs – Additional keyword arguments forwarded to
WavelengthDependentGPModel.
Notes
See
PowerLawMeanfor the parameterisation of the mean function. For a spectral-mixture covariance variant seeTwoDSpectralMixturePowerLawMeanGPModel.Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import PowerLawMeanGPModel >>> t_data = torch.linspace(0, 10, 50) >>> wl = torch.linspace(0.4, 2.5, 50) # microns >>> x = torch.stack([t_data, wl], dim=1) >>> y = wl ** -1.7 + 0.05 * torch.randn(50) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = PowerLawMeanGPModel(x, y, lik)
- class pgmuvi.gps.QuasiPeriodicGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGP1D GP model using a quasi-periodic kernel.
Models signals that are approximately periodic but whose amplitude or phase evolves slowly over time. The covariance is:
k(x,x') = σ² · k_periodic(x,x') · k_rbf(x,x')
where
k_periodicis GPyTorch’sPeriodicKernelandk_rbfprovides the long-term amplitude decay.- Parameters:
train_x (torch.Tensor) – Time stamps (1D tensor).
train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
period (float, optional) – Initial period guess. If None, defaults to half the data span.
Notes
Recommended for pulsating stars and eclipsing binaries with stable periods. Uses far fewer parameters than a SpectralMixture kernel.
Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import QuasiPeriodicGPModel >>> t = torch.linspace(0, 20, 100) >>> y = torch.sin(2 * torch.pi * t / 5) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = QuasiPeriodicGPModel(t, y, lik, period=5.0)
- forward(x)¶
- class pgmuvi.gps.SeparableGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGP2D GP model with a separable (product) kernel for multiwavelength data.
The covariance factorizes as:
k(t, l, t', l') = k_time(t, t') * k_wavelength(l, l')
This is implemented natively via GPyTorch’s
ProductKernelwithactive_dimsset on each component, with no custom kernel code required.- Parameters:
train_x (torch.Tensor) – Input of shape
(n, 2)— column 0 is time, column 1 is wavelength.train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
time_kernel (gpytorch.kernels.Kernel, optional) – Kernel for the temporal dimension (
active_dimswill be set to[0]automatically). Defaults to a scaled Matérn-1.5.wavelength_kernel (gpytorch.kernels.Kernel, optional) – Kernel for the wavelength dimension (
active_dimswill be set to[1]automatically). Defaults to a scaled RBF.
Notes
For common special cases see
AchromaticGPModelandWavelengthDependentGPModel.- forward(x)¶
- class pgmuvi.gps.SparseSpectralMixtureGPModel(*args: Any, **kwargs: Any)¶
Bases:
ApproximateGPA one-dimensional GP model using a spectral mixture kernel
A longer description goes here
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.SpectralMixtureGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA one-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is constant.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.SpectralMixtureKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA one-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is constant. It uses the Kernel interpolation for scalable structured Gaussian processes (KISS-GP) approximation to enable scaling to much larger datasets. This means it becomes effective when your dataset exceeds ~10,000 entries; for smaller datasets, the overhead of interpolation is typically not worth the effort.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
grid_size (int) – The number of points to use in the kernel interpolation grid.
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.SpectralMixtureLinearMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA one-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is a linear function.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.SpectralMixtureLinearMeanKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA one-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is a linear function. It uses the Kernel interpolation for scalable structured Gaussian processes (KISS-GP) approximation to enable scaling to much larger datasets. This means it becomes effective when your dataset exceeds ~10,000 entries; for smaller datasets, the overhead of interpolation is typically not worth the effort.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
grid_size (int) – The number of points to use in the kernel interpolation grid.
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureDustMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model with a dust-extinction wavelength mean function.
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. The mean function follows a dust-attenuation law in the wavelength dimension:
m(t, λ) = amplitude * exp(-tau * λ^(-alpha)) + offset
where
tau > 0is the dust optical depth andalpha > 0is the power-law index of the wavelength-dependent extinction. This is physically motivated for dust-obscured AGB stars where optical (short wavelength) fluxes can be two to three orders of magnitude fainter than infrared fluxes (case b). It supports datasets with two independent variables (e.g. time and wavelength).- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths), shape (N, 2).
train_y (Tensor) – The data for the dependent variable (typically flux).
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model.
num_mixtures (int) – Number of components in the Mixture Model.
Examples
Notes
See
DustMeanfor details of the mean-function parameterisation.- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureDustMeanKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional KISS-GP model with a dust-extinction wavelength mean function.
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. The mean function follows a dust-attenuation law in the wavelength dimension:
m(t, λ) = amplitude * exp(-tau * λ^(-alpha)) + offset
where
tau > 0is the dust optical depth andalpha > 0is the power-law index of the wavelength-dependent extinction. This is physically motivated for dust-obscured AGB stars where optical (short wavelength) fluxes can be two to three orders of magnitude fainter than infrared fluxes (case b). It supports datasets with two independent variables (e.g. time and wavelength) and uses the Kernel Interpolation for Scalable Structured Gaussian Processes (KISS-GP) approximation to scale to larger datasets.- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths), shape (N, 2).
train_y (Tensor) – The data for the dependent variable (typically flux).
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model.
num_mixtures (int) – Number of components in the Mixture Model.
grid_size (list of int, optional) – The number of grid points per dimension for the KISS-GP approximation. Defaults to
[5000, 20].
Examples
Notes
See
DustMeanfor details of the mean-function parameterisation.- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is constant. It supports datasets with two independent variables (e.g. time and wavelength).
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is constant. It supports datasets with two independent variables (e.g. time and wavelength). It uses the Kernel interpolation for scalable structured Gaussian processes (KISS-GP) approximation to enable scaling to much larger datasets. This means it becomes effective when your dataset exceeds ~10,000 entries; for smaller datasets, the overhead of interpolation is typically not worth the effort.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
grid_size ((2x1) iterable of ints) – The number of points to use in the kernel interpolation grid, with one value per dimension.
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureLinearMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is a linear function. It supports datasets with two independent variables (e.g. time and wavelength).
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixtureLinearMeanKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model using a spectral mixture kernel
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. This model assumes the mean is a linear function. It supports datasets with two independent variables (e.g. time and wavelength). It uses the Kernel interpolation for scalable structured Gaussian processes (KISS-GP) approximation to enable scaling to much larger datasets. This means it becomes effective when your dataset exceeds ~10,000 entries; for smaller datasets, the overhead of interpolation is typically not worth the effort.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps)
train_y (Tensor) – The data for the dependent variable (typically flux)
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model
num_mixtures (int) – Number of components in the Mixture Model. More mixtures gives more flexibility, but more hyperparameters and more complex inference
grid_size ((2x1) iterable of ints) – The number of points to use in the kernel interpolation grid, with one value per dimension.
Examples
Notes
- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixturePowerLawMeanGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional GP model with a power-law wavelength mean function.
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. The mean function follows a power law in the wavelength dimension:
m(t, λ) = offset + weight * λ^exponent
This is more physically realistic than a linear mean for AGB stars and other variable stars where the variability amplitude (case a) varies steeply with wavelength. It supports datasets with two independent variables (e.g. time and wavelength).
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths), shape (N, 2).
train_y (Tensor) – The data for the dependent variable (typically flux).
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model.
num_mixtures (int) – Number of components in the Mixture Model.
Examples
Notes
See
PowerLawMeanfor details of the mean-function parameterisation.- forward(x)¶
- class pgmuvi.gps.TwoDSpectralMixturePowerLawMeanKISSGPModel(*args: Any, **kwargs: Any)¶
Bases:
ExactGPA two-dimensional KISS-GP model with a power-law wavelength mean function.
A Gaussian Process which uses a Spectral Mixture Kernel to model the Power Spectral Density of the covariance matrix as a Gaussian Mixture Model. The mean function follows a power law in the wavelength dimension:
m(t, λ) = offset + weight * λ^exponent
This is more physically realistic than a linear mean for AGB stars and other variable stars where the variability amplitude (case a) varies steeply with wavelength. It supports datasets with two independent variables (e.g. time and wavelength) and uses the Kernel Interpolation for Scalable Structured Gaussian Processes (KISS-GP) approximation to scale to larger datasets.
- Parameters:
train_x (Tensor) – The data for the independent variable (typically timestamps and wavelengths), shape (N, 2).
train_y (Tensor) – The data for the dependent variable (typically flux).
likelihood (a Likelihood object or subclass) – The likelihood that will be used to evaluate the model.
num_mixtures (int) – Number of components in the Mixture Model.
grid_size (list of int, optional) – The number of grid points per dimension for the KISS-GP approximation. Defaults to
[5000, 20].
Examples
Notes
See
PowerLawMeanfor details of the mean-function parameterisation.- forward(x)¶
- class pgmuvi.gps.WavelengthDependentGPModel(*args: Any, **kwargs: Any)¶
Bases:
SeparableGPModel2D GP model with smooth wavelength-dependent variability.
Subclass of
SeparableGPModelthat uses a smooth kernel for the wavelength dimension, capturing correlated flux changes across nearby wavelengths (e.g. temperature-driven variability, spot models with wavelength-dependent contrast).- Parameters:
train_x (torch.Tensor) – Input of shape
(n, 2)— column 0 is time, column 1 is wavelength.train_y (torch.Tensor) – Observed values (1D tensor).
likelihood (gpytorch.likelihoods.Likelihood) – Likelihood function for the model.
time_kernel_type (str or gpytorch.kernels.Kernel, optional) –
Type of time kernel. Accepted string values:
'matern'(default):ScaleKernel(MaternKernel(nu=1.5))'quasi_periodic':ScaleKernel(PeriodicKernel * RBFKernel)'rbf':ScaleKernel(RBFKernel())'spectral_mixture'/'sm':SpectralMixtureKernel(num_mixtures, ard_num_dims=1)
Alternatively, supply any
gpytorch.kernels.Kernelinstance.wavelength_kernel_type (str or gpytorch.kernels.Kernel, optional) –
Type of wavelength kernel. Accepted string values:
'rbf'(default):ScaleKernel(RBFKernel())'matern':ScaleKernel(MaternKernel(nu=1.5))'rational_quadratic'/'rq':ScaleKernel(RQKernel())
Alternatively, supply any
gpytorch.kernels.Kernelinstance directly (a warning will be emitted to prompt a suitability check).period (float, optional) – Initial period for the quasi-periodic option. Defaults to half the time span.
wavelength_lengthscale (float, optional) – Initial wavelength correlation length. Defaults to half the wavelength span (minimum 1.0).
num_mixtures (int, optional) – Number of mixture components when
time_kernel_type='spectral_mixture'. Default 4.add_flicker (bool, optional) –
When
Trueandtime_kernel_typeis'spectral_mixture'/'sm', an additional flicker component is added to the spectral-mixture kernel to capture short-timescale stochastic variability unrelated to the periodic signal of interest. DefaultFalse.Warning
This is a work-in-progress feature whose stability has not yet been confirmed. A
UserWarningis raised when this option is enabled.mean_module (str or gpytorch.means.Mean, optional) –
Mean function for the GP. Accepted string values:
None/'quad'/'quadratic':CustomQuadConstantMean(default — quadratic in wavelength, constant in time).'linear'/'linear_mean':CustomLinearConstantMean.'constant'/'constant_mean':ConstantMean.'dust'/'dust_mean':DustMean— physically motivated dust-attenuation law.'power_law'/'power_law_mean':PowerLawMean— power-law wavelength dependence.
Alternatively, supply any
gpytorch.means.Meaninstance directly.
Notes
Best suited for temperature-driven variability and spot models where the variability amplitude changes smoothly with wavelength.
To model dust-obscured sources (e.g. AGB stars) combine
mean_module='dust'with this model’s separable Matérn/RBF kernel structure — this is equivalent toDustMeanGPModel. For a simple power-law wavelength dependence usemean_module='power_law'(equivalent toPowerLawMeanGPModel).Examples
>>> import torch, gpytorch >>> from pgmuvi.gps import WavelengthDependentGPModel >>> t_data = torch.linspace(0, 10, 50) >>> wl = torch.linspace(400, 900, 50) >>> x = torch.stack([t_data, wl], dim=1) >>> y = torch.sin(2 * torch.pi * t_data / 3) * (wl / wl.mean()) >>> lik = gpytorch.likelihoods.GaussianLikelihood() >>> model = WavelengthDependentGPModel(x, y, lik)