Discussing the article: "Category Theory in MQL5 (Part 21): Natural Transformations with LDA"

 

Check out the new article: Category Theory in MQL5 (Part 21): Natural Transformations with LDA.

This article, the 21st in our series, continues with a look at Natural Transformations and how they can be implemented using linear discriminant analysis. We present applications of this in a signal class format, like in the previous article.

As we continue our look at natural transformations we will for this article look at more applications in time series forecasting. Natural transformations can often be inferred in data sets that are related and this is something we want to start looking at with this article.

So, here is the problem. A startup company creates a database for its customers to keep track of their purchases over time and initially it has let’s say, 3 columns. A primary key, a product name column, and an amount paid column. Over time the company notices a lot of repetition in the product column, meaning a particular product is getting bought a lot. So, in response to this a decision is made to start logging more information related to products so as to better distinguish the preferences of the customer and possibly explore developing new products that may be missing from their portfolio. To this end the product column gets split into 3 columns namely: version, subscription mode, build name. Or the company may need more color on the payment information and decide to partition the payment column into 3 with say a column for payment mode, currency (or locale), and the payment amount. Again, such splits would not be exhaustive as at a future stage more may be required depending on the customer purchases and their preferences.

Each of these new created columns would map to the old product column. And if we had, for example, established some key correlations between the old single product column and say the amount paid column, or any other column in a table within the database, then it would be a cumbersome process in re-establishing these correlations in the new table structure. The startup company would certainly have many means of addressing this but natural transformations do offer a seamless alternative.

To wrap our heads around this let’s try to look at this firstly as two categories. In the domain category we would have the startup company’s list of tables in its database, and in the codomain category we would have the two versions of the customer information tables. For simplicity if we take the list as a single object in the domain and each of our tables as separate objects in the codomain then two functors from the list one to each table, do imply a natural transformation between the two tables. So, one functor would map to old tables which in our case is the simple 3 column table, while the second functor would map to a revision in the table structure. If this is revision 1 then the second functor maps to the 5-column table.

The implication of a natural transformation not only means we can quantify the differences between these two tables via an algorithmic mapping function such as: linear equation, quadratic equation, multi-layer perceptron, random distribution forest, or linear discriminant analysis; it means we can use these weights to re-establish prior correlations with the old table and develop new ones for the created columns.

Author: Stephen Njuki

Reason: