Welcome to sequgen’s documentation!

API Reference

sequgen package

Subpackages

sequgen.deterministic package

Submodules
sequgen.deterministic.boxcar module
sequgen.deterministic.boxcar.boxcar(t_predict, location, width, height=1.0)

Generate a time series containing boxcar function.

Parameters
  • t_predict (Numpy array) – Where you want the model to generate predictions.

  • location (float) – The start (left point) of the plateau.

  • height (float) – The height of the plateau.

  • width (float) – The width of the plateau.

Returns

Numpy array of shape equal to t_predict containing the signal with the boxcar plateau.

sequgen.deterministic.constant module
sequgen.deterministic.constant.constant(t_predict, value)

Generates a time series array with constant value.

Generates a time series array with constant value value for all elements in t_predict.

Args
t_predict:

Numpy array containing the points in time where you want to generate a prediction using the ‘constant’ model.

value:

Value of the dependent variable. Constant for all values of t in t_predict

Returns

Numpy array with equal shape as that of t_predict, filled with constant value value

sequgen.deterministic.normal_peak module
sequgen.deterministic.normal_peak.normal_peak(t_predict, location, stddev=1.0, unit_integral=None, height=None)

Generates a peak whose shape is the gaussian distribution function :param t_predict: Numpy array with points in time where you want the model to generate predictions. :param location: Where you want to place the peak of the curve. :type location: float :param stddev: Shape factor that affects the width of the distribution. :type stddev: float :param height: What the peak height should be. :type height: float :param unit_integral: If true, area under the curve sums to unity :type unit_integral: bool

Returns

Numpy array with shape equal to t_predict, containing the y values for the normal peak curve.

sequgen.deterministic.sine module
sequgen.deterministic.sine.sine(t_predict, wavelength, phase_shift=0, amplitude=1.0, average=0.0)

Generates a sine curve.

Parameters
  • t_predict – Numpy array with points in time where you want the model to generate predictions.

  • phase_shift – How much the phase is shifted in units of t_predict

  • amplitude – Amplitude of the sine.

  • wavelength – Wavelength of the sine in units of t_predict.

  • average – What the average of the sine wave is, i.e. how much the sine wave is offset from y=0.

Returns

Numpy array with shape equal to t_predict, containing the y values for the sine wave curve.

sequgen.deterministic.triangular_peak module
sequgen.deterministic.triangular_peak.triangular_peak(t_predict, width_base_left, width_base_right, location, height=1.0)

Generate a time series containing a triangular peak.

Parameters
  • t_predict (Numpy array) – Where you want the model to generate predictions.

  • width_base_left (float) – The width of the left part of the triangular peak in units of t_predict.

  • width_base_right (float) – The width of the right part of the triangular peak in units of t_predict.

  • height (float) – The height of the peak in user-defined units.

  • location (float) – Where the peak should be placed on the time axis in units of t_predict.

Returns

Numpy array of shape equal to t_predict containing the curve for a triangular peak in user-defined units.

sequgen.samplers package

Submodules
sequgen.samplers.sample_uniform_random module
sequgen.samplers.sample_uniform_random.sample_uniform_random(dimension_names=None, lower_bounds=None, upper_bounds=None)

Takes a uniform random sample from the parameter space.

Parameters
  • dimension_names – Array of names of the dimensions of the parameter space.

  • lower_bounds – Array of lower bounds of the dimensions of the parameter space.

  • upper_bounds – Array of upper bounds of the dimensions of the parameter space.

Returns

Dictionary with keys equal to the dimension names, together representing a uniform random draw from the parameter space.

sequgen.stochastic package

Submodules
sequgen.stochastic.gaussian module
sequgen.stochastic.gaussian.gaussian(t_predict, stddev=1.0, average=0.0, correlation_length=0.0)

Generate an array with an optionally autocorrelated time series of draws from a Normal distribution.

Parameters
  • t_predict (Numpy array) – points in time where you want to generate a prediction using this model.

  • stddev (float) – standard deviation of the Normal distribution that we will be drawing random samples from.

  • average (float) – mean of the Normal distribution that we will be drawing samples from.

  • correlation_length (float) – Correlation length in units of t_predict. Default is 0.0, for uncorrelated samples.

Returns

Numpy array of shape equal to t_predict, where each elem is a random and optionally autocorrelated draw from a Normal distribution.

Submodules

sequgen.dimension module

class sequgen.dimension.Dimension(name: str, lower_bound: Union[float, int], upper_bound: Optional[Union[float, int]] = None)

Bases: object

Class representing one dimension of a parameter space.

Bound

alias of Union[float, int]

sequgen.parameter_space module

class sequgen.parameter_space.ParameterSpace(dimensions: Iterable[sequgen.dimension.Dimension], sampler: Optional[Callable] = None)

Bases: object

Class representing a parameter space.

Dimensions

alias of Iterable[sequgen.dimension.Dimension]

format_str()

Format string that can be used to print formatted information about the dimensions of the parameter space

sample()

Draw a sample from the parameter space. Defaults to uniform random draw.

Indices and tables