Unsupervised Learning Algorithms and Other Models
What you'll learn
- LOS 3.dDescribe unsupervised machine learning algorithms including principal components analysis, k means clustering, and hierarchical clustering, and determine the problems for which they are best suited.
We now discuss some of the following examples of unsupervised learning and their applications in the investment field:
- Principal component analysis (PCA). Problems associated with too much noise often arise when the number of features in a data set (i.e., its dimension) is excessive. Dimension reduction seeks to reduce this noise by discarding those attributes that contain little information.
One method is PCA, which summarizes the information in a large number of correlated factors into a much smaller set of uncorrelated factors. These uncorrelated factors, called eigenvectors, are linear combinations of the original features. Each eigenvector has an eigenvalue, the proportion of total variance in the data set explained by the eigenvector.
The first factor in PCA would be the one with the highest eigenvalue, and would represent the most important factor. The second factor is the second most important (i.e., has the second highest eigenvalue) and so on, up to the number of uncorrelated factors specified by the researcher. Scree plots show the proportion of total variance explained by each of the principal components.
In practice, the smallest number of principal components that collectively capture 85% to 95% of the total variance are retained. Since the principal components are linear combinations of the original data set, they cannot be easily labeled or interpreted, resulting in a black box approach.
- Clustering. Given a data set, clustering is the process of grouping observations into categories based on similarities in their attributes (called cohesion). For example, stocks can be assigned to different categories based on their past performance, rather than using standard sector classifiers (e.g., finance, healthcare, technology, etc.).
In practice, human judgment plays a role in defining what is similar. Euclidian distance, the straight line distance between two observations, is one common metric that is used. Common types of clustering include k means clustering and hierarchical clustering.
K means clustering partitions observations into k nonoverlapping clusters, where k is a hyperparameter (i.e., set by the researcher). Each cluster has a centroid (the center of the cluster), and each new observation is assigned to a cluster based on its proximity to the centroid. Initially, k centroids are randomly selected, and clustering starts.
As a new observation gets assigned to a cluster, its centroid is recalculated, which may result in reassignment of some observations, thus resulting in a new centroid and so forth until all observations are assigned and no new reassignment is made. One limitation of this type of algorithm is that the hyperparameter k is chosen before clustering starts, meaning that one has to have some idea about the nature of the data set. K means clustering is used in investment management to classify thousands of securities based on patterns in high dimensional data.
Hierarchical clustering builds a hierarchy of clusters without any predefined number of clusters. In an agglomerative (or bottom up) clustering, we start with one observation as its own cluster and add other similar observations to that group, or form another nonoverlapping cluster. A divisive (or top down) clustering algorithm starts with one giant cluster, and then it partitions that cluster into smaller and smaller clusters.
Clustering can be used in investment management for diversification by investing in assets from multiple clusters. Clustering can also be useful in analysis of portfolio risk, as concentration is evidenced by a large portfolio allocation to one cluster. While clusters are themselves not clearly labeled or defined, clustering can be valuable in uncovering hidden structures or similarities between observations in complex data sets.
ESG (environmental, social, and governance) factor based investing is lately becoming popular owing to changes in investor preferences. The governance factor which focuses on corporate board actions in the interests of shareholders, can be objectively observed and measured. The social and environmental impact of a company’s actions is more subjective.
Machine learning and artificial intelligence techniques can use natural language processors to parse through corporate disclosures in text, audio, and video formats to collate the information. For example, mentions of words such as “human capital,” “living wage,” and “D&I” can be collected to represent a company’s response to social responsibilities. Similarly, “sustainable,” “recycle,” “green,” and similar words could indicate the company’s intentions toward environmental goals.
Supervised learning algorithms such as logistic regression, SVM, CART, random forests, or neural networks can then be used to generate ESG scores.
Neural Networks
Useful in supervised regression and classification models, neural networks (NNs), (also called artificial neural networks, or ANNs) are constructed as nodes connected by links. The input layer consists of nodes with values for the features (independent variables). These values are scaled so that the information from multiple nodes is comparable and can be used to calculate a weighted average.
The input values from the nodes in the input layer connect to a second set of nodes in the hidden layer. Typically, several inputs are connected to a particular hidden node, meaning that the node receives multiple input values via the links. The nodes that follow the input variables are called neurons because they process the input information.
These neurons comprise a summation operator that collates the information (as a weighted average) and passes it on to a (typically nonlinear) activation function, to generate a value from the input values. This value is then passed forward to other neurons in subsequent hidden layers (a process called forward propagation). A related process, backward propagation, is employed to revise the weights used in the summation operator as the network learns from its errors.
There may be multiple hidden layers with linked nodes. The multiple links between the information in the input layer and multiple nodes in the hidden layers (each with its own activation function) allow the neural network to model complex, nonlinear functions. There is typically a single node in the output layer that is the prediction of the model.
The researcher must determine the structure of the network. For example, for a network with three inputs (features), we would have three nodes in the input layer. We might specify a single hidden layer with four nodes, in addition to an output layer with a single node.
This structure 3, 4, and 1 is set by the researcher, and referred to as the hyperparameters of the neural network. Hyperparameters may be revised based on the out of sample performance of the model.
Deep Learning Networks (DLNs)
Deep learning networks (DLNs) are neural networks with many hidden layers (at least 2, but often more than 20). DLNs are often used for image, pattern, and character recognition. The last layer in a DLN calculates the expected probability of an observation belonging to a category, and the observation is assigned to the category with the highest probability.
Additional applications of DLNs include credit card fraud detection, autonomous cars, natural language processing, and investment decision making.
In one study using the six input parameters of the Black Scholes model, a DLN was able to predict option values with model of 99.8%. Other studies have used DLNs in investment decision making using standard factors (e.g., book to market values, operating income to market capitalization) to beat strategies using standard factor models.
The popularity of DLNs can be linked to advances in analytical methods, increases in computing speed, and availability of large quantities of machine readable data.
Reinforcement Learning (RL)
Reinforcement learning (RL) algorithms have an agent that seeks to maximize a defined reward given defined constraints. The RL agent does not rely on labeled training data, nor does it provide instantaneous feedback, but rather learns based on feedback from (millions of) trials. When applied to the ancient game of Go, DeepMind’s AlphaGo algorithm was able to beat the reigning world champion.
The efficacy of RL in investment decision making is not yet conclusive.