# Modeling Firm Search and Innovation Trajectory Using Swarm Intelligence
## 3 Materials & Methods
### Data  
To examine a firm's innovative search direction, we need information on its R&D projects. While this information is not typically publicly available, we can assess the outcomes of their successful searches by using patent data. Patent data has been a key source of information on innovation in the strategy and economics literature [65]. Data on U.S. patents and patent citations come from the U.S. Patent and Trademark Office (USPTO) and the Patent Network Dataverse [66], for which firm-level identifiers have been mapped in prior research [67; 68]. For each patent, we used the abstract, assigned technology class, patent assignee, and the patent's application date. To tie a patent to a year (our unit of time in our study), we used application dates rather than grant dates because the application date better approximates the time in which the firm searched the topic. In our demonstration, we used patent data on the 11 3-digit USPTO patent classes most closely associated with communications technologies (see Table 1) during the period 1985-2007. The sample timeframe and patent classes have been used extensively in the prior technology strategy and innovation economics literature, e.g., [69; 70]. We selected communication technologies for several other reasons. First, firms in this industry tend to patent most innovations. Therefore, patent data likely reflect the search behavior of these firms. Second, the time between the initial outlays for R&D and patenting is short compared to other areas like drug discovery, thus using the firm's patent application dates is a good proxy for its current search focus. Third, prior work on this industry suggests that firms might exhibit a variety of search behaviors. Much of the prior innovation literature in strategy and economics uses the 3-digit technology class or the lower level, subclass, to categorize patents [71]. However, using such levels of classification schemes, while useful in many research settings, may not be sufficiently nuanced for our purposes. For instance, firms searching for innovations within multiplex communications (technology class 370) may focus on a variety of topics (space division multiplexing, code division multiplexing, time division multiplexing, etc.). To best perform the analysis, a more nuanced measure of \"topics\" is needed. We used latent Dirichlet allocation (LDA) to create topics from patent abstracts. LDA is a commonly used, unsupervised machine learning technique to create topics from text [72]. Most work on LDA uses the researchers' own inputs to define the number of topics, however, that can be problematic in this setting for two reasons. One, researchers may not have the expertise to suggest the appropriate number of topics within a technology class. Two, creating an algorithm to select topic size may allow for more consistency across researchers and remove the potential of user-induced measurement bias. Therefore, we chose the number of topics by maximizing the coherence score, a commonly used construct in LDA that measures how similar the words on a topic are to each other. In this sample, we used the CV coherence score [73] to choose topics. Several other commonly used alternatives--UMass coherence Score, UCI coherence Score, and Word2 vec coherence score--produce similar results. To create the topic space, for each patent class, we fed all patent abstracts for the entire sample period in to the LDA model using the LDA program from the Natural Language Toolkit in Python. Note that all U.S. patents during the entire sample period were used, not just patents from the firms that we studied. The number of topics that maximizes the coherence score was chosen, which determines the \(n\)-dimensional hypercube. LDA provides a probability that each patent is associated with a particular topic. For each firm in each year \(t\), the coordinate in the cube (e.g., position on each axis \(j\)) is calculated by averaging the probabilities across all the firm's patents.