.. _physics-excursionSetFirstCrossing: Excursion Set First Crossing Statistics ======================================= Class providing the first-crossing distribution in the extended Press-Schechter excursion set framework---the probability that a random walk in the density field, starting from variance :math:`\sigma^2_0` at time :math:`t`, first crosses the collapse barrier at a larger variance :math:`\sigma^2 > \sigma^2_0`. This distribution gives the halo mass function (via the unconditional first-crossing probability) and the conditional mass function of progenitors (via the transition rate between variances). Implementations depend on the choice of barrier shape and random walk statistics, with a flat barrier and Markovian walks recovering the analytic Press-Schechter result. **Default implementation:** ``excursionSetFirstCrossingLinearBarrier`` Methods ------- ``probability`` → ``double precision`` Return the probability for a trajectory to make its first crossing of the barrier at the given ``variance`` and ``time``. * ``double precision , intent(in ) :: variance, time`` * ``type (treeNode), intent(inout) :: node`` ``rate`` → ``double precision`` Return the rate of first crossing for excursion sets beginning at the given ``variance`` and ``time`` to transition to a first crossing at the given ``varianceProgenitor``. * ``double precision , intent(in ) :: variance, varianceProgenitor, time`` * ``type (treeNode), intent(inout) :: node`` ``rateNonCrossing`` → ``double precision`` Return the rate of non-crossing for excursion sets beginning at the given ``variance`` and ``time``. * ``double precision , intent(in ) :: variance, massMinimum, time`` * ``type (treeNode), intent(inout) :: node`` ``coordinatedMPI`` → ``void`` Sets the state of coordination under MPI. If set to true then the object can assume that any calculations it performs are being performed identically by all other MPI processes. This permits, for example, coordinated tabulation of results across MPI processes. * ``logical, intent(in ) :: state`` .. _physics-excursionSetFirstCrossingFarahi: ``excursionSetFirstCrossingFarahi`` ----------------------------------- An excursion set first crossing statistics class using the algorithm of :cite:t:`benson_dark_2012`. For trajectories originating from a point :math:`(S_1,\delta_1)`, the distribution of first crossings of a barrier :math:`B(S)`, :math:`f(S)`, is obtained by finding the solution to the integral equation: .. math:: :label: eq-OldExcursionMethod 1 = \int_0^S f(\tilde{S})\mathrm{d}\tilde{S} + \int_{-\infty}^{B(S)} P(\delta,S) \mathrm{d} \delta, where :math:`P(\delta,S) \mathrm{d} \delta` is the probability for a trajectory to lie between :math:`\delta` and :math:`\delta + \mathrm{d} \delta` at variance :math:`S`, having originated from the point :math:`(S_1,\delta_1)` having not crossed the barrier at any smaller :math:`\tilde{S} < S`. In the absence of a barrier, :math:`P(\delta,S)` would be equal to :math:`P_0(\delta,S)`. However, since some trajectories will have crossed the barrier at :math:`\tilde{S} < S` we must subtract off their contribution to :math:`P_0(\delta,S)`. Writing the distribution of :math:`\delta` at :math:`S` for trajectories originating at some :math:`(\tilde{\delta},\tilde{S})` as :math:`P^\prime(\delta|S,\tilde{\delta},\tilde{S})`, we can therefore write .. math:: P(\delta,S) = P_0(\delta,S) - \int_{0}^{S} f(\tilde{S}) P^\prime(\delta|S,\tilde{\delta},\tilde{S}) \mathrm{d}\tilde{S}, For an interesting class of cases, both :math:`P_0(\delta,S)` and :math:`P^\prime(\delta|S,\tilde{\delta},\tilde{S})` are normal distributions, and we can write .. math:: P_0(\delta,S) = \frac{1}{\sqrt{2 \pi S}} \exp\left\{-{\Delta \delta^2 [\delta,\delta_1,S,S_1] \over 2 \Delta S [S,S_1]}\right\}, and .. math:: P^\prime(\delta|S,\tilde{\delta},\tilde{S}) = \frac{1}{\sqrt{2 \pi \Delta S[S,\tilde{S}]}} \exp\left\{-{\Delta \delta^2 [\delta,\tilde{\delta},S,\tilde{S}] \over 2 \Delta S [S,\tilde{S}]}\right\}, where we refer to :math:`\Delta \delta[\delta,\tilde{\delta},S,\tilde{S}]` as the "effective offset", and to :math:`\Delta S[S,\tilde{S}] = \mathrm{Var}(S) - \mathrm{Cov}(S,\tilde{S})` as the "residual variance". Note that :math:`\mathrm{Cov}(S,S_1) = 0` (since all trajectories pass through :math:`\delta_1` at :math:`S_1`), and so :math:`\Delta S[S,S_1] = \mathrm{Var}(S)`. For a standard Weiner process (such as applies to the standard case considered in excursion set theory, namely uncorrelated and unconstrained steps), we have trivially that .. math:: \Delta \delta[\delta,\tilde{\delta},S,\tilde{S}] = \delta - \tilde{\delta}, and .. math:: \Delta S[S,\tilde{S}] = S - \tilde{S}, since the Weiner process is invariant under translations of the starting point. Using the above results, we can rewrite eqn. (:eq:`eq-OldExcursionMethod`): .. math:: 1 = \int_0^S f(\tilde{S})\mathrm{d}\tilde{S} + \int_{-\infty}^{B(S)} \left[ P_0(\delta,S) - \int_{0}^{S} f(\tilde{S}) P^\prime(\delta|S,\tilde{\delta},\tilde{S}) \mathrm{d} \delta \right] , in general and, for the case of a Gaussian distribution: .. math:: 1 = \int_0^S f(\tilde{S})\mathrm{d}\tilde{S} + \int_{-\infty}^{B(S)} \left[ \frac{1}{\sqrt{2 \pi \Delta S[S,S_1]}} \exp\left(-\frac{\Delta \delta^2[\delta,\delta_1,S,S_1]}{2 \Delta S[S,S_1]}\right) - \int_{0}^{S} f(\tilde{S}) \frac{1}{\sqrt{2 \pi \Delta S [S,\tilde{S}]}} \exp\left(-\frac{\Delta \delta^2[\delta,B(\tilde{S}),S,\tilde{S}]}{2 \Delta S [S,\tilde{S}]}\right)\mathrm{d}\tilde{S} \right] \mathrm{d} \delta . The integral over :math:`\mathrm{d}\delta` can be carried out analytically to give: .. math:: :label: eq-NewExcursionMethod 1 = \int_0^S f(\tilde{S})\mathrm{d}\tilde{S}+ \hbox{erf}\left\{\frac{\Delta \delta [B(S),\delta_1,S,S_1]}{\sqrt{2\Delta S[S,S_1]}}\right\} - \int_{0}^{S} f(\tilde{S}) \hbox{erf}\left\{\frac{\Delta \delta [B(S),B(\tilde{S}),S,\tilde{S}]}{\sqrt{2 \Delta S [S,\tilde{S}]}}\right\} \mathrm{d}S^{\prime\prime}. We now discretize eqn. (:eq:`eq-NewExcursionMethod`). Specifically, we divide the :math:`S` space into :math:`N` intervals defined by the points: .. math:: S_i = \left\{ \begin{array}{ll} 0 & \hbox{if } i=0 \\ \sum_{j=0}^{i-1} \Delta S_j & \hbox{if } i > 1. \end{array} \right. Note that :math:`f(0)=0` by definition, so :math:`f(S_0)=0` always. We choose :math:`\Delta S_i = S_\mathrm{max}/N` (i.e. uniform spacing in :math:`S`) when computing first crossing distributions, and :math:`\Delta S_i \propto S_i` (i.e. uniform spacing in :math:`\log(S)`) when computing first crossing rates. Discretizing the integrals in eqn. (:eq:`eq-NewExcursionMethod`) gives: .. math:: :label: eq-Des1 \int_0^{S_i} f(\tilde{S})\d \tilde{S} = \sum_{j=0}^{i-1} \frac{f(S_j) + f(S_{j+1})}{2} \Delta S_j and: .. math:: :label: eq-Des2 \int_{0}^{S_i} f(\tilde{S}) \hbox{erf}\left\{\frac{\Delta \delta [B(S),B(\tilde{S}),S,\tilde{S}]}{\sqrt{2 \Delta S[S,\tilde{S}]}}\right\} \d \tilde{S} = \sum_{j=0}^{i-1} \frac{1}{2} \left(f(S_j) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_j), S_i, S_j]}{\sqrt{2 \Delta S[S_i,S_j]}}\right\} + f(S_{j+1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_{j+1}),S_i,S_{j+1}]}{\sqrt{2 \Delta S[S_i,S_{j+1}]}}\right\} \right) \Delta S_j. We can now rewrite eqn. (:eq:`eq-NewExcursionMethod`) in discretized form: .. math:: :label: eq-DesFinal1 1 = \sum_{j=0}^{i-1} \frac{f(S_j) + f(S_{j+1})}{2} \Delta S_j + \hbox{erf}\left\{\frac{\Delta \delta [B(S_i),\delta_1,S_i,S_1]}{\sqrt{2 \Delta S[S_i,S_1]}}\right\} - \frac{1}{2} \sum_{j=0}^{i-1} \left( f(S_j) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_j),S_i,S_j]}{\sqrt{2 \Delta S[S_i,S_j]}}\right\} + f(S_{j+1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_{j+1}),S_i,S_{j+1}]}{\sqrt{2 \Delta S[S_i,S_{j+1}]}}\right\} \right) \Delta S_j. Solving eqn. (:eq:`eq-DesFinal1`) for :math:`f(S_i)`: .. math:: :label: eq-DesFinal11 \left( \frac{1}{2} - \frac{1}{2} \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_i), S_i, S_i]}{\sqrt{2 \Delta S[S_i,S_i]}}\right\} \right) \Delta S_{i-1} f(S_i) & = 1 - \sum_{j=0}^{i-2} \frac{f(S_j) + f(S_{j+1})}{2} \Delta S_j - \frac{f(S_{i-1})}{2} \Delta S_{i-1} - \hbox{erf}\left\{\frac{\Delta \delta [B(S_i),\delta_1,S_i,S_1]}{\sqrt{2 \Delta S[S_i,S_1]}}\right\} \nonumber \\ & + \frac{1}{2} \sum_{j=0}^{i-2} \left( f(S_j) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_j),S_i,S_j]}{\sqrt{2 \Delta S [S_i,S_j]}}\right\} + f(S_{j+1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_{j+1}),S_i,S_{j+1}]}{\sqrt{2 \Delta S[S_i,S_{j+1}]}}\right\} \right)\Delta S_j \nonumber \\ & + \frac{1}{2} f(S_{i-1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_{i-1}),S_i,S_{i-1}]}{\sqrt{2 \Delta S [S_i,S_{i-1}]}}\right\} \Delta S_{i-1}. For all barriers that we consider: .. math:: \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_i),S_i,S_i]}{\sqrt{2 \Delta S[S_i,S_i]}}\right\} = 0. We can then simplify eqn. (:eq:`eq-DesFinal11`): .. math:: :label: eq-DesFinal2 f(S_i) & = {2 \over \Delta S_{i-1}}\left[1 - \sum_{j=0}^{i-2} \frac{f(S_j) + f(S_{j+1})}{2} \Delta S_j - \frac{f(S_{i-1})}{2} \Delta S_{i-1} - \hbox{erf}\left\{\frac{\Delta \delta [B(S_i),\delta_1,S_i,S_1]}{\sqrt{2 \Delta S [S_i,S_1] }}\right\} \right. \nonumber \\ & + \frac{1}{2} \sum_{j=0}^{i-2} \left( f(S_j) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_j),S_i,S_j]}{\sqrt{2 \Delta S [S_i,S_j]}}\right\} + f(S_{j+1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_{j+1}),S_i,S_{j+1}]}{\sqrt{2 \Delta S [S_i,S_{j+1}]}}\right\} \right)\Delta S_j \nonumber \\ & \left. + \frac{1}{2} f(S_{i-1}) \hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_{i-1}),S_i,S_{i-1}]}{\sqrt{2 \Delta S [S_i,S_{i-1}]}}\right\} \Delta S_{i-1}\right]. Consolidating terms in the summations: .. math:: :label: eq-DesFinal2a f(S_i) = {2 \over \Delta S_{i-1}}\left[1 - \hbox{erf}\left\{\frac{\Delta \delta [B(S_i),\delta_1,S_i,S_1]}{\sqrt{2\Delta S[S_i,S_1]}}\right\} - \sum_{j=0}^{i-1} \left( 1-\hbox{erf}\left\{\frac{\Delta \delta [B(S_i) , B(S_j),S_i,S_j]}{\sqrt{2 \Delta S [S_i,S_j]}}\right\} \right) f(S_j) {\Delta S_{j-1} + \Delta S_j \over 2} \right]. In the case of constant :math:`\Delta S_j(=\Delta S)` this can be simplified further: .. math:: :label: eq-DesFinal3 f(S_i) = {2 \over \Delta S}\left[1 - \hbox{erf}\left\{\frac{\Delta \delta [B(S_i),\delta_1,S_i,S_1]}{\sqrt{2\Delta S [S_i,S_1]}}\right\}\right] - 2 \sum_{j=0}^{i-1} \left(1- \hbox{erf}\left\{\frac{\Delta \delta [B(S_i), B(S_j),S_i,S_j]}{\sqrt{2 \Delta S[S_i,S_j]}}\right\} \right) f(S_j). In either case (i.e. eqns. :eq:`eq-DesFinal2a` and :eq:`eq-DesFinal3`) solution proceeds recursively: :math:`f(S_0)=0` by definition, :math:`f(S_1)` depends only on the known barrier and :math:`f(S_0)`, :math:`f(S_i)` depends only on the known barrier and :math:`f(S_{`_ constraint. Specifically, the trajectories are constrained to pass through a point :math:`(S_2,\delta_2)` (specified by the parameter ``[varianceConstrained]`` and ``[criticalOverdensityConstrained]``, or equivalently by the parameters ``[massConstrained]`` and ``[timeConstrained]``---note that :math:`(S_2,\delta_2)` here follow the convention in excursion set literature that :math:`S_2` is the variance evaluated at the present day, while :math:`\delta_2` the the critical overdensity for collapse divided by the linear growth factor), and, of course, always pass through the initial point :math:`(S_1,\delta_1)` corresponding to the current halo. For a Brownian bridge the distribution of :math:`\delta` at some :math:`S` (where :math:`S_1 \le S \le S_2`), :math:`P_0(\delta|S)`, is given by a normal distribution with mean .. math:: \mu(S) = \delta_1 + \frac{\delta_2-\delta_1}{S_2-S_1}(S - S_1) and variance .. math:: \mathrm{Var}(S) = \frac{(S_2-S)(S-S_1)}{S_2-S_1}, and the covariance between two points :math:`S_\mathrm{a}` and :math:`S_\mathrm{b} > S_\mathrm{a}` is given by, .. math:: \mathrm{Cov}(S_\mathrm{a},S_\mathrm{b}) = \frac{(S_2-S_\mathrm{b})(S_\mathrm{a}-S_1)}{S_2-S_1}. Therefore, the same approach to solving for the first crossing distribution as was utilized by :cite:t:`benson_dark_2012` and improved by :cite:p:`du_substructure_2017` can be used (see :galacticus-class:`excursionSetFirstCrossingFarahi` and :galacticus-class:`excursionSetFirstCrossingFarahiMidpoint` for details), with just the appropriate change in the effective offset, :math:`\Delta \delta`, and residual variance, :math:`\Delta S`. Considering two points :math:`(S,\delta)` and :math:`(\tilde{S},\tilde{\delta})` the effective offset is just the difference in their offsets relative to their local means: .. math:: \Delta \delta = [ \delta - \mu(S) ] - [ \tilde{\delta} - \mu(\tilde{S}) ] = \delta - \tilde{\delta} - \frac{S-\tilde{S}}{S_2-S_1}(\delta_2-\delta_1), while the residual variance is, as always, just the variance at :math:`(S,\delta)` minus the covariance between the two points: .. math:: \Delta S = \mathrm{Var}(S) - \mathrm{Cov}(B({\tilde{S}}),\delta) = \frac{(S_2-S)(S-S_1)}{S_2-S_1} - \frac{(S_2-S)(\tilde{S}-S_1)}{S_2-S_1}. which simplifies to .. math:: \Delta S = \frac{(S_2-S)(S-\tilde{S})}{S_2-S_1}. Note that, in solving for the first crossing distribution we must also evaluate terms of the form .. math:: \int_{-\infty}^{\delta} P_{0}(\delta^\prime,S) \mathrm{d}\delta^\prime = \mathrm{erf}\left( \frac{\delta^\prime - \mu(S)}{\sqrt{2 \mathrm{Var}(S)}}\right). In these cases we still use the residual variance since :math:`\Delta S \rightarrow \mathrm{Var}(S)` as :math:`\tilde{S} \rightarrow S_1`. When computing the distribution, :math:`p(\delta,s)`, of trajectories at variance :math:`S`, given that the first crossed the barrier, :math:`B(\tilde{S})`, at some smaller variance, :math:`\tilde{S}`, (equation A2 of :cite:author:`benson_dark_2012` :cite:year:`benson_dark_2012`) we must condition *both* the residual variance and drift term on the intermediate point, :math:`\tilde{S},B(\tilde{S})`. Fortunately, given any Brownian random walk (including Brownian bridges) for which we know two points, the distribution of trajectories between those points is simply another Brownian bridge. Therefore, we can write: .. math:: \Delta \delta = \delta - \tilde{\delta} - \frac{S-\tilde{S}}{S_2-\tilde{S}}(\delta_2-\tilde{\delta}), and: .. math:: \Delta S = \frac{(S_2-S)(S-\tilde{S})}{S_2-\tilde{S}}. This class provides functions implementing these modified effective offset and residual variance. **Parameters** * ``[fractionalTimeStep]`` (default ``0.01d0``) — The fractional time step used when computing barrier crossing rates (i.e. the step used in finite difference calculations). * ``[criticalOverdensityConstrained]`` — The linear theory critical overdensity :math:`\delta_\mathrm{c}` (extrapolated to the present epoch) that defines the constrained end-point of the Brownian bridge in excursion-set space; used together with ``varianceConstrained`` to pin the random walk to a specific progenitor halo. * ``[varianceConstrained]`` — The mass variance :math:`\sigma^2(M)` corresponding to the constrained end-point mass of the Brownian bridge; together with ``criticalOverdensityConstrained`` it specifies the progenitor mass to which the excursion-set random walk is conditioned. * ``[redshiftConstrained]`` — The redshift of the progenitor epoch that defines the constrained end-point of the Brownian bridge; converted internally to a cosmic time and then to a linear overdensity threshold via the critical overdensity at that epoch. * ``[massConstrained]`` — The halo mass (:math:`\mathrm{M}_\odot`) of the constrained progenitor at the end of the Brownian bridge; converted internally to a mass variance :math:`\sigma^2(M)` that pins the excursion-set random walk to a specific progenitor scale. * ``[criticalOverdensityConstrained]`` — The linear theory critical overdensity :math:`\delta_\mathrm{c}` (extrapolated to the present epoch) that defines the constrained end-point of the Brownian bridge in excursion-set space; used together with ``varianceConstrained`` to pin the random walk to a specific progenitor halo. * ``[varianceConstrained]`` — The mass variance :math:`\sigma^2(M)` corresponding to the constrained end-point mass of the Brownian bridge; together with ``criticalOverdensityConstrained`` it specifies the progenitor mass to which the excursion-set random walk is conditioned. * ``[redshiftConstrained]`` — The redshift of the progenitor epoch that defines the constrained end-point of the Brownian bridge; converted internally to a cosmic time and then to a linear overdensity threshold via the critical overdensity at that epoch. * ``[massConstrained]`` — The halo mass (:math:`\mathrm{M}_\odot`) of the constrained progenitor at the end of the Brownian bridge; converted internally to a mass variance :math:`\sigma^2(M)` that pins the excursion-set random walk to a specific progenitor scale. .. _physics-excursionSetFirstCrossingLinearBarrier: ``excursionSetFirstCrossingLinearBarrier`` ------------------------------------------ An excursion set first crossing statistics class for linear barriers. Specifically, the first crossing distribution is .. math:: f(S,t) = B(0,t) \exp(- B(S,t)^2/2S)/S/\sqrt{2 pi S}, where :math:`B(S,t)` is the (assumed-to-be-linear-in-:math:`S`) barrier at time :math:`t` and variance :math:`S`. The first crossing rate is computed using a finite difference approximation between two closely-spaced times. The non-crossing rate is zero. **(Default implementation)** **Methods** * ``tabulate`` — Tabulate the virial density contrast as a function of mass and time. * ``restoreTable`` — Restore a tabulated solution from file. * ``storeTable`` — Store a tabulated solution to file. **Parameters** * ``[velocityCharacteristic]`` (default ``250.0d0``) — The velocity scale at which the :term:`SNe`-driven outflow rate equals the star formation rate in disks. * ``[exponent]`` (default ``3.5d0``) — The velocity scaling of the :term:`SNe`-driven outflow rate in disks. * ``[fraction]`` (default ``0.01d0``) — The normalization :math:`f` of the outflow rate relative to the star formation rate at a reference halo velocity of 200 km/s and expansion factor of 1, setting the overall mass-loading amplitude of the halo-scaling feedback model. * ``[exponentVelocity]`` (default ``-2.0d0``) — The exponent of virial velocity in the outflow rate in disks. * ``[exponentRedshift]`` (default ``0.0d0``) — The power-law exponent of the cosmological expansion factor :math:`(1+z)` in the halo-scaling outflow rate, allowing the mass-loading factor to evolve with redshift; a value of zero gives no redshift evolution. * ``[toleranceRelativeVelocityDispersion]`` (default ``1.0d-6``) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles. * ``[toleranceRelativeVelocityDispersionMaximum]`` (default ``1.0d-3``) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles. * ``[radiusNormalization]`` (default ``3.3d-6``) — The initial value appearing in the radius-mass relation * ``[toleranceAbsoluteMass]`` (default ``1.0d-6``) — The mass tolerance used to judge whether the nuclear star cluster is physically plausible. * ``[toleranceRelativeMetallicity]`` (default ``1.0d-4``) — The metallicity tolerance for ODE solution. * ``[inactiveLuminositiesStellar]`` (default ``.false.``) — Specifies whether or not nuclear star cluster stellar luminosities are inactive properties (i.e. do not appear in any ODE being solved). * ``[scaleRelativeMass]`` (default ``1.0d-2``) — The mass scale, relative to the total mass of the node, below which calculations in the delayed very simple hot halo component are allowed to become inaccurate. * ``[starveSatellites]`` (default ``.false.``) — Specifies whether or not the hot halo should be removed ("starved") when a node becomes a satellite. * ``[starveSatellitesOutflowed]`` (default ``.false.``) — Specifies whether or not the outflowed hot halo should be removed ("starved") when a node becomes a satellite. * ``[outflowReturnOnFormation]`` (default ``.false.``) — Specifies whether or not outflowed gas should be returned to the hot reservoir on halo formation events. * ``[angularMomentumAlwaysGrows]`` (default ``.false.``) — Specifies whether or not negative rates of accretion of angular momentum into the hot halo will be treated as positive for the purposes of computing the hot halo angular momentum. * ``[fractionBaryonLimitInNodeMerger]`` (default ``.false.``) — Controls whether the hot gas content of nodes should be limited to not exceed the universal baryon fraction at node merger events. If set to ``true``, hot gas (and angular momentum, abundances, and chemicals proportionally) will be removed from the merged halo to the unaccreted gas reservoir to limit the baryonic mass to the universal baryon fraction where possible. * ``[scaleAbsoluteMass]`` (default ``100.0d0``) — The absolute mass scale below which calculations in the very simple disk component are allowed to become inaccurate. * ``[toleranceAbsoluteMass]`` (default ``1.0d-6``) — The mass tolerance used to judge whether the disk is physically plausible. * ``[toleranceAbsoluteMass]`` (default ``1.0d-6``) — The mass tolerance used to judge whether the disk is physically plausible. * ``[toleranceRelativeMetallicity]`` (default ``1.0d-4``) — The metallicity tolerance for ODE solution. * ``[radiusStructureSolver]`` (default ``1.0d0``) — The radius (in units of the standard scale length) to use in solving for the size of the disk. * ``[structureSolverUseCole2000Method]`` (default ``.false.``) — If true, use the method described in :cite:t:`cole_hierarchical_2000` to correct for difference between thin disk and spherical mass distributions when solving for disk radii. * ``[diskNegativeAngularMomentumAllowed]`` (default ``.true.``) — Specifies whether or not negative angular momentum is allowed for the disk. * ``[inactiveLuminositiesStellar]`` (default ``.false.``) — Specifies whether or not disk stellar luminosities are inactive properties (i.e. do not appear in any ODE being solved). * ``[postStepZeroNegativeMasses]`` (default ``.true.``) — If true, negative masses will be zeroed after each ODE step. Note that this can lead to non-conservation of mass. * ``[ratioAngularMomentumSolverRadius]`` (default ``ratioAngularMomentumSolverRadiusDefault``) — The assumed ratio of the specific angular momentum at the structure solver radius to the mean specific angular momentum of the standard disk component. * ``[scaleAbsoluteMass]`` (default ``100.0d0``) — The absolute mass scale below which calculations in the very simple spheroid component are allowed to become inaccurate. * ``[toleranceAbsoluteMass]`` (default ``1.0d-6``) — The mass tolerance used to judge whether the spheroid is physically plausible. * ``[efficiencyEnergeticOutflow]`` (default ``1.0d-2``) — The proportionality factor relating mass outflow rate from the spheroid to the energy input rate divided by :math:`V_\mathrm{spheroid}^2`. * ``[toleranceRelativeMetallicity]`` (default ``1.0d-4``) — The metallicity tolerance for ODE solution. * ``[toleranceAbsoluteMass]`` (default ``1.0d-6``) — The mass tolerance used to judge whether the spheroid is physically plausible. * ``[inactiveLuminositiesStellar]`` (default ``.false.``) — Specifies whether or not spheroid stellar luminosities are inactive properties (i.e. do not appear in any ODE being solved). * ``[postStepZeroNegativeMasses]`` (default ``.true.``) — If true, negative masses will be zeroed after each ODE step. Note that this can lead to non-conservation of mass. * ``[ratioAngularMomentumScaleRadius]`` (default ``ratioAngularMomentumScaleRadiusDefault``) — The assumed ratio of the specific angular momentum at the scale radius to the mean specific angular momentum of the standard spheroid component. * ``[outputMergers]`` (default ``.false.``) — Determines whether or not properties of black hole mergers will be output. * ``[fileNames]`` — The name of the file(s) from which merger tree data should be read when using the ``[mergerTreeConstruct]``\ :math:`=`\ ``read`` tree construction method. * ``[forestSizeMaximum]`` (default ``0_c_size_t``) — The maximum number of nodes allowed in a forest before it will be broken up into trees and processed individually. A value of 0 implies that forests should never be split. * ``[presetMergerTimes]`` (default ``.true.``) — Specifies whether merging times for subhalos should be preset when reading merger trees from a file. * ``[presetMergerNodes]`` (default ``.true.``) — Specifies whether the target nodes for mergers should be preset (i.e. determined from descendant nodes). If they are not, merging will be with each satellite's host node. * ``[presetSubhaloMasses]`` (default ``.true.``) — Specifies whether subhalo mass should be preset when reading merger trees from a file. * ``[subhaloAngularMomentaMethod]`` (default ``var_str('summation')``) — Specifies how to account for subhalo angular momentum when adding subhalo mass to host halo mass. * ``[presetSubhaloIndices]`` (default ``.true.``) — Specifies whether subhalo indices should be preset when reading merger trees from a file. * ``[presetPositions]`` (default ``.true.``) — Specifies whether node positions should be preset when reading merger trees from a file. * ``[presetScaleRadii]`` (default ``.true.``) — Specifies whether node scale radii should be preset when reading merger trees from a file. * ``[scaleRadiiFailureIsFatal]`` (default ``.true.``) — Specifies whether failure to set a node scale radii should be regarded as a fatal error. (If not, a fallback method to set scale radius is used in such cases.) * ``[presetScaleRadiiConcentrationMinimum]`` (default ``3.0d0``) — The lowest concentration (:math:`c=r_\mathrm{vir}/r_\mathrm{s}`) allowed when setting scale radii, :math:`r_\mathrm{s}`. * ``[presetScaleRadiiConcentrationMaximum]`` (default ``60.0d0``) — The largest concentration (:math:`c=r_\mathrm{vir}/r_\mathrm{s}`) allowed when setting scale radii, :math:`r_\mathrm{s}`. * ``[presetScaleRadiiMinimumMass]`` (default ``0.0d0``) — The minimum halo mass for which scale radii should be preset (if ``[presetScaleRadii]``\ :math:`=`\ ``true``). * ``[presetUnphysicalAngularMomenta]`` (default ``.false.``) — When reading merger trees from file and presetting halo angular momenta, detect unphysical (<=0) angular momenta and preset them using the selected halo spin method. * ``[presetAngularMomenta]`` (default ``.true.``) — Specifies whether node angular momenta should be preset when reading merger trees from a file. * ``[presetAngularMomenta3D]`` (default ``.false.``) — Specifies whether node 3-D angular momenta vectors should be preset when reading merger trees from a file. * ``[presetOrbits]`` (default ``.true.``) — Specifies whether node orbits should be preset when reading merger trees from a file. * ``[presetOrbitsSetAll]`` (default ``.true.``) — Forces all orbits to be set. If the computed orbit does not cross the virial radius, then select one at random instead. * ``[presetOrbitsAssertAllSet]`` (default ``.true.``) — Asserts that all virial orbits must be preset. If any can not be set, Galacticus will stop. * ``[presetOrbitsBoundOnly]`` (default ``.true.``) — Specifies whether only bound node orbits should be set. * ``[beginAt]`` (default ``-1_kind_int8``) — Specifies the index of the tree to begin at. (Use -1 to always begin with the first tree.) * ``[outputTimeSnapTolerance]`` (default ``0.0d0``) — The relative tolerance required to "snap" a node time to the closest output time. * ``[missingHostsAreFatal]`` (default ``.true.``) — Specifies whether nodes with missing host nodes should be considered to be fatal---see the discussion of missing host nodes in the class description above. * ``[treeIndexToRootNodeIndex]`` (default ``.false.``) — Specifies whether tree indices should always be set to the index of their root node. * ``[allowBranchJumps]`` (default ``.true.``) — Specifies whether nodes are allowed to jump between branches. * ``[allowSubhaloPromotions]`` (default ``.true.``) — Specifies whether subhalos are permitted to be promoted to being isolated halos. * ``[alwaysPromoteMostMassive]`` (default ``.false.``) — If true, the most massive progenitor is always promoted to be the primary progenitor *even if* it is a subhalo. Otherwise, isolated progenitors are given priority over subhalo progenitors, even if they are less massive. * ``[presetNamedReals]`` — Names of real datasets to be additionally read and stored in the nodes of the merger tree when using the ``[mergerTreeConstruct]``\ :math:`=`\ ``read`` tree construction method. * ``[presetNamedIntegers]`` — Names of integer datasets to be additionally read and stored in the nodes of the merger tree when using the ``[mergerTreeConstruct]``\ :math:`=`\ ``read`` tree construction method. * ``[fatalMismatches]`` (default ``.true.``) — Specifies whether mismatches in cosmological parameter values between Galacticus and "Sussing Merger Trees" format :cite:p:`srisawat_sussing_2013` merger tree files should be considered fatal. * ``[fatalNonTreeNode]`` (default ``.true.``) — Specifies whether nodes in snapshot files but not in the merger tree file should be considered fatal when importing from the "Sussing Merger Trees" format :cite:p:`srisawat_sussing_2013`. * ``[subvolumeCount]`` (default ``1``) — Specifies the number of subvolumes *along each axis* into which a "Sussing Merger Trees" format :cite:p:`srisawat_sussing_2013` merger tree files should be split for processing through Galacticus. * ``[subvolumeBuffer]`` (default ``0.0d0``) — Specifies the buffer region (in units of Mpc\ :math:`/h` to follow the format convention) around subvolumes of a "Sussing Merger Trees" format :cite:p:`srisawat_sussing_2013` merger tree file which should be read in to ensure that no halos are missed from trees. * ``[subvolumeIndex]`` (default ``[0,0,0]``) — Specifies the index (in each dimension) of the subvolume of a "Sussing Merger Trees" format :cite:p:`srisawat_sussing_2013` merger tree file to process. Indices range from 0 to ``[subvolumeCount]``\ :math:`-1`. * ``[badValue]`` (default ``-0.5d0``) — Use for bad value detection in "Sussing" merger trees. Values for scale radius and halo spin which exceed this threshold are assumed to be bad. * ``[badValueTest]`` (default ``var_str('lessThan')``) — Use for bad value detection in "Sussing" merger trees. Values which exceed the threshold in ths specified direction are assumed to be bad. * ``[treeSampleRate]`` (default ``1.0d0``) — Specify the probability that any given tree should processed (to permit subsampling). * ``[massOptions]`` (default ``var_str('default')``) — Mass option for Sussing merger trees. * ``[mergeProbability]`` (default ``0.1d0``) — The largest probability of branching allowed in a timestep in merger trees built by the :cite:t:`cole_hierarchical_2000` method. * ``[accretionLimit]`` (default ``0.1d0``) — The largest fractional mass change due to subresolution accretion allowed in a timestep in merger trees built by the :cite:t:`cole_hierarchical_2000` method. * ``[redshiftMaximum]`` (default ``1.0d5``) — The highest redshift to which merger trees will be built in the :cite:t:`cole_hierarchical_2000` method. * ``[toleranceTimeEarliest]`` (default ``2.0d-6``) — The fractional tolerance used to judge if a branch is at the earliest allowed time in the tree. * ``[branchIntervalStep]`` (default ``.true.``) — If ``false`` use the original :cite:t:`cole_hierarchical_2000` method to determine whether branching occurs in a timestep. If ``true`` draw branching intervals from a negative exponential distribution. * ``[toleranceResolutionSelf]`` (default ``1.0d-6``) — The fractional tolerance in node mass at the resolution limit below which branch mis-orderings will be ignored. * ``[toleranceResolutionParent]`` (default ``1.0d-3``) — The fractional tolerance in parent node mass at the resolution limit below which branch mis-orderings will be ignored. * ``[ignoreNoProgress]`` (default ``.false.``) — If true, failure to make progress on a branch will be ignored (and the branch terminated). * ``[ignoreWellOrdering]`` (default ``.false.``) — If true, non-well-ordered tree branches are pruned away instead of causing errors.. * ``[redshiftBase]`` (default ``0.0d0``) — The redshift at which to plant the base node when building merger trees. * ``[timeSnapTolerance]`` (default ``1.0d-6``) — The fractional tolerance within which the tree base time will be snapped to a nearby output time. * ``[treeBeginAt]`` (default ``0``) — The index (in order of increasing base halo mass) of the tree at which to begin when building merger trees. A value of "0" means to begin with tree number 1 (if processing trees in ascending order), or equal to the number of trees (otherwise). * ``[processDescending]`` (default ``.true.``) — If true, causes merger trees to be processed in order of decreasing mass. * ``[splitTrees]`` (default ``.false.``) — If true, prune away any nodes of the tree that are not needed to determine evolution up to the latest time at which a node is present inside the lightcone. This typically leads to a tree splitting into a forest of trees. * ``[label]`` — A label for the mass function. * ``[comment]`` — A descriptive comment for the mass function. * ``[starFormationRates]`` — The star formation rates corresponding to bin centers. * ``[covarianceBinomialBinsPerDecade]`` (default ``10``) — The number of bins per decade of star formation rate to use when constructing star formation rate function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMinimum]`` (default ``1.0d10``) — The star formation rate to consider when constructing star formation rate function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMaximum]`` (default ``1.0d12``) — The maximum star formation rate to consider when constructing star formation rate function covariance matrices for main branch galaxies. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[likelihoodBins]`` — Controls which bins in the stellar mass--halo mass relation will be used in computing the likelihood: * *not present*: all bins are included in the likelihood calculation; * *list of integers*: use only the mass bin(s) given in this list in the likelihood calculation; * ``auto``: use only bins which have a non-zero number of halos contributing to them in the likelihood calculation. * ``[fileNameTarget]`` — The name of the file containing the target data. * ``[redshiftInterval]`` (default ``1``) — The redshift interval to use. * ``[likelihoodNormalize]`` (default ``.false.``) — If true, then normalize the likelihood to make it a probability density. * ``[computeScatter]`` (default ``.false.``) — If true, the scatter in log10(stellar mass) is computed. Otherwise, the mean is computed. * ``[systematicErrorPolynomialCoefficient]`` (default ``[0.0d0]``) — The coefficients of the systematic error polynomial for stellar mass in the stellar vs halo mass relation. * ``[systematicErrorMassHaloPolynomialCoefficient]`` (default ``[0.0d0]``) — The coefficients of the systematic error polynomial for halo mass in the stellar vs halo mass relation. * ``[errorTolerant]`` (default ``.false.``) — Error tolerance for the N-body spin distribution operator. * ``[logNormalRange]`` (default ``100.0d0``) — The multiplicative range of the log-normal distribution used to model the distribution of the mass and energy terms in the spin parameter. Specifically, the lognormal distribution is truncated outside the range :math:`(\lambda_\mathrm{m}/R,\lambda_\mathrm{m} R`, where :math:`\lambda_\mathrm{m}` is the measured spin, and :math:`R=`\ ``[logNormalRange]`` * ``[fileName]`` — The name of the file from which to read spin distribution function parameters. * ``[comment]`` — A comment describing this analysis. * ``[label]`` — A label for this analysis. * ``[label]`` — A label for the spin distribution function. * ``[comment]`` — A descriptive comment for the spin distribution function. * ``[redshift]`` — The redshift at which to compute the spin distribution function. * ``[massMinimum]`` — Minimum halo mass for the spin distribution function. * ``[massMaximum]`` — Maximum halo mass for the spin distribution function. * ``[spinMinimum]`` — Minimum spin for the spin distribution function. * ``[spinMaximum]`` — Maximum spin for the spin distribution function. * ``[countSpinsPerDecade]`` — Number of spins per decade at which to compute the spin distribution function. * ``[timeRecent]`` — Halos which experienced a major node merger within a time :math:`\Delta t=`\ ``[timeRecent]`` of the analysis time will be excluded from the analysis. * ``[particleCountMinimum]`` — The minimum particle count to assume when computing N-body errors on spins. * ``[massParticle]`` — The mass of the particle used in the N-body simulation from which spins were measured. * ``[energyEstimateParticleCountMaximum]`` — The maximum number of particles used in estimating halo energies when measuring spins from the N-body simulation. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[label]`` — A label for the mass function. * ``[comment]`` — A descriptive comment for the mass function. * ``[masses]`` — The masses corresponding to bin centers. * ``[covarianceBinomialBinsPerDecade]`` (default ``10``) — The number of bins per decade of halo mass to use when constructing HI mass function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMinimum]`` (default ``1.0d8``) — The minimum halo mass to consider when constructing HI mass function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMaximum]`` (default ``1.0d16``) — The maximum halo mass to consider when constructing HI mass function covariance matrices for main branch galaxies. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[label]`` — A label for the luminosity function. * ``[comment]`` — A descriptive comment for the luminosity function. * ``[magnitudesAbsolute]`` — The absolute magnitudes corresponding to bin centers. * ``[covarianceBinomialBinsPerDecade]`` (default ``10``) — The number of bins per decade of halo mass to use when constructing luminosity function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMinimum]`` (default ``1.0d8``) — The minimum halo mass to consider when constructing luminosity function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMaximum]`` (default ``1.0d16``) — The maximum halo mass to consider when constructing luminosity function covariance matrices for main branch galaxies. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[label]`` — A label for the luminosity function. * ``[comment]`` — A descriptive comment for the luminosity function. * ``[luminosities]`` — The luminosities corresponding to bin centers. * ``[covarianceBinomialBinsPerDecade]`` (default ``10``) — The number of bins per decade of halo mass to use when constructing luminosity function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMinimum]`` (default ``1.0d8``) — The minimum halo mass to consider when constructing luminosity function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMaximum]`` (default ``1.0d16``) — The maximum halo mass to consider when constructing luminosity function covariance matrices for main branch galaxies. * ``[includeNitrogenII]`` (default ``.false.``) — If true, include contamination by the [NII] (6548\AA :math:`+` 6584\AA) doublet. * ``[depthOpticalISMCoefficient]`` (default ``1.0d0``) — Multiplicative coefficient for optical depth in the ISM. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[label]`` — A label for the mass function. * ``[comment]`` — A descriptive comment for the mass function. * ``[masses]`` — The masses corresponding to bin centers. * ``[covarianceBinomialBinsPerDecade]`` (default ``10``) — The number of bins per decade of halo mass to use when constructing stellar mass function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMinimum]`` (default ``1.0d8``) — The minimum halo mass to consider when constructing stellar mass function covariance matrices for main branch galaxies. * ``[covarianceBinomialMassHaloMaximum]`` (default ``1.0d16``) — The maximum halo mass to consider when constructing stellar mass function covariance matrices for main branch galaxies. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[rootVarianceFractionalMinimum]`` (default ``0.0d0``) — The minimum fractional root variance (relative to the target dataset). * ``[fileName]`` — The name of the file from which to read concentration distribution function parameters. * ``[comment]`` — A comment describing this analysis. * ``[label]`` — A label for this analysis. * ``[label]`` — A label for the concentration distribution function. * ``[comment]`` — A descriptive comment for the concentration distribution function. * ``[redshift]`` — The redshift at which to compute the concentration distribution function. * ``[massMinimum]`` — Minimum halo mass for the concentration distribution function. * ``[massMaximum]`` — Maximum halo mass for the concentration distribution function. * ``[concentrationMinimum]`` — Minimum concentration for the concentration distribution function. * ``[concentrationMaximum]`` — Maximum concentration for the concentration distribution function. * ``[countConcentrationsPerDecade]`` — Number of concentrations per decade at which to compute the concentration distribution function. * ``[timeRecent]`` — Halos which experienced a major node merger within a time :math:`\Delta t=`\ ``[timeRecent]`` of the analysis time will be excluded from the analysis. * ``[massParticle]`` — The particle mass in the source N-body simulation. * ``[targetLabel]`` — Label for the target dataset. * ``[functionValueTarget]`` — The target function for likelihood calculations. * ``[functionCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[fileName]`` — The name of the file from which to read star forming main sequence function parameters. * ``[comment]`` — A comment describing this analysis. * ``[label]`` — A label for this analysis. * ``[label]`` — A label for the star forming main sequence function. * ``[comment]`` — A descriptive comment for the star forming main sequence function. * ``[massMinimum]`` — Minimum stellar mass for the star forming main sequence function. * ``[massMaximum]`` — Maximum stellar mass for the star forming main sequence function. * ``[countMassesPerDecade]`` — Number of masses per decade at which to compute the star forming main sequence function. * ``[targetLabel]`` — Label for the target dataset. * ``[meanValueTarget]`` — The target function for likelihood calculations. * ``[meanCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[label]`` — A label for the mass function. * ``[comment]`` — A descriptive comment for the mass function. * ``[separations]`` — The separations corresponding to bin centers. * ``[massMinima]`` — The minimum mass of each mass sample. * ``[massMaxima]`` — The maximum mass of each mass sample. * ``[massHaloBinsPerDecade]`` (default ``10``) — The number of bins per decade of halo mass to use when constructing the mass function covariance matrix for main branch galaxies. * ``[massHaloMinimum]`` (default ``1.0d8``) — The minimum halo mass to consider when constructing the mass function covariance matrix for main branch galaxies. * ``[massHaloMaximum]`` (default ``1.0d16``) — The maximum halo mass to consider when constructing the mass function covariance matrix for main branch galaxies. * ``[wavenumberCount]`` (default ``60_c_size_t``) — The number of bins in wavenumber to use in computing the correlation function. * ``[wavenumberMinimum]`` (default ``1.0d-3``) — The minimum wavenumber to use when computing the correlation function. * ``[wavenumberMaximum]`` (default ``1.0d4``) — The maximum wavenumber to use when computing the correlation function. * ``[integralConstraint]`` — The integral constraint for these correlation functions. * ``[depthLineOfSight]`` — The line-of-sight depth over which the correlation function was projected. * ``[halfIntegral]`` — Set to true if the projection integrand should be over line-of-sight depths greater than zero. * ``[binnedProjectedCorrelationTarget]`` — The target function for likelihood calculations. * ``[binnedProjectedCorrelationCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[targetLabel]`` (default ``var_str('')``) — A label for the target dataset in a plot of this analysis. * ``[starFormationRateSpecificQuiescentLogarithmic]`` — The base-10 logarithm specific star formation rate (in units of Gyr\ :math:`^{-1}`) separating quiescent and star-forming galaxies. * ``[starFormationRateSpecificLogarithmicError]`` — The observational fractional error in specific star formation rate (in units of dex) of galaxies. * ``[fileName]`` — The name of the file from which to read quiescent fraction function parameters. * ``[comment]`` — A comment describing this analysis. * ``[label]`` — A label for this analysis. * ``[label]`` — A label for the star forming main sequence function. * ``[comment]`` — A descriptive comment for the star forming main sequence function. * ``[massMinimum]`` — Minimum stellar mass for the star forming main sequence function. * ``[massMaximum]`` — Maximum stellar mass for the star forming main sequence function. * ``[countMassesPerDecade]`` — Number of masses per decade at which to compute the star forming main sequence function. * ``[targetLabel]`` — Label for the target dataset. * ``[meanValueTarget]`` — The target function for likelihood calculations. * ``[meanCovarianceTarget]`` — The target function covariance for likelihood calculations. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[radiusFractionalTruncateMinimum]`` (default ``2.0d0``) — The minimum radius (in units of the virial radius) to begin truncating the density profile. * ``[radiusFractionalTruncateMaximum]`` (default ``4.0d0``) — The maximum radius (in units of the virial radius) to finish truncating the density profile. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[velocityDispersionApproximate]`` (default ``.true.``) — If ``true``, radial velocity dispersion is computed using an approximate method in which we assume that :math:`\sigma_\mathrm{r}^2(r) \rightarrow \sigma_\mathrm{r}^2(r) - (2/3) \epsilon(r)`, where :math:`\epsilon(r)` is the specific heating energy. If ``false`` then radial velocity dispersion is computed by numerically solving the Jeans equation. * ``[tolerateEnclosedMassIntegrationFailure]`` (default ``.false.``) — If ``true``, tolerate failures to find the mass enclosed as a function of radius. * ``[tolerateVelocityDispersionFailure]`` (default ``.false.``) — If ``true``, tolerate failures to compute the velocity dispersion. * ``[tolerateVelocityMaximumFailure]`` (default ``.false.``) — If ``true``, tolerate failures to find the radius of the maximum circular velocity. * ``[toleratePotentialIntegrationFailure]`` (default ``.false.``) — If ``true``, tolerate numerical failures when computing the gravitational potential of a heated dark matter profile, allowing the calculation to continue with a fallback result rather than aborting. * ``[toleranceRelativeVelocityDispersion]`` (default ``1.0d-6``) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles. * ``[toleranceRelativeVelocityDispersionMaximum]`` (default ``1.0d-3``) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles. * ``[fractionRadiusFinalSmall]`` (default ``1.0d-3``) — The initial radius is limited to be no smaller than this fraction of the final radius. This can help avoid problems in profiles that are extremely close to being disrupted. * ``[toleranceRelativePotential]`` (default ``1.0d-3``) — The maximum allowed relative tolerance to use in numerical solutions for the gravitational potential in dark-matter-only density profiles before aborting. * ``[tolerateVelocityMaximumFailure]`` (default ``.true.``) — If true, tolerate failures to find the radius of the peak in the rotation curve. * ``[lengthResolution]`` — The gravitational softening length :math:`\Delta x` (in Mpc) of the N-body simulation, which sets the minimum spatial scale below which the dark matter profile is smoothed to avoid artificial two-body effects. * ``[massResolution]`` — The mass resolution :math:`\Delta M` (in :math:`\mathrm{M}_\odot`) of the N-body simulation, representing the minimum halo mass that can be resolved; profiles of halos near this limit are softened to account for particle discreteness effects. * ``[resolutionIsComoving]`` — If true, the resolution length is assumed to be fixed in comoving coordinates, otherwise in physical coordinates. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[C]`` (default ``400.0d0``) — The parameter :math:`C` appearing in the halo concentration algorithm of :cite:t:`ludlow_mass-concentration-redshift_2016`. * ``[f]`` (default ``0.02d0``) — The parameter :math:`f` appearing in the halo concentration algorithm of :cite:t:`ludlow_mass-concentration-redshift_2016`. * ``[timeFormationSeekDelta]`` (default ``0.0d0``) — The parameter :math:`\Delta \log t` by which the logarithm of the trial formation time is incremented when stepping through the formation history of a node to find the formation time. If set to zero (or a negative value) the cumulative mass histories of nodes are assumed to be monotonic functions of time, and the formation time is instead found by a root finding algorithm, * ``[massBoundIsInactive]`` (default ``.false.``) — Specifies whether or not the bound mass of the satellite component is inactive (i.e. does not appear in any ODE being solved). * ``[useLastIsolatedTime]`` (default ``.false.``) — If true, evaluate the halo virial radius using a the virial density definition at the last isolated time of the halo. * ``[filterName]`` — The filter to select. * ``[filterType]`` — The filter type (rest or observed) to select. * ``[redshiftBand]`` — The redshift of the band (if not the output redshift). * ``[postprocessChain]`` — The postprocessing chain to use. * ``[cloudyTableFileName]`` (default ``var_str('%DATASTATICPATH%/hiiRegions/emissionLineLuminosities_BC2003_highResolution_imfChabrier.hdf5')``) — The file of emission line luminosities to use. * ``[lineNames]`` — The emission lines to extract. * ``[component]`` — The component from which to extract star formation rate. * ``[toleranceRelative]`` (default ``1.0d-3``) — The relative tolerance used in integration over stellar population spectra. * ``[component]`` — The component from which to extract star formation rate. * ``[radiusCore]`` — The soliton core radius (in Mpc) characterizing the size of the quantum pressure-supported central core of the fuzzy dark matter halo; the density profile flattens inside this scale. * ``[densitySolitonCentral]`` — The central density (in :math:`\mathrm{M}_\odot`/Mpc\ :math:`^3`) of the solitonic core at :math:`r=0`, which sets the overall normalization of the density profile :math:`\rho(r) = \rho_\mathrm{c} [1+(r/r_c)^2]^{-8}`. * ``[toleranceRelativePotential]`` (default ``1.0d-3``) — The relative tolerance used in numerical ODE solutions for the gravitational potential of the solitonic core profile. * ``[dimensionless]`` (default ``.true.``) — If true the soliton profile is treated as dimensionless (scale-free), allowing its radial and density quantities to be specified in arbitrary units. * ``[componentType]`` (default ``var_str('unknown')``) — The galactic structure component type (e.g.\ dark matter halo, disk, spheroid) represented by this mass distribution, used for component-specific queries. * ``[massType]`` (default ``var_str('unknown')``) — The mass type (e.g.\ dark matter, baryonic, total) represented by this mass distribution, used for mass-type-specific queries. * ``[radiusTransition]`` — The transition radius (in Mpc) at which the density profile smoothly switches from the halo profile to the accretion flow, controlled by the fourth-order transition function :math:`f_\mathrm{trans}(r)`. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (default ``var_str('unknown')``) — The component type that this mass distribution represents. * ``[massType]`` (default ``var_str('unknown')``) — The mass type that this mass distribution represents. * ``[timeAge]`` — The age of the halo (in Gyr) since its formation, determining the total time available for SIDM self-interactions to thermalize the inner halo and produce an isothermal core. * ``[velocityRelativeMean]`` — Mean relative velocity to calculate self interaction cross section. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (default ``var_str('unknown')``) — The component type that this mass distribution represents. * ``[massType]`` (default ``var_str('unknown')``) — The mass type that this mass distribution represents. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (default ``var_str('unknown')``) — The component type that this mass distribution represents. * ``[massType]`` (default ``var_str('unknown')``) — The mass type that this mass distribution represents. * ``[tolerateVelocityMaximumFailure]`` (default ``.false.``) — If true, tolerate failures to find the radius of the peak in the rotation curve. * ``[tolerateEnclosedMassIntegrationFailure]`` (default ``.false.``) — If ``true``, tolerate failures to find the mass enclosed as a function of radius. * ``[toleratePotentialIntegrationFailure]`` (default ``.false.``) — If ``true``, tolerate failures to compute the potential. * ``[fractionRadiusFinalSmall]`` (default ``1.0d-3``) — The initial radius is limited to be no smaller than this fraction of the final radius. This can help avoid problems in profiles that are extremely close to being disrupted. * ``[toleranceRelativePotential]`` (default ``1.0d-3``) — The maximum allowed relative tolerance to use in numerical solutions for the gravitational potential in dark-matter-only density profiles before aborting. * ``[lengthResolution]`` — The spatial resolution length scale (in Mpc) below which the underlying density profile is softened to a flat core, mimicking the finite force resolution of an N-body simulation. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (default ``var_str('unknown')``) — The component type that this mass distribution represents. * ``[massType]`` (default ``var_str('unknown')``) — The mass type that this mass distribution represents. * ``[massMinimum]`` — The minimum halo mass (in :math:`\mathrm{M}_\odot`) below which halos are excluded from the mass function histogram. * ``[massMaximum]`` — The maximum halo mass (in :math:`\mathrm{M}_\odot`) above which halos are excluded from the mass function histogram. * ``[massCountPerDecade]`` — The number of logarithmic bins per decade of halo mass used when constructing the halo mass function. * ``[description]`` — A human-readable description of this mass function dataset, stored as metadata in the output file. * ``[simulationReference]`` — A bibliographic reference for the N-body simulation from which this mass function is derived, stored as metadata. * ``[simulationURL]`` — A URL pointing to the publicly accessible dataset or documentation for the N-body simulation, stored as metadata. * ``[bootstrapSampleCount]`` (default ``30_c_size_t``) — The number of bootstrap resamples of the particles that should be used. * ``[representativeMinimumCount]`` (default ``10_c_size_t``) — Minimum number of representative particles used to compute the center of a halo. * ``[tolerance]`` (default ``1.0d-2``) — The tolerance in the summed weight of bound particles which must be attained to declare convergence. * ``[bootstrapSampleRate]`` (default ``1.0d0``) — The sampling rate for particles. * ``[representativeFraction]`` (default ``0.05d0``) — Fraction of bound particles used to compute the center of a halo. * ``[analyzeAllParticles]`` (default ``.true.``) — If true, all particles are assumed to be self-bound at the beginning of the analysis. Unbound particles at previous times are allowed to become bound in the current snapshot. If false and the self-bound information from the previous snapshot is available, only the particles that are self-bound at the previous snapshot are assumed to be bound at the beginning of the analysis. * ``[useVelocityMostBound]`` (default ``.false.``) — If true, the velocity of the most bound particle in velocity space is used as the representative velocity of the satellite. If false, use the mass weighted mean velocity (center-of-mass velocity) of self-bound particles instead. * ``[orderRotation]`` (default ``var_str('none')``) — The order in which evaluation of likelihoods should be rotated as a function of process number. * ``[logLikelihoodAccept]`` (default ``huge(0.0d0)``) — The log-likelihood which should be "accepted"---once the log-likelihood reaches this value (or larger) no further updates to the chain will be made. * ``[report]`` (default ``.false.``) — If true, report on the log-likelihood obtained. * ``[means]`` — The mean of the multivariate normal distribution. * ``[covariance]`` — The covariance matrix for the of the multivariate normal distribution. * ``[countForestsMaximum]`` (default ``-1_c_size_t``) — If set to a positive number, this is the maximum number of forests that will be evolved. * ``[walltimeMaximum]`` (default ``-1_kind_int8``) — If set to a positive number, this is the maximum wall time for which forest evolution is allowed to proceed before the task gives up. * ``[tolerateFailures]`` (default ``.false.``) — If true then failures to evolve a forest are tolerated. The forest is evolved no further, but evolution of other forests continues. * ``[evolveForestsInParallel]`` (default ``.true.``) — If true then each forest is evolved by a separate OpenMP thread. Otherwise, a single thread evolves all forests. * ``[suspendToRAM]`` (default ``.true.``) — Specifies whether trees should be suspended to RAM (otherwise they are suspend to file). * ``[suspendPath]`` — The path to which tree suspension files will be stored. * ``[timeIntervalCheckpoint]`` (default ``-1_kind_int8``) — If positive, gives the time in seconds between storing of checkpoint files. If zero or negative, no checkpointing is performed.. * ``[fileNameCheckpoint]`` — The path to which checkpoint data will be stored. * ``[logM0]`` (default ``10.0d0``) — The parameter :math:`\log_{10} M_0` (with :math:`M_0` in units of :math:`\mathrm{M}_\odot`) appearing in the star formation rate threshold expression for the star formation rate galactic filter class. * ``[logSFR0]`` (default ``9.0d0``) — The parameter :math:`\alpha_0` appearing in the star formation rate threshold expression for the star formation rate galactic filter class. * ``[logSFR1]`` (default ``0.0d0``) — The parameter :math:`\alpha_1` appearing in the star formation rate threshold expression for the star formation rate galactic filter class. * ``[cW]`` (default ``3.78062835d0``) — The parameter :math:`c_\mathrm{W}` in the :cite:t:`bohr_halo_2021` power spectrum window function. * ``[beta]`` (default ``3.4638743d0``) — The parameter :math:`\beta` in the :cite:t:`bohr_halo_2021` power spectrum window function. * ``[transferFunctionType]`` (default ``var_str('darkMatter')``) — Specifies whether to use the ``darkMatter`` or ``total`` transfer function. * ``[fileName]`` — The name of the file from which to read a tabulated transfer function. * ``[redshift]`` (default ``0.0d0``) — The redshift of the transfer function to read. * ``[factorWavenumberSmoothExtrapolation]`` (default ``0.0d0``) — If positive, and extrapolation is used at high wavenumbers, the slope for extrapolation will be set by averaging over wavenumbers from :math:`k_\mathrm{max}/f` to :math:`k_\mathrm{max}`, where :math:`f=`\ ``[factorWavenumberSmoothExtrapolation]`` and :math:`k_\mathrm{max}` is the highest wavenumber tabulated. This avoids spurious extrapolation for highly oscillatory transfer functions. * ``[acceptNegativeValues]`` (default ``.false.``) — If true, negative values in the transfer function are allowed (and the absolute value is taken prior to interpolation). Otherwise, negative values result in an error. * ``[fractionalTimeStep]`` (default ``0.01d0``) — The fractional time step used when computing barrier crossing rates (i.e. the step used in finite difference calculations). * ``[fileName]`` (default ``var_str('none')``) — The name of the file to/from which tabulations of barrier first crossing probabilities should be written/read. If set to "``none``" tables will not be stored. * ``[fractionalTimeStep]`` (default ``0.01d0``) — The fractional time step used when computing barrier crossing rates (i.e. the step used in finite difference calculations). * ``[varianceNumberPerUnitProbability]`` (default ``1000``) — The number of points to tabulate per unit variance for first crossing probabilities. * ``[varianceNumberPerUnit]`` (default ``40``) — The number of tabulation points per unit of :math:`\sigma^2` used when building the rate look-up table for the Farahi excursion-set first-crossing distribution; higher values improve interpolation accuracy at the cost of memory and initialization time. * ``[varianceNumberPerDecade]`` (default ``400``) — The number of points to tabulate per decade of progenitor variance for first crossing rates. * ``[varianceNumberPerDecadeNonCrossing]`` (default ``40``) — The number of points to tabulate per decade of progenitor variance for non-crossing rates. * ``[timeNumberPerDecade]`` (default ``10``) — The number of tabulation points per decade of cosmic time used when building the first-crossing rate look-up table as a function of time; higher values improve temporal interpolation accuracy for rapidly evolving cosmologies. * ``[varianceIsUnlimited]`` (default ``.false.``) — If true, the variance is assumed to have no upper limit (e.g. as in the case of :term:`CDM`). This allows the tabulated solutions to be extended arbitrarily. Otherwise, tables are extended to encompass just the range of variance requested. * ``[linkingLength]`` (default ``0.2d0``) — The friends-of-friends linking length to use in computing virial density contrasts with the percolation analysis of :cite:t:`more_overdensity_2011`. .. _physics-excursionSetFirstCrossingLinearBarrierBrownianBridge: ``excursionSetFirstCrossingLinearBarrierBrownianBridge`` -------------------------------------------------------- An excursion set first crossing statistics class for linear barriers and where the trajectories are constrained to follow a Brownian bridge. If we consider the Brownian bridge to originate from :math:`(0,0)` (i.e. we apply the usual shift of coordinates to move our starting point to the origin), and to end at :math:`(\delta_2,S_2)` then we can transform this Brownian bridge into the standard bridge with non-zero drift through the transformations: .. math:: \tau & = \frac{S}{S_2}, \\ b & = \frac{\delta_2}{\sqrt{S_2}}. To find the first crossing time distribution we then follow the general approach outlined by :cite:t:`kiwiakos_answer_2014`, but with an important difference that we will detail below. The standard Brownian bridge (with no drift), :math:`Y_0`, can be written in terms of a standard Weiner process, :math:`W`, through a change of variables .. math:: Y_0(t) = (1-t) W\left(\frac{t}{1-t}\right). The first crossing time distribution for our Brownian bridge can therefore be expressed as: .. math:: \tau_{Y}(B) = \mathrm{inf}\left\{ t : Y(t) = B(t)\right\} = \mathrm{inf}\left\{ \mu(t) + (1-t) W\left(\frac{t}{1-t}\right) \right\} = B(t) = \mathrm{inf}\left\{ t : W\left(\frac{t}{1-t}\right) = B(t) - \mu(t) \right\}, where :math:`B(t)` is our barrier, and :math:`\mu(t)` is the drift term in the Brownian bridge. As can be seen from the above, for the case of a linear barrier, a Brownian bridge with non-zero drift effectively results in a new linear barrier equal to the original one minus the drift term, i.e.: .. math:: B^\prime(t) \rightarrow B(t) - \mu(t), where :math:`B(S)` is the barrier and :math:`\mu(S)` is the Brownian bridge term. This means that the first-crossing time of the Brownian bridge is just the hitting time of this time changed Weiner process. That is, is .. math:: \tau_W(B) = \mathrm{inf}\left\{ s : W(s) = B\right\}, then .. math:: \frac{\tau_Y(B)}{1 - \tau_Y(B)} = \tau_W(B) \implies \tau_Y(B) = \frac{\tau_W(B)}{1+\tau_W(B)}. Here is where the solution presented by :cite:t:`kiwiakos_answer_2014` is slightly wrong. We must use the first crossing time solution for the standard Weiner process, but with a *linear* barrier (because, even if the actual barrier is constant, the effective barrier is linear due to the Brownian bridge drift term). Therefore (e.g. :cite:author:`zhang_random_2006` :cite:year:`zhang_random_2006`): .. math:: f_{W}(\tau_{W}) = B(0) \exp\left( - \frac{B(\tau_{W})^2}{2\ tau_{W}} \right) / \sqrt{2 pi \tau_{W}^3}. We then have that .. math:: f_{Y}(\tau_{Y}) \mathrm{d}\tau_{Y} = f_{W}(\tau_{W}) \mathrm{d}\tau_{W}, such that .. math:: f_{Y}(\tau_{Y}) = \frac{B(0)}{\sqrt{2 \pi \tau_{Y}^3 (1 - \tau_{Y})}} \exp\left( \frac{B^{\prime 2}(\tau_{Y})}{2 \tau_{Y} (1-\tau_{Y})} \right), or, expressed in our usual variables .. math:: f(S) = \frac{S(0)}{\sqrt{2 \pi S^3 (1 - S/S_2)}} \exp\left( \frac{[B(S)-\mu(S)]^2}{2 S (1-S/S_2)} \right). **Parameters** * ``[fractionalTimeStep]`` (default ``0.01d0``) — The fractional time step used when computing barrier crossing rates (i.e. the step used in finite difference calculations). * ``[criticalOverdensityConstrained]`` — The linear theory critical overdensity :math:`\delta_\mathrm{c}` (extrapolated to the present epoch) that defines the constrained end-point of the Brownian bridge in excursion-set space; used together with ``varianceConstrained`` to pin the random walk to a specific progenitor halo. * ``[varianceConstrained]`` — The mass variance :math:`\sigma^2(M)` corresponding to the constrained end-point mass of the Brownian bridge; together with ``criticalOverdensityConstrained`` it specifies the progenitor mass to which the excursion-set random walk is conditioned. * ``[redshiftConstrained]`` — The redshift of the progenitor epoch that defines the constrained end-point of the Brownian bridge; converted internally to a cosmic time and then to a linear overdensity threshold via the critical overdensity at that epoch. * ``[massConstrained]`` — The halo mass (:math:`\mathrm{M}_\odot`) of the constrained progenitor at the end of the Brownian bridge; converted internally to a mass variance :math:`\sigma^2(M)` that pins the excursion-set random walk to a specific progenitor scale. * ``[criticalOverdensityConstrained]`` — The linear theory critical overdensity :math:`\delta_\mathrm{c}` (extrapolated to the present epoch) that defines the constrained end-point of the Brownian bridge in excursion-set space; used together with ``varianceConstrained`` to pin the random walk to a specific progenitor halo. * ``[varianceConstrained]`` — The mass variance :math:`\sigma^2(M)` corresponding to the constrained end-point mass of the Brownian bridge; together with ``criticalOverdensityConstrained`` it specifies the progenitor mass to which the excursion-set random walk is conditioned. * ``[redshiftConstrained]`` — The redshift of the progenitor epoch that defines the constrained end-point of the Brownian bridge; converted internally to a cosmic time and then to a linear overdensity threshold via the critical overdensity at that epoch. * ``[massConstrained]`` — The halo mass (:math:`\mathrm{M}_\odot`) of the constrained progenitor at the end of the Brownian bridge; converted internally to a mass variance :math:`\sigma^2(M)` that pins the excursion-set random walk to a specific progenitor scale. .. _physics-excursionSetFirstCrossingZhangHui: ``excursionSetFirstCrossingZhangHui`` ------------------------------------- An excursion set first crossing statistics class utilizing the algorithm of :cite:t:`zhang_random_2006`. First crossing (and non-crossing) rates are not supported by this method. **Methods** * ``g1`` — Returns the function :math:`g_1(S)` :cite:p:`zhang_random_2006`. * ``g2`` — Returns the function :math:`g_2(S,S^\prime)` :cite:p:`zhang_random_2006`. * ``g2Integrated`` — Returns the function :math:`g_2(S,S^\prime)` integrated over a range :math:`\Delta S` :cite:p:`zhang_random_2006`. * ``delta`` — Returns the function :math:`g_2(S,S^\prime)` integrated over a range :math:`\Delta S` :cite:p:`zhang_random_2006`. .. _physics-excursionSetFirstCrossingZhangHuiHighOrder: ``excursionSetFirstCrossingZhangHuiHighOrder`` ---------------------------------------------- An excursion set first crossing statistics class utilizing a higher order generalization of the algorithm of :cite:t:`zhang_random_2006`. First crossing (and non-crossing) rates are not supported by this method. In this method we discretize the first-crossing distribution function, and use a `closed Newton-Cotes method `_ to perform integrations. First, we mesh the :math:`S` space using uniform spacing in :math:`S`: .. math:: S_i = i \times \Delta S , i = 0, 1, \dots, N, \Delta S = \frac{S}{N}. Then we discretize the integral equation by `Boole's rule `_. The integral equation becomes a set of linear algebraic equations: .. math:: f(S_i) & = g_1(S_i) + \frac{ \Delta S}{90} \sum_{j=0:4}^{i-4} \left\{ 7 f(S_j) g_2(S_i, S_j) + 32 f(S_{j+1}) g_2(S_i, S_{j+1}) \right.\nonumber \\ & \qquad \left. {} + 12 f(S_{j+2}) g_2(S_i, S_{j+2}) + 32 f(S_{j+3}) g_2(S_i, S_{j+3}) + 7 f(S_{j+4}) g_2(S_i, S_{j+4}) \right\}. Since :math:`g_2(S, S^\prime)` approaches infinity when :math:`S` approaches :math:`S^\prime`, one needs to define :math:`g_2(S_i, S_i)` carefully when :math:`j = i`. We can rewrite the equation: .. math:: f(S_i) & = g_1(S_i) + \frac{ 4 \Delta S}{90} \sum_{j=0:4}^{i-8} \left\{ 7 f(S_j) g_2(S_i, S_j) + 32 f(S_{j+1}) g_2(S_i, S_{j+1}) \right.\nonumber \\ & \qquad \left. {} + 12 f(S_{j+2}) g_2(S_i, S_{j+2}) + 32 f(S_{j+3}) g_2(S_i, S_{j+3}) + 7 f(S_{j+4}) g_2(S_i, S_{j+4}) \right\} \nonumber \\ & \qquad {} + \frac{ 4 \bar{g}_2(S_i) \Delta S}{90} \Big( 7 f(S_{i-4}) + 32 f(S_{i-3}) + 12 f(S_{i-2}) + 32 f(S_{i-1}) + 7 f(S_i) \Big). For :math:`\bar{g}_2(S_i)` we have: .. math:: \bar{g}_2(S_i) = \frac{1}{\delta S} \int_{S - \delta S}^S g_2(S,S^\prime)\mathrm{d}S^\prime. In the above, :math:`\delta S` depends on the range of the previous integral part. Generally, :math:`\delta S` is equal to :math:`4 \Delta S`. The above equation can be solved for :math:`f(S_i)`, giving: .. math:: f(S_i) & = \left( g_1(S_i) + \frac{ 4 \Delta S}{90} \sum_{j=0:4}^{i-8} \left\{ 7 f(S_j) g_2(S_i, S_j) + 32 f(S_{j+1}) g_2(S_i, S_{j+1}) \right.\right.\nonumber \\ & \qquad \left.\left. {} + 12 f(S_{j+2}) g_2(S_i, S_{j+2}) + 32 f(S_{j+3}) g_2(S_i, S_{j+3}) + 7 f(S_{j+4}) g_2(S_i, S_{j+4}) \right\} \right. \nonumber \\ & \qquad \left. {} + \frac{4 \bar{g}_2(S_i) \Delta S }{90} \Big( 7 f(S_{i-4}) + 32 f(S_{i-3}) + 12 f(S_{i-2}) + 32 f(S_{i-1}) \Big) \right) \nonumber \\ & \qquad {} \times \left( 1 - \frac{ 4 \bar{g}_2(S_i) \Delta S}{90} \right)^{-1}. Not all of the :math:`i`'s are divisible by :math:`4`. So, for the first :math:`m^\mathrm{th}` spaces, we need to calculate the integral part, separately, where :math:`m` is the remainder of :math:`i` by the modulus of :math:`4`. It is a good approximation to calculate the first part linearly. Consequently, the final formula for the general problem is: .. math:: f(S_i) & = \left( g_1(S_i) + \frac{ \Delta S}{2} \sum_{j=0}^{m-1} \Big( f(S_j) g_2(S_i, S_j) + f(S_{j+1}) g_2(S_i, S_{j+1}) \Big) \right.\nonumber \\ & \qquad \left. {} + \frac{ 4 \Delta S}{90} \sum_{\frac{j-m}{4}=0}^{i-8} \left\{ 7 f(S_j) g_2(S_i, S_j) + 32 f(S_{j+1}) g_2(S_i, S_{j+1}) \right.\right.\nonumber \\ & \qquad \left.\left. {} + 12 f(S_{j+2}) g_2(S_i, S_{j+2}) + 32 f(S_{j+3}) g_2(S_i, S_{j+3}) + 7 f(S_{j+4}) g_2(S_i, S_{j+4}) \right\} \right. \nonumber \\ & \qquad \left. {} + \frac{4 \bar{g}_2(S_i) \Delta S}{90} \Big( 7 f(S_{i-4}) + 32 f(S_{i-3}) + 12 f(S_{i-2}) + 32 f(S_{i-1}) \Big) \right) \nonumber \\ & \qquad {} \times \left( 1 - \frac{ 4 \bar{g}_2(S_i) \Delta S }{90} \right)^{-1}. Finally, we can solve the first-crossing distribution function, giving: .. math:: f(S_0) & = g_1(S_0) = 0 \\ f(S_1) & = g_1(S_1) \left( 1 - \frac{\bar{g}_2(S_1) \Delta S}{2} \right)^{-1} \\ f(S_2) & = \Big( g_1(S_2) + \frac{ \Delta S}{2} 2 \bar{g}_2(S_2) f(S_1) \Big) \left( 1 - \frac{ \bar{g}_2(S_2) \Delta S}{2} \right)^{-1} \\ f(S_3) & = \Big( g_1(S_2) + \frac{ \Delta S}{2} 2 \bar{g}_2(S_3) (f(S_1) + f(S_2)) \Big) \left( 1 - \frac{ \bar{g}_2(S_3) \Delta S}{2} \right)^{-1} \\ f(S_i) & = \left( g_1(S_i) + \frac{ \Delta S}{2} \sum_{j=0}^{m-1} \Big( f(S_j) g_2(S_i, S_j) + f(S_{j+1}) g_2(S_i, S_{j+1}) \Big) \right.\nonumber \\ & \qquad \left. {} + \frac{ 4 \Delta S}{90} \sum_{\frac{j-m}{4}=0}^{i-8} \left\{ 7 f(S_j) g_2(S_i, S_j) + 32 f(S_{j+1}) g_2(S_i, S_{j+1}) \right.\right.\nonumber \\ & \qquad \left.\left. {} + 12 f(S_{j+2}) g_2(S_i, S_{j+2}) + 32 f(S_{j+3}) g_2(S_i, S_{j+3}) + 7 f(S_{j+4}) g_2(S_i, S_{j+4}) \right\} \right. \nonumber \\ & \qquad \left. {} + \frac{4 \bar{g}_2(S_i) \Delta S}{90} \Big( 7 f(S_{i-4}) + 32 f(S_{i-3})+ 12 f(S_{i-2}) + 32 f(S_{i-1}) \Big) \right) \nonumber \\ & \qquad {} \times \left( 1 - \frac{ 4 \bar{g}_2(S_i) \Delta S}{90} \right)^{-1}, where :math:`\bar{g}_2(S_1)` is defined as: .. math:: \bar{g}_2(S_1) & = \frac{1}{\Delta S} \int_{0}^{S_1} g_2(S,S^\prime)\mathrm{d}S^\prime \hbox{ if } i = 1 \\ \bar{g}_2(S_2) & = \frac{1}{2 \Delta S} \int_{0}^{S_2} g_2(S,S^\prime)\mathrm{d}S^\prime \hbox{ if } i = 0 \\ \bar{g}_2(S_3) & = \frac{1}{3 \Delta S} \int_{0}^{S_3} g_2(S,S^\prime)\mathrm{d}S^\prime \hbox{ if } i = 0 \\ \bar{g}_2(S_i) & = \frac{1}{4 \Delta S} \int_{S_i - 4 \Delta S}^{S_i} g_2(S,S^\prime)\mathrm{d}S^\prime \hbox{ if } i > 3. The error term for this method of discretization is: .. math:: \epsilon = \frac{(\delta S)^7}{1935360} f^{(6)}(\xi), where :math:`f^{(6)}(\xi)` is the absolute maximum of the sixth derivative in the range of :math:`[S_i , S_i + \delta S]`. For this problem, :math:`\delta S = 4 \Delta S`, so: .. math:: \epsilon \leq \frac{(\Delta S)^7}{118.125} f^{(6)}(\xi). Since there are :math:`N/4` intervals, the maximum deviation from the real value of the function is: .. math:: \epsilon \leq \sum_{i=1}{\frac{N}{4}}\frac{(\Delta S)^7}{118.125} f^{(6)}(\xi _i) \nonumber\\ \leq N4\frac{(\Delta S)^7}{472.5} f^{(6)}(\xi), where :math:`f^{(6)}(\xi)` is the absolute maximum of the sixth derivative in the domain, :math:`[0 , S]`. **Methods** * ``initialize`` — Initialize the high order :cite:t:`zhang_random_2006` class.