# BAOFIT Model Options

Baofit supports a number of BAO models and fitting options that are selected on the command line or by using a configuration file (see `baofit/config/` for examples).

## Models

Below is a short description of the main BAO model classes.

**BaoCorrelationModel:** Basic BAO fitting model in r-space. Default model in baofit. Uses pre-calculated linear correlation function templates. Lacks support for k-space models. Broadband distortions are modeled using a broadband distortion function. Supports r-space metal correlation models. Supports options to combine fit parameters.

**BaoKSpaceCorrelationModel:** Principal BAO fitting model in k-space. Set by the `kspace` command-line option. Uses tabulated linear matter power spectra. Transforms into r-space using spherical Bessel transformations of power spectrum multipoles. Supports k-space models for non-linear anisotropic broadening, non-linear corrections, binning smoothing, HCD correlations, UV fluctuations and line-of-sight smoothing. Broadband distortions are modeled using a distortion matrix and/or a broadband distortion function. Supports r-space metal correlation models and quasar radiation effects. Supports options to combine fit parameters.

**BaoKSpaceFftCorrelationModel:** BAO fitting model in k-space. Set by the `kspace-fft` command-line option. Uses tabulated linear matter power spectra. Transforms into r-space using a 3D FFT (slow and not accurate on small scales). Supports k-space models for non-linear anisotropic broadening, non-linear corrections and continuum fitting distortion. Broadband distortions are modeled using the k-space distortion model and/or a broadband distortions function. Lacks support for r-space metal correlation models.

**BaoKSpaceHybridCorrelationModel:** BAO fitting model in k-space. Set by the `kspace-hybrid` command-line option. Uses tabulated linear matter power spectra. Transforms into r-space using a combination of 1D FFTs and 1D integrals (faster and more accurate than the 3D FFT model). Supports k-space models for non-linear broadening anisotropic, non-linear corrections and continuum fitting distortion. Broadband distortions are modeled using the k-space distortion model and/or a broadband distortion function. Lacks support for r-space metal correlation models.

## Fitting options

Below is a short description of the main fitting options. Note that not all of these options work with every BAO model class (see section above). Use `baofit -h` for help. Examples below refer to the usage in a configuration file. Bool parameters must be commented out to turn off the fitting option (using `false` or `no` does not work!).

**Decoupled:** Apply scale parameters to the peak component only.

decoupled = true

**Anisotropic:** Use anisotropic scale parameters.

anisotropic = true

**Cross-correlation:** Perform cross-correlation fit. Use the input parameter `omega-matter` to set the matter density value for the velocity shift.

cross-correlation = true

**Non-linear anisotropic broadening:** Models the effect of large-scale bulk velocity flows. Default is broadening of the peak only. Apply broadening to both the peak and the broadband using the `nl-broadband` command-line option. Turn off the broadening by setting the parameters to zero.

model-config = fix[1+f]=1.966; model-config = fix[SigmaNL-perp]=3.26;

**Non-linear corrections:** Models a correction due to non-linear effects that are dependent on the non-linear clustering of matter and the hydrodynamic and thermal evolution of intergalactic gas. Supports the model of McDonald 2003 (`nl-correction-alt` command-line option) with fixed parameters at z=2.25, and the model of Ariño-i-Prats et al. 2015 (`nl-correction` command-line option) with fixed parameters interpolated to the effective redshift `zeff`. If `zeff` is not provided, its value will be taken from the redshift coordinates. Default is no correction.

nl-correction = true sigma8 = 0.8338 zeff = 2.3

It is possible to fit for two of the model parameters of Ariño-i-Prats et al. 2015 using

fit-nl-correction = true sigma8 = 0.8338 zeff = 2.3 model-config = value[nlcorr qnl]=0.867; model-config = value[nlcorr kp]=19.4;

**Binning smoothing:** Smoothing of the correlation function due to the physical scale in Mpc/h of the correlation function bins. Default is no smoothing. Fits for the bin scales in the line-of-sight and transverse directions using a sinc function.

bin-smooth = true model-config = value[bin scale-par]=4; model-config = value[bin scale-perp]=4;

There is also support for an alternative model that uses a Gaussian function. To good approximation, the bin scales are reduced by a factor 0.3 compared to the sinc function.

bin-smooth-alt = true model-config = value[bin scale-par]=1.2; model-config = value[bin scale-perp]=1.2;

**HCD correction:** Models the correlation contribution from high-column density (HCD) absorbers. Default is no HCD correction. Fits for the HCD relative bias parameter (defined as the ratio of the HCD bias and the Lya bias), the HCD beta parameter and a physical scale in Mpc/h of the HCD width. The small-scale power spectrum suppression can be modeled either as a sinc function (`hcd-model` command-line option) or a Gaussian function (`hcd-model-alt` command-line option).

hcd-model = true model-config = value[HCD beta]=1; model-config = value[HCD rel bias]=0.1; model-config = value[HCD scale]=25;

**UV fluctuations:** Models the effect of UV fluctuations due to source clustering. Supports the model of Gontcho et al. 2014. Default is no UV fluctuations. Fits for the UV relative bias parameter (defined as the ratio of the UV bias and the Lya bias, multiplied by the difference between the source and absorber bias), the UV absorber response bias and the mean free path of the UV photons.

