# Population Dynamics in Genetic Programming for Dynamic Symbolic Regression
## 2 Materials and Methods  
### Dynamic Symbolic Regression  
In standard regression problems, the relationship between independent variables \(X_{i}\) and the dependent variable \(y_{i}\) is established through a known or unknown generating function \(f\) that may involve certain parameters \(\beta\):  
\[y_{i}=f(X_{i},\beta)+e_{i}, \tag{1}\]where \(e_{i}\) represents error terms like noise, and \(i\) denotes an observation. For static regression tasks, both the generating function \(f\) and the characteristics of independent features \(X_{i}\) remain constant within reasonable margins.  
However, in dynamic regression tasks, either the characteristics of the independent variables \(X_{i}\) (such as their value range) or the generating function \(f\) can change over time. While alterations in the characteristics of independent variables may only impact the extrapolation behavior of a model, changes in the generating function \(f\) can disrupt any previously learned relationship between independent and dependent variables.  
In this paper, we specifically explore dynamicity in regression tasks concerning changes in the generating function \(f\) while keeping the characteristics of independent variables fixed. We introduce a time-dependent hidden-state parameter \(h_{t}\) to account for the time-dependent modification of the generating function. For instance, a dynamic regression instance might be characterized by the generating function:  
\[f(X,h_{t})=X_{1}\cdot h_{t}+X_{2}, \tag{2}\]  
where \(h_{t}\in[0,1]\) controls the influence of variable \(X_{1}\) while variable \(X_{2}\) remains static.  
The hidden-state variable \(h_{t}\) serves as a control parameter for the speed of the shift, allowing for the simulation of abrupt concept changes if altered quickly or gradual concept drift if changed over an extended period. To facilitate the progression of the hidden-state variables for the evolutionary algorithm, we tie it to the epoch, which is increased after a predefined number of evaluations or generations are passed, as outlined in Section 1.2.  
Adapting machine learning models to changes in the underlying data of a regression task is crucial, as changes may render previously significant variables less important or entirely irrelevant. Variables might also interact differently, affecting the model's ability to predict the target. Also, the learned relationship between old inputs and targets may no longer hold. In the realm of evolutionary algorithms, particularly genetic programming (GP), this translates to a probable decline in the quality of individuals after data changes, resulting in an overall decrease in population quality.  
The magnitude of this quality drop depends on the nature of the data change. Limited changes or additions to observations might lead to a relatively small drop in quality, while alterations in variable interactions can cause more pronounced drops. Following such drops, the algorithm's task is to adapt, identifying new individuals that align better with the new data. Depending on the extent of the data change, GP can leverage genetic material from the previous generation rather than entirely rebuilding the population. This adaptive approach enables GP to efficiently navigate dynamic data scenarios.