superstats.transition.stochastic.gaussian_process#
Gaussian-process transition models.
Functions
|
Vectorized Gaussian process rollout across a batch, filled in place. |
Classes
|
Gaussian process transition model. |
- class superstats.transition.stochastic.gaussian_process.GaussianProcess(kernel='rbf', kernel_params=None, bounds=None, initial_prior=None)[source]#
Bases:
StochasticTransitionGaussian process transition model.
Draws each trajectory as a GP sample with mean start (from initial_prior) and covariance from kernel, then squashes the result into bounds via a scaled sigmoid.
- Parameters:
- kernel{“rbf”, “linear”}
orKernel,default“rbf” Kernel used to build the covariance matrix. Either a registered name or a Kernel instance, including composites built via +/* (e.g. RBFKernel(name=”trend”) + RBFKernel(name=”local”)).
- kernel_params
dict,optional Maps kernel hyperparameter names (see kernel.hyperparam_names, e.g. “length_scale”, “amplitude” for the default RBF kernel) to a Prior (sampled per-batch) or a fixed float. Any name not given here falls back to DEFAULT_HYPER_PRIORS, same as RandomWalk’s sigma/delta. Combining two kernels of the same type requires an explicit name= on each (see Kernel), which prefixes their hyperparameter names accordingly.
- bounds
tupleorNone,optional, default:None Lower and upper bounds for the latent state.
- initial_prior
PriororNone,optional, default:None Prior for the initial latent state.
- kernel{“rbf”, “linear”}
- Parameters:
Notes
The sample method returns a dict with keys local_params, hyper_params and fixed_params, matching RandomWalk.
- superstats.transition.stochastic.gaussian_process.sample_gaussian_process(local_params, start, kernel_mat, bounds, noise=1e-06)[source]#
Vectorized Gaussian process rollout across a batch, filled in place.
- Parameters:
- local_params
np.ndarrayofshape(batch_size,steps) Pre-allocated output array; filled in place with the bounded rollout.
- start
np.ndarrayofshape(batch_size,) Initial state per trajectory, used as the GP sample mean.
- kernel_mat
np.ndarrayofshape(batch_size,steps,steps) Covariance kernel matrix, per trajectory.
- bounds
np.ndarrayofshape(2,) (lower, upper) bounds passed to scaled_sigmoid.
- noise
float,default1e-6 Jitter added to the kernel diagonal for numerical stability during Cholesky decomposition.
- local_params
- Returns:
- local_params
np.ndarrayofshape(batch_size,steps) -thesame array, filled with the bounded Gaussian process rollout
- local_params
- Parameters:
- Return type: