periodogram
- hana_ml.algorithms.pal.tsa.periodogram.periodogram(data, key=None, endog=None, sampling_rate=None, num_fft=None, freq_range=None, spectrum_type=None, window=None, alpha=None, beta=None, attenuation=None, mode=None, precision=None, r=None)
Periodogram is an estimate of the spectral density of a signal or time series. It can help determine if a particular frequency is a meaningful component of the data or if it is just a random noise.
- Parameters:
- dataDataFrame
The input data should comprise at least two columns. One is ID column, while the other is raw data.
- keystr, optional
The ID column.
Defaults to the first column of data if the index column of data is not provided. Otherwise, defaults to the index column of data.
- endogstr, optional
The column of series to be tested.
Defaults to the first non-key column.
- sampling_ratefloat, optional
Represents the frequency of sampling in the sequence.
Defaults to 1.0.
- num_fftinteger, optional
Denotes the number of DFT (Discrete Fourier Transform) points. If
num_fftis smaller than the length of the input data, the input gets trimmed. If it is larger, the input gets appended with zeroes by default.Defaults to the length of sequence.
- freq_range{"one_side", "two_sides"}, optional
Reflects the desired frequency range for the result.
Defaults to "one_side".
- spectrum_type{"density", "spectrum"}, optional
Indicates the chosen scale type for the power spectrum.
Defaults to "density".
- windowstr, optional
Available input window type:
'none',
'bartlett',
'bartlett_hann',
'blackman',
'blackman_harris',
'bohman',
'chebwin',
'cosine',
'flattop',
'gaussian',
'hamming',
'hann',
'kaiser',
'nuttall',
'parzen',
'tukey'
No default value.
- alphafloat, optional
A window parameter for Blackman and Gaussian window. Only valid for Blackman and Gaussian window. Defaults to: - "Blackman" : 0.16. - "Gaussian" : 2.5.
- betafloat, optional
A parameter specific to the Kaiser window. Only valid for Kaiser window.
Defaults to 8.6.
- attenuationfloat, optional
A parameter specific to the Chebwin window. Only valid for Chebwin window.
Defaults to 50.0.
- mode{'symmetric', 'periodic'}, optional
A parameter specific to the Flattop window. Only valid for Flattop window.
Defaults to 'symmetric'.
- precision{'none', 'octave'}, optional
A parameter specific to the Flattop window. Only valid for Flattop window.
Defaults to 'none'.
- rfloat, optional
A parameter specific to the Tukey window. Only valid for Tukey window.
Defaults to 0.5.
- Returns:
- DataFrame
Result, structured as follows:
ID: ID column.
FREQ: Value of sample frequencies.
PXX: Power spectral density or power spectrum of input data.
Examples
>>> res = periodogram(data=df, key='ID', endog='X', sampling_rate=100, window="hamming", freq_range="two_sides") >>> res.collect()