If you arent using a Cooley-tukey Fast fourier Transform to analyze your stock data can you really say you know how to buy/sell stocks? :)

Integrating fourier analysis into my Algorithmic Trading that I've been doing. I really should have done this much sooner.

@freemo Hi there Freemo, if I may make a suggestion, I would recommend trying to incorporate wavelet analysis rather than Fourier analysis for this particular application, as the wavelet transform allows for some temporal specificity on signals that vary over time, while still allowing you to access the frequency data you need. It's incredibly useful, and you may even be able to use a matrix factorization approach with the resultant data to pull out key points of interest and recommend stocks based on the behaviors of other stocks, assuming you have the processing power and access to relevant data. Here is a link to a paper I recently read on the topic regarding this application in brain networks, as well as the Wikipedia page to wavelet transforms, and a video on the application to financial time series analysis. Feel free to ask any questions you may have and I'll try to respond soon :)

en.wikipedia.org/wiki/Wavelet_

invidiou.site/watch?v=Z3UH3PYO

researchgate.net/profile/Tiany

@johnabs I've worked a lot with wavelets and generally speaking I dont disagree that stocks are better suited to wavlets than a fourier transform if we arent talking about specifics. But in truth both types of analysis have their place it just depends on what your doing and how you apply it.

FYI I wrote a wavelet based Machine Learning algorithm over a decade ago you may wish to check out (Genetic Wavelets Algorithm)

So that said, first thing to keep in mind is a fourier transform is also temporal in nature, just in a different way. Generally speaking when you do fourier analysis you use a sliding window with some type of overlap and a window function. In this way you dont have a single FT but rather a FT specific to each moment in time. So it very much becomes temporal.

The way it differs is that wavelet analysis allows you to work with different size "windows" (not the correct term but basically the idea as a wavelet has a limited bandwidth where it is high enough magnitude to have significance) at the same time across different frequencies without needing to compare windows in the way you would with FFT.

So with a FFT approach you can still say things like "this particular frequency was present and dominate in this time range here"

@freemo I'm with you (I've published some work on this as well, particularly in application to NMF), but in this case of specifically looking at (what I'm assuming to be) synchronous time-series data, wouldn't you prefer an approach that allows you to work with continuous data as new information "reaches your detector" so to speak, rather than needing to recompute and compare your FT series? I guess my question would be why do it the FT way instead of the wavelet way when the latter should be more suited to this use case in general. Additionally, wouldn't it be easier to perform auto-correlation of your various data traces using wavelets in comparison to FT, which would make suggestions simpler? The real advantage of FT I would see would be ease of implementation and computational speed, which is definitely a justification I would understand, but I'm just curious precisely what your contention is with the technique.

Also, I searched for your algorithm but couldn't find it on google scholar or your Github, would you mind linking it?

@johnabs Here is a thesis someone did evaluating my algorithm on an earlier version of it (the final version had some significant improvements that came after this paper):

korykirk.com/thesis.pdf

As for the FT vs wavelets question there are a few considerations. for starters the FT approach is just a standin for a model i have in my head that I havent flushed out yet, so its unlikely to be the final iteration, but in this form it is still useful. There is also the fact that I have access to a wider range of libraries that handle FFT than I would for wavelets. Moreover, the FT stuff I'm doing right now isnt really as complex as the scenario you suggest.

Basically at the current moment I'm using FFT analysis as little more than a bandpass filter and improved moving average (really a low pass filter). In this way I can apply the FFT split the low-pass and high pass out, and then convert it back to time domain, the low-pass will show the actual trends with any "noise" and fluctuations removed, and the high pass are effectively just the noise isolated. The noise essentially represents the volatility and will integrate to approximately 0, so represents short term signals that should average out over time.

From there I know if im looking to trade on time scales on the order of a month then I set my cutoff appropriately and look at what sort of volatility is to be expected and therefore know that as long as the fluctiations are within the norm for noise there is no need to close my position. In other words I can set a trailing stop limit where the amount of the trail is equal to the maximum amplitude of the high-pass filter. That way i can be relatively certain that if a stock deviates by more than the peak volatility that it represents a mis-trend rather than normal noise that will recover and thus is an optimal set point for a trailing stop.

Obviously wavelets could do this in a more dynamic way (responding to suffen changes in volatility). Just not needed yet.

@freemo @johnabs i have only used wavelets on beep boop sounds and for image compression :blobcatderpy:
@freemo @johnabs there was a patent on using FFTs and IFFTs combined with some very primitive (20 year old now) neural nets to recreate orchestra sounds, and i've wondered how well it would work with wavelets instead. since they are much cheaper and easier to wrangle.

been a while though :blobcatderpy:

@icedquinn @freemo I would imagine they actually did use "wavelets", but not in their "direct" form. More than likely they convolved a sine wave with some limiter function in the time domain to create a wavelet, which is basically just a Gaussian in the frequency domain, e.g. a Morlet wavelet of some similar equivalent. Then, assuming a Generative algorithm, they likely just composed them together to create new sounds, or match existing ones. Maybe that's how synths were made?

@johnabs

It would be gaussian modulated though not strictly gaussian itself... basically just amplitude modulation of a sine wave carrier by a gaussian. Related to a pure gaussian but not the same.

That said, yea, you are probably right.
@icedquinn

Follow

@freemo @icedquinn Right, but I wasn't sure if that level of detail was strictly necessary 😂 And the original point I was trying to make was that they didn't necessarily NEED to use a Morlet wavelet in their implementation to achieve different sounds, as other similar functions would work similarly.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.