Third-order Spectral Representation Method
The third-order Spectral Representation Method (or Bispectral Representation Method) is a generalization of the SpectralRepresentation for processes possessing a known power spectrum and bispectrum. Implementation follows from references [61] and [62]. The multi-variate formulation from reference [63] is not currently implemented.
BispectralRepresentation Class
The BispectralRepresentation class is imported using the following command:
>>> from UQpy.stochastic_process.BispectralRepresentation import BispectralRepresentation
Methods
- class BispectralRepresentation(n_samples, power_spectrum, bispectrum, time_interval, frequency_interval, n_time_intervals, n_frequency_intervals, case='uni', random_state=None)[source]
A class to simulate non-Gaussian stochastic processes from a given power spectrum and bispectrum based on the 3-rd order Spectral Representation Method. This class can simulate uni-variate, one-dimensional and multi-dimensional stochastic processes.
- Parameters:
n_samples (
int) – Number of samples of the stochastic process to be simulated. Therun()method is automatically called if n_samples is provided. If n_samples is not provided, then theBispectralRepresentationobject is created but samples are not generated.power_spectrum (
Union[list,ndarray]) –The discretized power spectrum. - For uni-variate, one-dimensional processes power_spectrum will be
listornumpy.ndarrayof length n_frequency_intervals.For uni-variate, multi-dimensional processes, power_spectrum will be a
listornumpy.ndarrayof size(n_frequency_intervals[0], ..., n_frequency_intervals[n_dimensions-1])
bispectrum (
Union[list,ndarray]) –The prescribed bispectrum. - For uni-variate, one-dimensional processes, bispectrum will be a
listornumpy.ndarrayof size(n_frequency_intervals, n_frequency_intervals)For uni-variate, multi-dimensional processes, bispectrum will be a
listornumpy.ndarrayof size(n_frequency_intervals[0], ..., n_frequency_intervals[n_dimensions-1], n_frequency_intervals[0], ..., n_frequency_intervals[n_dimensions-1])
time_interval (
Union[list,ndarray]) – Length of time discretizations (\(\Delta t\)) for each dimension of size n_dimensions.frequency_interval (
Union[list,ndarray]) – Length of frequency discretizations (\(\Delta \omega\)) for each dimension of size n_dimensions.n_time_intervals (
Union[list,ndarray]) – Number of time discretizations for each dimensions of size n_dimensions.n_frequency_intervals (
Union[list,ndarray]) – Number of frequency discretizations for each dimension of size n_dimensions.random_state (
Union[None,int,RandomState]) – Random seed used to initialize the pseudo-random number generator. Default isNone. If anintis provided, this sets the seed for an object ofnumpy.random.RandomState. Otherwise, the object itself can be passed directly.
- run(n_samples)[source]
Execute the random sampling in the
BispectralRepresentationclass.The
run()method is the function that performs random sampling in theBispectralRepresentationclass. If n_samples is provided, therun()method is automatically called when theBispectralRepresentationobject is defined. The user may also call therun()method directly to generate samples. Therun()method of theBispectralRepresentationclass can be invoked many times and each time the generated samples are appended to the existing samples.- Parameters:
n_samples (
int) – Number of samples of the stochastic process to be simulated. If therun()method is invoked multiple times, the newly generated samples will be appended to the existing samples.
The
run()method has no returns, although it creates and/or appends thesamplesattribute of theBispectralRepresentationclass.
Attributes
-
BispectralRepresentation.phi:
ndarray The random phase angles used in the simulation of the stochastic process. The shape of the phase angles
(n_samples, n_variables, n_frequency_intervals[0], ..., n_frequency_intervals[n_dimensions-1])