animate_with_periodic_gp

probnumeval.visual.animate_with_periodic_gp(d, num_frames, base_measure_sample=None, endpoint=False)[source]

Animate samples from a standard Normal distribution by drawing samples from a periodic Gaussian process.

Parameters
  • d – Dimension of the underlying multivariate Normal distribution of which samples shall be animated.

  • num_frames – Number of steps to be taken. This can be thought of the number of frames in the final animation.

  • base_measure_sampleShape (num_steps, d). I.i.d. samples from a standard Normal distribution.

  • endpoint – Whether the final state should be equal to the first state. Optional. Default is False.

Returns

Shape (num_steps, d). N steps that traverse the sphere along a (d-1)-dimensional subspace.

Return type

np.ndarray

Examples

>>> import numpy as np
>>> np.random.seed(42)
>>> dim, num_frames = 2, 10
>>> states = animate_with_periodic_gp(dim, num_frames)
>>> print(np.round(states, 1))
[[ 0.5 -0.5]
 [ 0.3 -0.7]
 [ 0.6 -0.3]
 [ 1.6 -1.3]
 [ 1.1 -1.8]
 [ 0.5 -0.5]
 [ 0.3 -0.7]
 [ 0.6 -0.3]
 [ 1.6 -1.3]
 [ 1.1 -1.8]]