Corresponding author: J. Davidsen, Complexity Science Group, Department of Physics and Astronomy, University of Calgary, 2500 University Dr. NW, Calgary, Alberta T2N 1N4, Canada. (firstname.lastname@example.org)
 Based on an analysis of the direction of maximum horizontal compressive stress as a function of depth as observed at different scientific wells along the San Andreas fault, it has recently been suggested that the scale-invariant fluctuations in the stress orientation over intervals from tens of centimeters to several kilometers are directly related to the local earthquake magnitude-frequency statistics. Here we mathematically analyze the possibility of such a relationship and show that the magnitude-frequency statistics alone is insufficient to explain the scaling of the stress orientation fluctuations. While stress perturbations caused by slip on adjacent faults of various sizes can still be responsible for these fluctuations, the average amplitude of the induced changes in the orientation would have to increase nonlinearly with the fault size. As the example of two research wells near the San Andreas fault also shows, the specific nonlinear form would have to depend sensitively on the specific geographic location. We conclude that the observed scale-invariant fluctuations in the stress orientation are more likely a consequence of a combination of local seismicity rates and the specific local fault structure.
 Stress heterogeneity is thought to play an important role in many aspects of crustal mechanics, including the influencing of the space-time distribution and scaling of earthquakes [e.g., Hardebeck, 2006; Valley and Evans, 2010]. One way to characterize this heterogeneity and the state of stress in general is the analysis of stress-induced wellbore failure [e.g., Bell and Gough, 1979; Zoback et al., 2003]. These failures indicate that stress orientations in the upper few kilometers can sometimes change significantly with depth over length scales as small as 10 m [e.g., Brudy et al., 1997; Wilde and Stock, 1997; Hickman and Zoback, 2004], even if the regional direction of the maximum horizontal compressive stress is rather uniform [Day-Lewis et al., 2010; Yang and Hauksson, 2013]. The variations in the direction of the maximum horizontal compressive stress, SHmax, with depth are in particular scale invariant over intervals from tens of centimeters to several kilometers [e.g., Valley and Evans, 2010; Day-Lewis et al., 2010]. One important challenge is to determine the cause of this scale-invariant behavior. Recently, it has been proposed that the behavior is controlled by stress perturbations caused by slip on nearby faults of various sizes and, specifically, is fully determined by the local scaling of the earthquake frequency with fault size [Day-Lewis et al., 2010]. This would imply that stress heterogeneity adjacent to active faults like the San Andreas fault reflects variations in stresses and loading conditions along the fault. The conceptual picture was that the overall pattern of wellbore stress variations along the wells results from the superposition of small stress fluctuations from numerous small ruptures and larger, long-wavelength perturbations caused by fewer larger ruptures. This hypothesis was based on the observation that the exponent characterizing the power law decay in the power spectrum of SHmax as a function of spatial frequency was practically identical to the scaling exponent characterizing the earthquake frequency with rupture length for two scientific research boreholes along the San Andreas fault—despite differences in the exponents between sites. Here we test this hypothesis by casting the conceptual picture into a minimal mathematical model and analyze whether it can indeed predict the observed behavior and the relation between the different scaling exponents.
 The frequency of occurrence of earthquakes can be described by the empirical Gutenberg-Richter (GR) law [Gutenberg and Richter, 1949]. In its original form, it states that the number of earthquakes N>(m) with a magnitude larger than m is given by log10N>(m)∝−bm with b≈1 [e.g., Kagan, 2005; Schorlemmer et al., 2005; Davidsen and Kwiatek, 2013]. Since the magnitude of an earthquake is directly related to its seismic moment M through with c=1.5, for large earthquakes [e.g., Stein and Wysession, 2002; Ben-Zion, 2008], the GR law can be expressed as a power law N>(M)∝M−b/c, which is a hallmark of scale-invariant behavior. From the definition of the seismic moment as M=μAδe where μ is the shear modulus of the rock, A is the area of the fault break, and δe is the mean displacement across the fault and empirical observations, one can further relate M to the linear extent of the fault break—the square root of the rupture area—or earthquake rupture length L as M∝Ld [e.g., Kagan, 2005; Davidsen et al., 2008; Gu et al., 2013; Wu et al., 2013], with 2≤d≤3 depending on the specific rupture type [e.g., Wyss et al., 2004; Ben-Zion, 2008], though current evidence indicates a unique value of d=3 [Kagan, 2005]. Hence, the GR law takes on the form
