JuliaDynamics / TimeseriesSurrogates.jl

A Julia package for generating timeseries surrogates
https://juliadynamics.github.io/TimeseriesSurrogates.jl/stable/
Other
46 stars 8 forks source link

Powerlaw spectrum surrogates #146

Open Datseris opened 1 year ago

Datseris commented 1 year ago

Power-law spectra, also called "1/f-noise" is a ubiquitous property of the timeseries of many real world processes. In a sense, 1/f-noise is a universality class. http://www.scholarpedia.org/article/1/f_noise

It would be a great addition to this package if we could generate timeseies surrogates with a given spectral 1/f^beta power spectrum.

The type PowerLawSpectrum can either has as input the input timeseries, in which case it deduces beta by doing a linear fit to the power spectrum, or it could have as input beta directly.

The following paper, section 2.2.1, describes how to generate power law surrogates: https://npg.copernicus.org/articles/28/311/2021/#section2

Apparently, code to generate power-law surrogates exists here: https://github.com/EarthSystemDiagnostics/paleospec

https://earthsystemdiagnostics.github.io/paleospec/reference/SimPLS.html

https://earthsystemdiagnostics.github.io/paleospec/reference/SimFromEmpiricalSpec.html

Datseris commented 1 year ago

wow : https://github.com/EarthSystemDiagnostics/paleospec/blob/master/R/SimPowerlaw.R#L97-L133

haha, apparently it is trivial to do this; make the spectrum of white noise, scale it linearly, and transform back :D

I am sure we can do something more sophisticated by relating the spectrumw ith the orignal timeseries somehow.

kahaaga commented 1 year ago

The type PowerLawSpectrum can either has as input the input timeseries, in which case it deduces beta by doing a linear fit to the power spectrum, or it could have as input beta directly.

Do you mean a linear fit to the log transformed power spectrum, or am I missing something?

Datseris commented 1 year ago

Yes.