  The use of machine learning for statistical modeling (and thus, generative
modeling) has grown in popularity with the proliferation of time series models,
text-to-image models, and especially large language models. Fundamentally, the
goal of classical factor modeling is statistical modeling of stock returns, and
in this work, we explore using deep generative modeling to enhance classical
factor models. Prior work has explored the use of deep generative models in
order to model hundreds of stocks, leading to accurate risk forecasting and
alpha portfolio construction; however, that specific model does not allow for
easy factor modeling interpretation in that the factor exposures cannot be
deduced. In this work, we introduce NeuralFactors, a novel machine-learning
based approach to factor analysis where a neural network outputs factor
exposures and factor returns, trained using the same methodology as variational
autoencoders. We show that this model outperforms prior approaches both in
terms of log-likelihood performance and computational efficiency. Further, we
show that this method is competitive to prior work in generating realistic
synthetic data, covariance estimation, risk analysis (e.g., value at risk, or
VaR, of portfolios), and portfolio optimization. Finally, due to the connection
to classical factor analysis, we analyze how the factors our model learns
cluster together and show that the factor exposures could be used for embedding
stocks.