for the number of earthquakes with rupture length larger than L with D=bd/c. Variations in the exponent D from one region to another can arise not only due to variations in d/c but also in b. This is, for example, observed for regions around creeping and locked sections of the San Andreas fault [Day-Lewis et al., 2010].
Day-Lewis et al.  suggested that equation (1) with the corresponding value of D for the local area fully determines the variations in the direction of the maximum horizontal compressive stress with depth, r, as measured by borehole breakouts. To test this explicitly, we need to establish a precise relationship between SHmax(r) and equation (1). This requires specific modeling assumptions and we introduce here a conceptual model that makes minimal assumptions beyond equation (1). Specifically, we formalize the idea proposed by Day-Lewis et al.  that SHmax(r) is a superposition of small orientation fluctuations from numerous small ruptures and larger, long-wavelength perturbations caused by fewer larger ruptures. Thus, we basically assume that each rupture or earthquake close to the location where we measure SHmax(r) leads to a change in the orientation of the maximum horizontal compressive stress field. The larger the rupture, the larger the amplitude and the spatial extent of the change on average. The assumption of a linear superposition principle—and, indeed, the mean-field assumption that equation (1) is sufficient to capture the variations in SHmax(r) without the need to consider the specific fault structure affecting the clustering of ruptures—makes the model mathematically tractable. In particular, we can write , where Δj(r) corresponds to a perturbation in the orientation induced by rupture j. Note that the mean orientation 〈SHmax(r)〉r has been set to zero without loss of generality. As perturbations in the stress orientation due to earthquakes are rather spatially localized—a simple consequence of the rapidly decaying static stress transfer in space following from the laws of elasticity—we choose to model Δj(r) simply as a uniform change over a spatially limited range such that
where H(r) is the Heaviside function, rj is the upper endpoint of the perturbation along the borehole, rj+lj is the lower endpoint along the borehole, and aj is the strength of the perturbation, which can be positive or negative. The extent lj and the amplitude of the perturbation |aj| are assumed to be statistically distributed according to equation (1), i.e., the probability to observe a perturbation with a spatial extent in the interval [lj,lj+dl] is given by and |aj|∝lj for all j over the observable range. This makes the lj's independent and identically distributed. We also assume that p(aj)=p(−aj) and that the sign of aj is independent of lj for all j, such that 〈aj〉=0 and there is no overall bias in the orientation changes of the stress. To explicitly eliminate any possible influence of spatial clustering, we further assume that the rj's are randomly drawn from a uniform distribution over the relevant spatial interval.
 In the following, we will also consider a slightly extended version of this minimalistic mean-field model, which allows a nonlinear relationship between |aj| and lj such that . For γ=1, we recover the previous model. The additional parameter γ allows us to consider cases where either only |aj| is assumed to be statistically distributed according to equation (1) or only lj while the respective other quantity follows a power law with a different exponent. To be more precise, we have now two exponents Dl and Da such that and with γ=Dl/Da. This also includes the limiting cases Da=∞, for which |aj|≡1, and Dl=∞, for which lj≡1.
 To quantify the variations in the direction of the maximum horizontal compressive stress with depth and to compare them to observations, we need to estimate the power spectrum S(f) of SHmax(r), where r corresponds to the spatial position along the borehole and f is the corresponding spatial frequency. The power spectrum is defined as