uvfluctuation = true model-config = value[UV rel bias]=-1; model-config = value[UV abs resp bias]=-0.667; model-config = value[UV mean free path]=300;

**Quasar radiation effects:** Models the correlation contribution from quasar radiation effects in r-space: isotropic radiation, anisotropy, attenuation and time effects. Fits for the radiation strength parameter, anisotropy parameter, mean free path parameter in Mpc/h and quasar lifetime parameter in Myr (set any of the latter three parameters to zero to omit their impact).

radiation-model = true model-config = value[Rad strength]=0; model-config = value[Rad anisotropy]=0; model-config = value[Rad mean free path]=200; model-config = value[Rad quasar lifetime]=10;

**Line-of-sight smoothing (Gaussian):** Smoothing of the correlation function in the line-of-sight direction using a Gaussian function (due to, e.g., PSF or redshift error). Default is no smoothing. Fits for the smoothing scale in Mpc/h.

smooth-gauss = true model-config = value[smooth scale gauss]=1;

**Line-of-sight smoothing (Lorentzian):** Smoothing of the correlation function in the line-of-sight direction using a Lorentzian function (due to, e.g., PSF or redshift error). Default is no smoothing. Fits for the smoothing scale in Mpc/h.

smooth-lorentz = true model-config = value[smooth scale lorentz]=1;

**Metal correlations:** An r-space linear model for the correlations imprinted by Lya-metal and metal-metal pixel pairs. Default is no metal correlations. Fit for the `bias` and `beta` parameter of the metal lines Si II 1190, 1193 and 1260 Å and Si III 1206 Å, referred to as Si2a, Si2b, Si2c and Si3 respectively, using pre-calculated multipole templates. The index-based metal model (`metal-model` command-line option) uses templates with two columns (index, correlation), and the interpolation-based model (`metal-model-interpolate` command-line option) uses templates with three columns (rperp, rpar, correlation). Template file names for the auto-correlation must end with a combination of `_Lya`, `_Si2a`, `_Si2b`, `_Si2c` or `_Si3`, e.g. `someFileNamePrefix_Lya_Si2a.0.dat`. Template file names for the cross-correlation must end with `_QSO` and `_Si2a`, `_Si2b`, `_Si2c` or `_Si3`, e.g. `someFileNamePrefix_QSO_Si2a.0.dat`. It is mandatory to also supply a coordinate grid file with four columns (global index, rperp, rpar, z) for each template, named e.g. `someFileNamePrefix_Lya_Si2a.grid`.

metal-model = true metal-model-name = someFileNamePrefix model-config = value[beta Si2a]=0.5; model-config = value[bias Si2a]=-0.01; model-config = value[beta Si2b]=0.5; model-config = value[bias Si2b]=-0.01; model-config = value[beta Si2c]=0.5; model-config = value[bias Si2c]=-0.01; model-config = value[beta Si3]=0.5; model-config = value[bias Si3]=-0.01;

It is possible to include correlations from foreground CIV absorption (`metal-civ` command-line option) by supplying additional templates and grid files, e.g. `someFileNamePrefix_Lya_CIVa.0.dat`.

metal-civ = true model-config = value[beta CIV]=0.5; model-config = value[bias CIV]=-0.01;

Alternatively, one can use a simple toy model derived from a metal mock template (`toy-metal` command-line option) to fit for the effective correlation amplitudes observed at 60, 110, 135 and 175 Mpc/h.

toy-metal= true model-config = value[metal ampl0]=1; model-config = value[metal ampl1]=1; model-config = value[metal ampl2]=1; model-config = value[metal ampl3]=1; model-config = value[metal width0]=6;

**Combined bias:** Fit for the parameter combination `beta*bias`. The default parameter `(1+beta)*bias` is automatically fixed and not used.

combined-bias = true model-config = value[beta*bias]=-0.196;

**Combined scale:** Fit for the parameter combination `BAO aperp/apar`. The default parameter `BAO alpha-perp` is automatically fixed and not used.

combined-scale = true model-config = value[BAO aperp/apar]=1;

**Distortion matrix:** Corrects the correlation function model for the broadband distortion induced by continuum fitting. Default is no distortion matrix. See Input Data Format for more information.

dist-matrix = true dist-matrix-name = someFileNamePrefix dist-matrix-order = 2500

**Distortion model:** A k-space model for the broadband distortion induced by continuum fitting. Default distortion model is the "DC2" model of Blomqvist et al. 2015. Select the alternative "DC1" model using the `distortion-alt` command-line option. Turn off the distortion model using the `no-distortion` command-line option.

model-config = value[cont-kc]=0.005; model-config = value[cont-pc]=3;

**Broadband distortion model:** A generic function for modeling the combined effect of different broadband distortions. Default is no broadband distortion model. The broadband function can be additive (`dist-add` command-line option) and/or multiplicative (`dist-mul` command-line option), and is defined in equation 2.73 of Kirkby et al. 2013. Specify the model indices i,j,n using a syntax of the form

dist-add = -2:0,0:4:2,0

If using a distortion matrix, it is possible to apply a separate broadband function (`dist-matrix-dist-add` and/or `dist-matrix-dist-mul` command-line options) before applying the matrix, e.g.

dist-matrix-dist-add = -3:-2,0:4:2,0