# What color financial time series are there?

There is a folklore white noise hypothesis related to (and equivalent to some forms of) the efficient market hypothesis in finance -see references below. But are there some asset pairs whose return time series (or perhaps some "natural" transforms of those time series) are approximately noises of another color than white ? -I ask as a nonspecialist, obviously.

Thank you.

Bonus question: Does anyone know how to play/hear a (financial) time series recorded as a pandas series, dataframe, python list, numpy array, csv/txt file,... ?

• For example Brownian/red noise (en.wikipedia.org/wiki/Brownian_noise) is used a lot in finance. However, other than white noise, I don't think people use the color of noise terminology much in standard statistics (or in its applications to finance), where the term noise tends to refer to white noise.
– fes
May 9, 2023 at 18:59
• Thank you @fes. Yes for white and red noise (1D brownian motion) i knew some of their uses. The markets size or single asset price are usually assumed modeled rather by a geometric brownian motion (introduced by Bachelier) which does not have a power law spectrum (ie is not a colored noise), and does not even have a usual spectral density as it does not have stationary increments. The GBM for $S$ the price process corresponds to the logarithmic return process, $R(t)=d\log S/dt$ (0 mean rate here), which is a white noise. I should have added that in the question, but im reading about it. :)
– plm
May 9, 2023 at 23:31
• Actually i am finding relevant papers. First to complete my comment above there is the wikipedia entry on brownian markets: en.wikipedia.org/wiki/Brownian_model_of_financial_markets . Then as partial answer to my original question there was a 1996 article studying the resulting process when replacing white noise logarithmic returns by colored returns, and it seems they match some real markets -but i can only see the abstract, not the fulltext: papers.ssrn.com/sol3/papers.cfm?abstract_id=1663383 .
– plm
May 9, 2023 at 23:36
• Arithmetic Brownian motion is used more in interest rate modelling. Though you can find some applications of different color noises more likely people have implicitly used these without using the terms.
– fes
May 10, 2023 at 4:42

Bonus question: Does anyone know how to play/hear a (financial) time series recorded as a pandas series, dataframe, python list, numpy array, csv/txt file,... ?

This is kind of fun and has practical applications to quantitative finance. My partners and I have actually been experimenting with this as the basis for a model for a short while now and have experienced very interesting results.

At first, I found it most straightforward to map my time series to piano key frequencies. I specifically made a dictionary of piano key frequencies out of just one octave on a piano. The octave consisted of seven white and five black (sharp) keys. Each key was calibrated in relation to the others, just like a piano would be tuned. I "tuned" it to middle C in this way:

$$note frequency = base frequency * 2^\frac N{12}$$

Where the $$base frequency$$ is that of middle C (261.63 Hz) and each $$N$$ is a note from C to B (C, c, D, d, E, F, f, G, g, A, a, B). This is known as an equal temperament system.

In Python, we can create a dictionary of frequencies like this:

def piano_notes():
'''
Returns a dictionary containing the frequencies of piano notes
'''

base_freq = 261.63

octave = ['C', 'c', 'D', 'd', 'E', 'F', 'f', 'G', 'g', 'A', 'a', 'B']

note_freqs = {octave[i]: base_freq * 2**(i/12) for i in range(len(octave))}
note_freqs[''] = 0.0  # pause / silent note

return note_freqs


The output from print(note_freqs):

{'C': 261.63, 'c': 277.18732937722245, 'D': 293.66974569918125, 'd': 311.1322574981619, 'E': 329.63314428399565, 'F': 349.2341510465061, 'f': 370.00069432367286, 'G': 392.0020805232462, 'g': 415.31173722644, 'A': 440.00745824565865, 'a': 466.1716632541139, 'B': 493.89167285382297, '': 0.0}


From here, you must decide how to transform every price or return in your time series into an integer from 0 - 11 and map them to their respective dictionary values. That step requires some creativity, and I'll leave that to you.

Now that you have your time series mapped to piano note frequencies, to be able to listen to your time series, you need to convert your frequencies into something that can be played, i.e., you need to turn them into sound waves!

A wave can be mathematically described as: $$g(f)=A * \sin(2\pi\ {ft})$$ where: $$A$$=amplitude, $$f$$=frequency, and $$t$$=time. That said, we need to have a function that generates a wave array with respect to time which is much easier than it sounds:

import numpy as np

sample_rate = 44100  # Standard sample rate in digital audio (in Hertz, Hz)

def waves(freq, duration=0.5):
'''
Takes frequency, and time_duration as inputs and returns
a numpy array of values at all points in time
'''

amplitude = 4096  # tuning fork frequency

t = np.linspace(0, duration, int(sample_rate * duration))
wave = amplitude * np.sin(2 * np.pi * freq * t)

return wave


After turning your notes into playable waves, you concatenate them, save them locally, and play them.

import numpy as np
from scipy.io.wavfile import write

def song_data(music_notes):
'''
concatenate all the waves
'''
note_freqs = piano_notes()
song = [waves(note_freqs[note]) for note in music_notes.split('-')]
song = np.concatenate(song)
return song


Here is an example of using the above functions to play "Mary Had A Little Lamb." The file will save in your working directory and can be played using a generic .wav player on just about any machine.

music_notes = 'E-D-C-D-E-E-E--D-D-D--E-E-E--E-D-C-D-E-E-E--E-D-D-E-D-C-'
data = song_data(music_notes)