where 2Lz corresponds to the depth of the borehole. As we show in Appendix A, for the extended version of our mean-field model, S(f) exhibits the following behavior over the relevant frequency scales:
 For the San Andreas Fault Observatory at Depth (SAFOD) Pilot Hole and the Cajon Pass well, both located along the San Andreas fault, it was found that S(f)∝f−β with β=1.470±0.014 for the SAFOD Pilot Hole and with β=1.125±0.018 for Cajon Pass [Day-Lewis et al., 2010]. Moreover, it was estimated that D=1.5±0.1 and D=1.3±0.1, respectivel with Dl≡Da≡D, equation (4)) predicts that β=2. This is obviously inconsistent with the observations. Moreover, having equation ((1) and a single exponent D determining β can also be ruled out: The observed values of β would require that D=2.530±0.014 and D=2.875±0.018 for the SAFOD Pilot Hole and for Cajon Pass, respectively, which in turn would require that b≥1.258 and b≥1.4285 to obtain physical values of d≤3. The directly estimated values are b≈1.1 for the SAFOD Pilot Hole and b=0.88±0.4 (the uncertainty corresponds to two standard deviations here) for Cajon Pass [see Day-Lewis et al., 2010, and references therein] and, thus, significantly smaller than this lower bound. These estimated values of b would instead imply unphysical values of d>3. Even higher unphysical values would be required if one took into account that the statistical distributions relevant for the changes in the stress orientation along the borehole should be translated from their regional form into a site-specific form, which emphasizes larger events [Kagan, 2005]. This forces us to reject this version of the model.
 However, for the extended version of our model, equation ((4)) predicts that β=2+2Dl/Da−Dl. For Dl≡D, this leads to
In the case of the SAFOD Pilot Hole, this implies that Da=3.1 and γ=0.48, while for Cajon Pass, Da=6.2 and γ=0.21. For Da≡D, we find instead
In the case of the SAFOD Pilot Hole, this implies that Dl=−1.59 and γ=−1.06, while for Cajon Pass Dl=−1.63 and γ=−1.25. The negative signs imply that large ruptures lead to a more localized change in SHmax(r) than smaller ones making this scenario unphysical.
 Our analysis shows that the simple picture that the fractal size distribution of seismogenic shear faults or ruptures in the crust surrounding the study site—as quantified by a specific value of D in equation (1)—controls the variations in wellbore stress rotations fails for the two boreholes along the San Andreas fault. However, the data are consistent with a model where the spatial extent of rotations in SHmax(r) are governed by equation (1) and the amplitude of the rotations follows a different scaling law. This new scaling exponent would need to vary drastically from one location to another though, as the comparison of the two boreholes along the San Andreas fault shows. For the SAFOD Pilot Hole, the amplitude of the change in the stress orientation would scale approximately as the square root of its spatial extent, while for Cajon Pass, it would be the fifth root. Such a variation would have to be the consequence of vastly different petrophysical properties at the different sites. Yet, as discussed by Day-Lewis et al. , the heterogeneity of these properties—including electrical resistivity, formation density, sonic velocity, and P wave velocity—as measured by different logs in a variety of tectonic environments including Cajon Pass and the SAFOD Pilot Hole shows features that are quite independent of the exact location. This makes such a scenario unlikely.
 Thus, we need to explore other possible scenarios that can explain the observed stress orientation fluctuations. Our model assumed that the sign of induced stress rotations are equally likely; motivations for relaxing this assumption include, for example, that for large ruptures of the San Andreas fault, clockwise perturbations in SHmax could dominate. If either p(aj) is strongly asymmetric or there is an average dependence of the sign of aj on lj, then equation ((4)) would have to be replaced by equation ((A13)). Physically, the former would imply that the induced perturbations in the stress orientations in the clockwise direction are statistically different from those in the anticlockwise direction. The latter would imply that the orientation of the perturbation depends on average on its spatial extent or equivalently the rupture length. In these cases, the specific scaling behavior of S(f) with an exponent β—if it still exists—would depend on the precise form of p(aj) or the exact dependence of aj on lj and, hence, require significant knowledge in addition to equation (1). In either case, the respective deviations from our original model would have to occur over many orders of magnitude as analytical and numerical studies of equation ((A13)) show. This makes these two scenarios an unlikely explanation for the observed behavior.
 The model also assumed that the locations of the stress orientation perturbations along the borehole are randomly and uniformly positioned. From a physical perspective, nonrandom and nonuniform positioning is reasonable since ruptures often occur on preexisting faults [e.g., Eaton et al., 2013] and earthquakes can trigger other earthquakes leading to spatiotemporal clustering of events [e.g., Gu et al., 2013]. Also, in the region of interest, it has been noted that aftershock patterns are well aligned with the background stress field [Hardebeck, 2010] providing further evidence for nonrandom behavior. Yet, relaxing the assumption of random locations of the stress orientation perturbations in our model but keeping the assumption of their uniform distribution does not change the asymptotic behavior due to the superposition principle. In contrast, relaxing the assumption of uniformly distributed locations can have a significant effect. If the deviations from a uniform distribution are sufficiently strong, they could certainly influence or even dominate the scale-invariant fluctuations in SHmax. Such nonuniform behavior can be a consequence of the local fault structure and explain the observations as a combination of differences in local seismicity rates and the local fault structure, the later being independent of the value of D. Further support for this scenario comes from the fact that the scale-invariant fluctuations of the stress orientation in intraplate regions are characterized by much higher values of β than for the San Andreas fault despite comparable values of D [Day-Lewis et al., 2010]. While the interplay of local seismicity rates and the structure of the local fracture network is a likely scenario to explain the scale-invariant fluctuations in SHmax, it is difficult to assess its validity even in the context of our model as it would require a detailed knowledge of the distribution of the locations of the stress orientation perturbations or more generally the distribution of ruptures in relation to the borehole well to compute any deviations from equation ((4)). This remains a challenge for future research, which should also address the importance of physical aspects outside the scope of the mean-field model considered here, such as stress diffusion and corrosion over time as well as aseismic stress sources.
 To summarize, our findings provide strong evidence that the GR relationship in the form of equation (1) is by itself insufficient to explain the scale-invariant variations in the direction of maximum horizontal compressive stress as a function of depth as observed at different scientific wells along the San Andreas fault. While the stress heterogeneity adjacent to active faults like the San Andreas could still reflect variations in stresses and loading conditions along the fault, the direct relationship and suitable statistical indicators remain unknown. The adjacent fault geometry and the spatial structure it presents is likely to play an important role in resolving regional straining and local stress perturbations through fault interaction and slip heterogeneity.
 The power spectrum S(f) of the (stationary) signal SHmax(r) is defined as
Using the properties of the Fourier transform of SHmax(r), this is equivalent to
where SHmax′(r) is the derivative of SHmax(r). For the model given by equation (2), we have
where δ(r) is the Dirac delta function. Using this in equation (A2) leads to
Since the events j and q are independent for j≠q, the law of large numbers applies giving rise to
where the average 〈⋯〉 is over the ensemble of independent and identically distributed events. Note that we have also taken advantage of the fact that aj is independent of rj. Simplifying the trigonometric functions leads to
since p(r)=p(−r) implies that 〈sin(2πfr)〉=0 and 〈sin(2πf(rj−rq)〉=0. Rearranging the terms, we have
Provided that p(a)=p(−a) and the sign of aj (but not necessarily |aj|) is independent of lj as it is the case for the model(s), we define in section 2, this simplifies to
Otherwise, the asymptotic limit is
Let us consider two special cases of equation (A12): (i) a is independent of l and over the observable range; and (ii) |a|∝lγ and over the observable range, which implies that with or, equivalently, , which corresponds to the extended version of the model given in section 2. For case (i), we have
with the normalization constant for αl≠1, lmax the maximum possible spatial extension of the change in stress orientation with lmax≤2Lz and lmin the corresponding minimum. Note that lmin>0 if αl≥1 and lmax<∞ if αl≤1 to ensure normalizability. Equation ((A14)) is well defined since the average of the cosine is bounded from above by 1. From the above expressions, two limiting behaviors can be directly identified: (a) If the integral term is zero, then the power spectrum decays with exponent 2. This is the case for αl=0 and lmax→∞, for example. (b) If the cosine term can be well approximated by the two lowest order terms in its Taylor expansion over the relevant integration range, the power spectrum is constant. This is the case for αl→∞, for example, since only the behavior close to lmin matters for the integration in this limit. The prefactor of the rescaled integral in equation ((A14)) also indicates that there might be a transition regime for some values of αl between the two limiting cases for which the decay is characterized by an exponent 3−αl. Indeed, detailed numerical studies of equation ((A14)) based on the known representation of the cosine integral in terms of incomplete Gamma functions and complex exponentials [Gradshteyn and Ryzhik, 2007] show the following behaviors for lmax≫1/f≫lmin:
Specific examples of the three different regimes are shown in Figure A1. The above result for case (i) can be directly generalized to case (ii) by realizing that the a2 terms in equation (A12) now scale as l2γ. This leads to an expression similar to equation ((A14)) with a modified prefactor of the integral scaling as . This gives rise to the following behavior for the extended version of the model considered in the main text:
This is confirmed by direct numerical evaluation of equation (A12).
 This project was supported by Alberta Innovates (formerly Alberta Ingenuity). M.N. was supported by a Scottish Government and RSE Research Fellowship and Marie Curie Actions. The authors thank the reviewers R. Shcherbakov and M. Werner for their helpful comments, which have significantly improved the presentation.
 The Editor thanks Maximilian Werner and an anonymous reviewer for their assistance in evaluating this paper.