**Question:**

Exercise 2 determined that velocity gradient, water speed, and turbulent kinetic energy (TKE) gradient are the most important aspects of principal components that predict the spatial distribution of behavior changes. However, because channel hydraulics vary on a small scale (e.g. centimeters) within the experimental channel, the relationship between each hydraulic variable and the location of behavior changes also varies spatially. For example, a multiple linear regression comparing the downstream distance of a behavior change and three hydraulic variables of interest shows that the model residuals are non-uniformly distributed (Figure 1). As portion of the boom passed increases, the model shifts from over-predicting behavior change location to under-predicting it. In this exercise, a geographically weighted regression was conducted to examine the relationship of three hydraulic variables and the downstream distance of behavior changes on fine spatial scales. The objective was to determine if one or more independent variables have a spatially-consistent relationship with the location of behavior changes.

##### Figure 1. A general linear model relating the distance downstream of a behavior change and three hydraulic variables (water speed, TKE gradient, and velocity gradient) shows non-uniformly distributed residuals. These results indicate that the relationship of between independent and dependent variables may vary in space, and warrant analysis using a geographically weighted regression.

**Steps:**

A geographically weighted regression (GWR) differs from multiple linear regressions by estimating local relationship coefficients for every point in the dataset, rather than assigning a global coefficient across the entire dataset. In this way, local variation in the relationship between independent and dependent variables can be seen. A 2014 blog post by Adam Dennett was very helpful in understanding and implementing a GWR using R. Once local estimates of regression coefficients between velocity gradient, water speed, and TKE gradient and the location of a behavior change were found, the data were visualized using Python. Only statistically significant relationships (p-value < 0.05) were displayed, so that local coefficients can be regarded with confidence.

**Results:**

The relationship by hydraulic variables and the location of behavior changes varies substantially in space. Local coefficients of both TKE gradient and water speed range from positive to negative values (Figure 2 and Figure 3). That is, depending on location within the experimental channel, high values of TKE may incite a behavior change relatively early or late as a fish passes the guidance structure. Similarly, high values of water speed may incite a behavior change relatively early or late as a fish passes the guidance structure.

##### Figure 2. Locally-derived coefficients between water speed and the location of a behavior change. Grey shading indicates the intensity of water speed.

##### Figure 3. Locally-derived coefficients between TKE gradient and the location of a behavior change. Grey shading indicates the intensity of TKE gradient.

Only velocity gradient demonstrates a consistent relationship with the downstream location of a behavior change (Figure 4). For all observed behavior changes, increasing velocity gradients correlate with increasing distance downstream of the behavior change. Stated another way, if a behavior change occurred at low velocity gradients, we can expect its location to be relatively far upstream. If a behavior change occurred at high velocity gradients, we can expect its location to be relatively far downstream. This differs from the local relationships between the location of behavior changes and TKE gradient and water speed, indicating that velocity gradient may be the best predictor of the distance downstream that a fish passes a guidance structure before changing its behavior. The variability of hydraulic intensity that incites a behavior change is a result of natural variability in a fish’s past experience, physiology, and perception of stimulus, making absolute thresholds of fish behavior difficult to determine. However, velocity gradient may most consistently predict the location of behavior changes in this experiment.

##### Figure 4. Local coefficients between velocity gradient and the location of a behavior change show consistently positive relationships. Grey shading indicates the intensity of velocity gradient.

**Critique of methods:**

Geographically weighted regression is a statistical tool that informs local variation in the relationship between independent and dependent variables. If a researcher has reason to believe that global coefficients don’t capture variation in space, a GWR is a useful, if slightly confusing, method of analysis.