# Modeling Firm Search and Innovation Trajectory Using Swarm Intelligence
## 3 Materials & Methods
### Model Development  
Let there be \(i=1,\cdots,m\) firms and \(j=1,\cdots,n\) technological topics (henceforth called topics). At each given point in time \(t\), we map firm \(i\)'s location in the topic space. The resulting map forms an \(n\)-dimensional hypercube image of the topics, with each axis of the hypercube representing each \(j\)th topic. Comparing the firm's location across time (e.g., \(t\) to \(t+1\)) allows us to represent its migration within the topic space. In this version of the model, we bounded each axis as continuous variable between 0 and 1 (other lengths could be chosen without loss of generality). Therefore, the firm's location on that axis can be thought of as the propensity for the firms' innovations at time \(t\) to relate to topic \(j\). If a firm has more than one innovation at time \(t\), where the firm lies in [0,1] on axis \(j\) will depend on the average across the innovations. For instance, if five innovations focus on topic \(j\) (=1) and five do not (=0), then the value for \(j\) = 0.5. We discuss how we handle real world patent data in Section 3.2. We defined firm \(i\)'s position at time \(t\) using the vector \(\overset{\rightarrow}{x}_{t}^{(i)}\) of \(n\) topics, where \(x_{j,t}^{(i)}\) is the \(j\)th element. For the sake of completeness, we defined \(F\) as the set of firms \(\left\{f^{(1)},\cdots,f^{(m)}\right\}\) whose positions at time \(t\) we defined by the \(n\times m\) matrix \(X_{t}=\left\{\overset{\rightarrow}{x}_{t}^{(1)},\cdots,\overset{\rightarrow}{ x}_{t}^{(m)}\right\}\). We defined the velocity of a firm as follows:  
\[\overset{\rightarrow}{v}_{t}^{(i)}=w_{A}\overset{\rightarrow}{v}_{A,t}^{(i) }+w_{C}\overset{\rightarrow}{v}_{C,t}^{(i)}+w_{S}\overset{\rightarrow}{v}_{ S,t}^{(i)}+w_{L}\overset{\rightarrow}{v}_{L,t}^{(i)}+w_{P}\overset{ \rightarrow}{v}_{P,t}^{(i)} \tag{1}\]  
where the weights \((w_{A},w_{C},w_{S},w_{L},w_{P})\) sum to 1. \(A\), \(C\), and \(S\) stand for alignment, cohesion, and separation, respectively, which we derived from [PERSON] (1987) swarm program. \(L\) and \(P\) stand for leader following and performance feedback, which we describe below. We defined these three velocity vectors as follows:  
\[\overset{\rightarrow}{v}_{A,t}^{(i)}=\text{avg}\left(\overset{\rightarrow}{ v}_{t-1}^{(j\
eq i)}\left|f^{(j)}\in F\right)-\overset{\rightarrow}{v}_{t-1}^{(i)} \tag{2}\]  
\[\overset{\rightarrow}{v}_{C,t}^{(i)}=\text{avg}\left(\overset{\rightarrow}{ x}_{t-1}^{(j\
eq i)}\left|f^{(j)}\in F\right)-\overset{\rightarrow}{x}_{t-1}^{(i)} \tag{3}\]  
\[\overset{\rightarrow}{v}_{S,t}^{(i)}=\text{max}\left\{\left|\overset{ \rightarrow}{x}_{t}^{(i)}-\overset{\rightarrow}{x}_{t}^{(i\
eq j)}\right|, \epsilon\right\} \tag{4}\]Alignment determines the firm's propensity to move (or in our case, search) in the direction of a competitive reference group. When the weight on alignment is high, firms will shift the direction of their search as the firms within the reference group change their search direction. A set of firms with high alignment will appear to 'flock' together, or in our applied case, searching the same technologies. When the weight is low, shifts in the reference group's behavior have little influence on the focal firm. Cohesion determines the firm's propensity to move towards the average position or center of mass of its competitors. When modeling animal behavior, such as a flock of birds, cohesion controls how tightly they stay together. In firm search, when a firm has high cohesion, it searches closer to the search positions of its reference group. For both alignment and cohesion, the reference groups (\(F\)) can be defined flexibly so as to encompass the competing firms that most likely influence the focal firm's search. Therefore, Equations (2) and (3) can be used to model a wide range of competitive imitation strategies. Separation determines whether firms can take the same position as other firms within the hypercube. The \(\epsilon\) parameter in (4) can be thought of as the minimum separation threshold between firms on the search space.