text:
\subsection{Please Capitalize the First Letter of Each Notional Word in Subsection Title}

\section{Introduction}

Driving by the expansion of the Universe, galaxies move further apart from us. This motion is called recessional velocity and described by the Hubble's Law which is a linear relation between the redshift and distance of galaxies. On small scales, the mass density field of the Univers is not ideally homogenous and isotropic, which results from gravitational fluctuation. On top of the Hubble recessional velocities, galaxies will have peculiar motions which arise from these gravitational perturbations of the mass density field. The line-of-sight peculiar velocities of galaxies enable us to test the cosmological models through three main techniques.

One technique directly measures the cosmic flow field using the peculiar velocities, then comparing to the cosmological models' prediction to test whether the models accurately describe the motion of galaxies. Some examples of the previous work related to this method are
\citealt{Kaiser1988,Lister1989,Jaffe1995,Nusser1995,Parnovsky2001,Nusser2011,2012MNRAS.420..447T,MA2012,Ma2013,Ma2014,Hong2014,Scrimgeour2016,Qin2018,Qin2019a,Boruah2020}. The measurements agree with the
$\Lambda$ cold dark matter ($\Lambda$CDM) model prediction.

The second technique measures the two-point correlation and/or power spectrum of the peculiar velocity field and fits the cosmological parameters, then comparing to the cosmological models' prediction. Some examples of the previous work related to this method are \citealt{Gorski1989,Kolatt1997,Zaroubi1997,Juszkiewicz2000,Silberman2001,Feldman2003,Gordon2007,Johnson2014,Howlett2017,Huterer2017,Dupuy2019,Howlett2019,Qin2019b}.

The third technique is the reconstruction of the density/velocity field of the local Universe using peculiar velocities. Some examples of the previous work related to this method are \citealt{Nusser1994},\citealt{Erdogdu2006a},\citealt{Lavaux2010},\citealt{Springob2014}
,\citealt{Carrick2015},\citealt{Pomar2017},\citealt{Springob2016}.

In most of the past literature, the measurement errors of peculiar velocities are assumed to be Gaussian which is not true for the usual peculiar velocity estimator. This can bias the measurements, and many researches have been done to deal with the non-Gaussianity of the estimated peculiar velocities.
For example, in terms of cosmic flow measurements, to avoid the non-Gaussianity of the estimated peculiar velocities, \citealt{Nusser1995,Nusser2011,Qin2018,Qin2019a} use the so-called $\eta$MLE to measure the cosmic flow in the logarithmic distance ratio-space. \citealt{Watkins2015} developed a peculiar velocity estimator which has Gaussian errors but biased in some circumstances. In terms of power spectrum measurements,  \citealt{Qin2019b} use a power transformation to offset the non-Gaussianity of the momentum power  spectrum \citep{Howlett2019} to fit the growth rate of the large scale structure.

In this paper,  we will explore a technique that Gaussianizes the estimated line-of-sight peculiar velocities. In addition,
we take the bulk flow measurement as an example to show the implementation of the Gaussianized peculiar velocities in terms of testing cosmology. The survey data used in this paper is a full-sky Tully-Fisher survey 2MTF \citep{Hong2019}.

The paper is structured as follows:
in Section \ref{sec:data} we introduce the 2MTF data and mocks. The mocks are used to test the algorithm.
In section \ref{sec:PVest} we introduce the peculiar velocity estimators and discuss the Gaussianity of the estimated peculiar velocities.
In section \ref{sec:box} we introduce the algorithm used to Gaussianize the peculiar velocities.
In section \ref{sec:BKest}  we introduce the bulk flow estimator, which estimates bulk flows from Gaussianized peculiar velocities and test the estimator using mock surveys.
In section \ref{sec:dis} we present the bulk flow measured from 2MTF. A conclusion in presented in Section \ref{conc}.

This paper assumes spatially flat cosmology. The cosmological parameters used in this paper are from the \cite{Planck2016A}: $\Omega_m=0.307$, $\Omega_{\Lambda}=0.693$, $\sigma_8=0.823$ and $H_{0} = 100$ $h$ km s$^{-1}$ Mpc$^{-1}$, $h=0.678$. These parameters are applied to the calculation of the comoving distances and the  bulk flow predicted in $\Lambda$CDM .

\section{DATA AND MOCKS} \label{sec:data}

2MTF \citep{Hong2019} is a full sky Tully-Fisher
survey derived from the Two Micron All-Sky Survey (2MASS, \citealt{Masters2008,Huchra2012,Hong2014}).
The redshift of 2MTF galaxies reaches a maximum of $1.2 \times10^{4}$ km~s$^{-1}$ and no smaller than 600 km s$^{-1}$. 2MTF is a full-sky survey, but excluding the  Galactic plane region where Galactic latitude $|b|<5^{\circ}$.  Fig.\ref{lb} shows the survey geometry (redshift distribution and sky coverage) of the 2MTF galaxies.

\begin{figure*}
 \includegraphics[width=75mm]{ms2021-0055fig1b.png}
  \includegraphics[width=100mm]{ms2021-0055fig1a.pdf}
 \caption{The survey geometry of 2MTF. The left-hand-side panel shows the distribution of redshift of 2MTF galaxies. The right-hand-side panel shows the sky coverage of the 2MTF galaxies, the color of the points indicates the galaxy redshift, according to the colour bar.}
 \label{lb}
\end{figure*}

The logarithmic distance (log-distance) ratio for a galaxy is defined as
\begin{equation}\label{logd}
\eta \equiv \log_{10}\frac{d_z}{d_h}~,
\end{equation}
where $d_z$ is the apparent comoving distance of a galaxy inferred from its observed redshift $z$, and $d_h$ is the true comoving distance of the galaxy. In the 2MTF survey, $\eta$ is estimated from the Tully-Fisher relation \citep{Masters2008,Hong2014}. The distribution of the log-distance ratio of the 2MTF galaxies is shown in the top panel of Fig.\ref{logds}, and the measurement error of log-distance ratio, $\epsilon$, is shown in the bottom panel of Fig.\ref{logds}.

\begin{figure}
\centering
 \includegraphics[width=90mm]{ms2021-0055fig2.pdf}
 \caption{The top panel shows the distribution of log-distance ratio $\eta$ of 2MTF. The bottom panel shows the distribution of measurement errors of log-distance ratio $\epsilon$.}
 \label{logds}
\end{figure}

We use 16 mock 2MTF catalogues to test the algorithm used  in this paper. These mocks are not used in the real data analyse and the comparison of $\Lambda$CDM.  The mock sampling algorithm is clearly presented in \citealt{Howlett2017}. 2MTF has a well defined selection function \citep{Hong2014}, enabling us to  generate high quality mocks which can accurately realize the survey geometry and selection function of 2MTF \citep{Howlett2017,Qin2018,Qin2019a,Qin2019b}. In this paper the 16 mocks are generated from two different simulations: the GiggleZ   \citep{Poole2015} and the SURFS \citep{Elahi2018} simulations. The cosmological parameters used in the GiggleZ simulation are $\Omega_m=0.273$ and $h=0.705$, while for the SURFS simulation, $\Omega_m=0.3121$ and $h=0.6751$.
Two different simulations are used to produce the mocks, enabling us to ensure that the algorithm presented in this paper gives consistent answers for different cosmologies \citep{Qin2018}.

\section{Peculiar Velocity estimators} \label{sec:PVest}

If neglect the relativistic motions and gravitational lensing effects, the line-of-sight peculiar velocity of a galaxy, $V$,  can be estimated from its log-distance ratio $\eta$ and observed redshift $z$ through \citep{Colless2001,Hui2006,Davis2014,Scrimgeour2016,Qin2018,Qin2019a}
\begin{equation} \label{travp}
V=c\left(\frac{z-z_h}{1+z_h}\right)~,
\end{equation}
where $c$ is the speed of light. The Hubble recessional  redshift $z_h$ is numerically calculated from the true comoving distance, $d_h$ of the galaxy using
\begin{equation}\label{Dz}
d_{h}(z_{h})=\frac{c}{H_0}\int_0^{z_{h}}\frac{dz'}{E(z')}~,
\end{equation}
where
\begin{equation}\label{Ez}
E(z)=\frac{H(z)}{H_0}=\sqrt{\Omega_m(1+z)^3+\Omega_{\Lambda}}~,
\end{equation}
where $H_{0}$, $\Omega_{m}$ and $\Omega_{\Lambda}$ are the Hubble constant, matter and dark energy densities of the present day universe, respectively. The true comoving distance
\begin{equation} \label{etadist}
d_{h} = d_{z}10^{-\eta} ,
\end{equation}
where the apparent comoving distance $d_z$ is calculated from the observed redshift $z$ directly  through a similar expression of Eq.~\ref{Dz}.

For a galaxy, Eq.~\ref{travp} converts $z$ and $\eta$ to $V$ non-linearly. Therefore, the measurement error of $V$, which is propagated from the measurement error of $\eta$, is not Gaussian, even if we assume   $\eta$ has Gaussian error. To see this clearly, using equations ~\ref{travp}, \ref{Dz} and \ref{Ez}, one can calculate the probability distribution function (PDF) of a estimated line-of-sight peculiar velocity, given by \citep{Scrimgeour2016}
\begin{equation} \label{PDFv}
P(V)=P(\eta)\frac{d\eta}{dV}=P(\eta)\times \frac{(1+z_h)^2}{d_hH_0E(z_h)(1+z)\ln(10)}~,
\end{equation}
where $P(\eta)$ denotes the PDF of $\eta$. Usually (but not necessarily), $P(\eta)$ is assumed to be a Gaussian function. However, due to the non-linear term behind $P(\eta)$, the resultant $P(V)$ is not Gaussian.
Therefore, the peculiar velocity estimated from Eq.~\ref{travp} for a galaxy does not have Gaussian error (see Section \ref{sec:box1} and Fig.\ref{PVss} for more discussions).

Due to the non-Gaussianity of the peculiar velocities, the  cosmological parameters and cosmic flows estimated from the peculiar velocity fields are biased to some extent.  \citealt{Qin2019a} finds that this non-Gaussianity will bias the momentum power spectrum measurements and then  bias the estimation of the growth rate of the large-scale-structure. Using simulations, \citealt{Qin2018} shows that this non-Gaussianity will bias the cosmic flow measurements comparing to the true values.

To preserve the Gaussianity of the estimated peculiar velocities, \cite{Watkins2015} developed the following estimator to calculate peculiar velocity for a galaxy
\begin{equation}\label{watvp}
V=\frac{cz_{\mathrm{mod}}}{1+z_{\mathrm{mod}}}\ln\frac{cz_{\mathrm{mod}}}{H_0d_l}~,~~(V_t\ll cz)~,
\end{equation}
where $d_l$ denotes the luminosity distance, and $z_{\mathrm{mod}}$ is given by
\begin{equation}  \label{zmod}
z_{\mathrm{mod}}=z\left[1+\frac{1}{2}(1-q_0)z-\frac{1}{6}(1-q_0-3q_0^2+1)z^2\right].
\end{equation}
where $q_0=0.5(\Omega_m-2\Omega_{\Lambda})$ is the so called acceleration parameter. At low redshift,
$\ln\frac{cz_{\mathrm{mod}}}{H_0d_l} \approx \ln(10)\eta$, then the PDF for a peculiar velocity estimated from Eq.\ref{watvp} is given by:
\begin{equation} \label{PDFv2}
P(V)=P(\eta)\frac{d\eta}{dV}=P(\eta)\times \frac{1+z_{\mathrm{mod}}}{cz_{\mathrm{mod}}\ln(10)}~.
\end{equation}
Assuming $P(\eta)$ is Gaussian, for a given galaxy, $z_{\mathrm{mod}}$ is a certain number, $P(V)$ is linear related to $P(\eta)$ and therefore is Gaussian. Therefore, the peculiar velocity estimated from Eq.\ref{watvp} for a galaxy does have Gaussian error.
However, one caveat is that  Eq.\ref{watvp} only strictly returns an unbiased estimated peculiar velocity under the assumption that the galaxy's \textit{true} peculiar velocity (not necessarily the measured peculiar velocity) is much smaller than $cz$ for that galaxy. Using the mock 2MTF surveys, \citealt{Howlett2017} explores to what extent Eq.\ref{watvp} biases the measured peculiar velocities of 2MTF. As shown in Figure 9 of \citealt{Howlett2017}, Eq.\ref{watvp} overestimates the large positive peculiar velocities, whilst underestimates the large negative peculiar velocities.

\section{Gaussianizing the peculiar velocities}\label{sec:box}

To preserve the Gaussianity and avoid any assumption on the unknown  true velocity of the galaxy compared to its redshift, we can instead Gaussianize a peculiar velocity of Eq.\ref{travp}. In this section, we will introduce the algorithm used to performing the Gaussianization.

\subsection{Box-Cox transformation}

\citealt{Box1964} developed a power transform technique that makes the non-Gaussian distributed data more normal distribution-like \citep{Sakia1992}. The Box-Cox (BC) transformation also has been introduced into cosmology in order to offset the non-Gaussianity of measurements. For example, \citealt{wang2018} studys the BC transformation of the density power spectrum, \citealt{Qin2019b} use the BC transformation to Gaussianize the momentum power spectrum to fit the growth rate of the large scale structure. In this paper, we will apply the BC transformation to the peculiar velocities to obtain Gaussianized peculiar velocities.

For a set of non-Gaussian distributed data $\{v_i | i=1,2,...,M\}$ ( i.e. the normalized  histogram of the data set is not Gaussian), the BC transformation of $v_i$ is defined as \citep{Box1964}
\begin{equation}\label{boxc1}
Y_i\equiv\left \{
\begin{aligned}
&\frac{(v_i+\delta)^{\lambda}-1}{\lambda}, &\lambda \neq 0\\
&\ln(v_i+\delta)~, &\lambda = 0
\end{aligned}
\right.
\end{equation}
where $\delta$ is a shift to the whole data set in order to keep  all the data being positive. Such  shift will not change the analysis of variance \citep{Box1964,Sakia1992}. $\lambda$ is the transformation parameter for the whole data set, it can be estimated by maximizing the following logarithmic likelihood function \citep{Box1964,Sakia1992,Qin2019b}
\begin{equation}\label{boxclog}
L(\lambda) \sim (\lambda-1)\sum_i^M\ln(v_i+\delta)-\frac{M}{2}\ln\left( \frac{\sum_i(Y_i(\lambda)-\bar{Y}(\lambda))^2}{M}   \right),
\end{equation}
following the steps presented in \cite{Box1964} and \cite{Qin2019b}.
Using Eq.\ref{boxc1}, applying the estimated $(\lambda,~\delta)$ to each $v_i$ of the data set, we can obtain a set of $Y_i$, then $\{Y_i|i=1,2,...,M\}$ is the corresponding Gaussianized data set.

\subsection{Methodology}\label{sec:box1}

The starting point is the non-Gaussian PDF of peculiar velocity, Eq.\ref{PDFv}. We will present an algorithm of applying BC transformation to Eq.\ref{PDFv}. For convenience, we assume the $P(\eta)$ term of Eq.\ref{PDFv} is a Gaussian function, i.e.
we assume the measured log-distance ratio of the $n$-th galaxy, $\eta_n$, has Gaussian error $\epsilon_n$, then the PDF of log-distance ratio of this galaxy is given by the Gaussian equation
\begin{equation}\label{PDFeat}
P(\eta)=\frac{1}{\sqrt{2 \pi \epsilon^2_n}}\exp\left(- \frac{    (\eta-\eta_n)^2  }{ 2 \epsilon^2_n }\right)~.
\end{equation}
 To clarify, this assumption is not necessary to the   following presented algorithm, we make this assumption  is  to clearly and conveniently present our algorithm.
 Although $P(\eta)$ is assumed to be a Gaussian function here, due to the non-linear relation between $P(\eta)$ and $P(V)$ in Eq.\ref{PDFv}, the resultant $P(V)$ is not Gaussian. Therefore the Gaussian assumption of peculiar velocity in the past literature is not true and should be abandoned.

To clearly present the algorithm, we randomly choose one galaxy from the 2MTF catalogue, the 2MASS ID of this galaxy is `2MASX09582105+3222119', the log-distance ratio (and error), redshift and peculiar velocity (estimated using Eq.\ref{travp}) of this galaxy are listed in Table~\ref{galexamp}, we also listed its Galactic longitude $\ell$ and latitude $b$ in the table.

The BC transformation parameter $\lambda$ is estimated from a set of samples using Eq.\ref{boxclog}. For a galaxy, we first need to generate a set of samples which has PDF of Eq.\ref{PDFv}, then estimating $\lambda$ for this galaxy using these samples. The details of the algorithm are presented as follows \footnote{The code for the algorithem can be downloaded from \url{https://github.com/FeiQin-cosmologist/GaussPv}}:

\begin{table}   \centering
\caption{The properties of the 2MTF galaxy `2MASX09582105+3222119'.}
\begin{tabular}{|c|c|}
\hline
\hline
\multicolumn{2}{|c|}{2MASX09582105+3222119}\\
\hline
 $\eta$   & 0.133183   \\
\\
 $\epsilon$   & 0.108191   \\
\\
 $cz$   & 1748  km s$^{-1}$  \\
\\
 $V$ & 460.15 km s$^{-1}$ \\
\\
 $l$ & 194.22$^{\circ}$ \\
\\
 $b$ & 52.32$^{\circ}$ \\
\hline
\end{tabular}
 \label{galexamp}
\end{table}

{\bf {\noindent   (i) Generating a spline function $P_{\mathrm{spl}}(V)$ for Eq.\ref{PDFv}:} }

Generating a set of $\eta \in [-1,1] $\footnote{From Fig.\ref{logds} we know the interval $\eta \in [-1,1] $ is large enough to cover all the 2MTF galaxies.}, calculating $P(\eta)$ from Eq.\ref{PDFeat}, where $\eta_n=0.133183$ and $\epsilon_n=0.108191$.
Calculating the corresponding  $z_h$ and $d_h$ using the $\eta$ values and $cz=$1748  km s$^{-1}$. Then
using Eq.\ref{travp} and Eq.\ref{PDFv} to calculate a set of velocities $v$ and the corresponding $P(v)$. Then we obtain a set of interpolation points $q=[v,~P(v)]$ and the corresponding spline function $P_{\mathrm{spl}}(V)$,  as shown in the dashed green curve in Fig.\ref{PVss}. The curve is bias from Gaussian significantly, i.e. the peculiar velocity of this galaxy does not have Gaussian error.

{\bf {\noindent   (ii) Generating a spline function for the inverse cumulative function corresponding to Eq.\ref{PDFv}:} }

Using the above interpolation points $q$ and the spline function $P_{\mathrm{spl}}(V)$, one can numerically estimate the cumulative distribution function (CDF) using
\begin{equation}
CDF=\int_{\mathrm{min}(v)}^{v} P_{\mathrm{spl}}(v') dv'~.
\end{equation}
Then we can obtain a spline function $V=f_{\mathrm{spl}}(CDF)$, which is the inverse function of CDF. As shown in Fig.\ref{CDFvs}.

{\bf {\noindent   (iii) Generating velocity samples which has a PDF of Eq.\ref{PDFv}:} }

Generate $M=150000$ uniform distributed random points in the interval of $[0,1]$ as the input to $V=f_{\mathrm{spl}}(CDF)$ to obtain velocity samples $\{v_i| i=1,2,...,M\}$. In Fig.\ref{PVss}, the blue bars shows the normalized histogram  of these samples, which matches the $P_{\mathrm{spl}}(V)$ curve.

{\bf {\noindent   (iv) BC transform of the velocity samples:} }

  Setting $\delta=25r$, where $r$ corresponding to the width where $P_{\mathrm{spl}}(V)=0.1\times$max$[P_{\mathrm{spl}}(V)]$, as shown in the yellow arrow in Fig.\ref{PVss} (See Section \ref{vdfgb} and Appendix \ref{AP3} for more discussion about the choice of $\delta$).

 Choosing a $\lambda$ in $(-\infty,+\infty)$\footnote{In practice, the estimated $\lambda$ is all in $[5,~30]$ for 2MTF.}.  Substituting $\lambda$, $\delta$ and $v_i$ into Eq.\ref{boxc1}, then into Eq.~\ref{boxclog} to calculate a $L(\lambda)$. Repeat this step to find the value of $\lambda$ that maximizes $L(\lambda)$. As shown in Fig.\ref{BCLBDs}, $\lambda=15.646$ is the best estimated BC transformation parameter for this galaxy.

 {\bf {\noindent   (v) Gaussianize the peculiar velocity:} }

   Plugging the galaxy's peculiar velocity $V=$460.15 km s$^{-1}$ and  $\lambda=15.646$ as well as the above $\delta$ into  Eq.\ref{boxc1}, we obtain the $Y=$7.3$\times$10$^{66}$. This is the BC transformed `velocity' for this galaxy.
   Substituting $\lambda=15.646$, $\delta$ and $\{v_i| i=1,2,...,M\}$ into Eq.\ref{boxc1} to obtain a data set
   $\{Y_i| i=1,2,...,M\}$.
   The standard deviation (std) of this data set, $\sigma=$1.77$\times$10$^{65}$ is measurement error of $Y$.
   In fact, the mean value of $\{Y_i| i=1,2,...,M\}$, $<Y_i>$=$7.3 \times$10$^{66}$ is equal to the $Y$ transformed directly from $V=$460.15 km s$^{-1}$.
   As shown in Fig.\ref{BCys}, the distribution of $\{Y_i| i=1,2,...,M\}$ (yellow bars) matches the Gaussian curve (red curve) very well

Applying the above algorithm to each of the 2MTF galaxies, we finally obtain the $(\lambda,\delta,Y,\sigma)$ for each galaxy. The data set of $(Y, \sigma)$ are the Gaussianized `velocities' which we can use to measure power spectrum, two-point correlation and cosmic flows. When fitting the measurements to the model, we also need to apply the same $(\lambda,\delta)$ to the modeled velocity value for each galaxy.

To reiterate, the above algorithm is independent from $P(\eta)$.
Although  $P(\eta)$ is assumed to be Gaussian in Eq.\ref{PDFeat}, however, this assumption is not necessary to the above algorithm. $P(\eta)$, in principle, can be chosen as any distribution. We even do not need to know the analytic expression of $P(\eta)$, as long as we can obtain an numeral function for $P(\eta)$, we can still calculate $P_{\mathrm{spl}}(V)$ in step (i), and then Gaussianize the peculiar velocity use the above algorithm. This shows the flexibility of the  above algorithm.

\begin{figure}
\centering
 \includegraphics[width=100mm]{ms2021-0055fig3.pdf}
 \caption{
 The dashed green curve is the spline function of Eq.\ref{PDFv} for `2MASX09582105+3222119'. The blue bars show the normalized histogram of the
 velocities samples $\{v_i| i=1,2,...,M\}$ generated from step (iii) according to Eq.\ref{PDFv}. For comparison, the red curve indicates the position of Gaussian PDF, centered in the mean value of these velocities samples, width calculated from the std of these velocities samples. The yellow arrow indicates the width where $P_{\mathrm{spl}}(V)=0.1\times$max$[P_{\mathrm{spl}}(V)]$.}
 \label{PVss}
\end{figure}

\begin{figure}
\centering
 \includegraphics[width=100mm]{ms2021-0055fig4.pdf}
 \caption{The black dots are the interpolation points generated in step (i). The blue curve shows the inverse spline function of CDF for `2MASX09582105+3222119'.}
 \label{CDFvs}
\end{figure}

\begin{figure}
\centering
 \includegraphics[width=100mm]{ms2021-0055fig5.pdf}
 \caption{The pink curve shows   the logarithmic likelihoods $L(\lambda)$ for `2MASX09582105+3222119'. The yellow dashed vertical line indicates the position of $\lambda$ which maximizes $L(\lambda)$.}
 \label{BCLBDs}
\end{figure}

\begin{figure}
\centering
 \includegraphics[width=100mm]{ms2021-0055fig6.pdf}
 \caption{The yellow bars show the normalized histogram of the BC transformed `velocity' samples $\{Y_i| i=1,2,...,M\}$ from step (v). For  comparison,  the  red  curve  indicates  the position of Gaussian PDF, centered in the mean value of these samples, width calculated from the std of these samples. The blue dashed vertical line indicates the position of the mean of these samples, the mean is $7.324\times10^{66}$.}
 \label{BCys}
\end{figure}

\subsection{$\lambda$ as a function of $\epsilon$}\label{vdfgb}

In Fig.\ref{BCyss}, we plot the BC transformation parameter $\lambda$ against the measurement error of log-distance ratio  $\epsilon$ for all the 2MTF galaxies, the yellow line is the best fit to the dots, and the fit equation is given by:
\begin{equation} \label{lbdep}
\lambda= k \epsilon+b~,
\end{equation}
For $\delta=25r$, the fit result is:
\begin{equation}  \label{asw}
k=135.1~,~~b=0.3247~,
\end{equation}
The relation Eq.\ref{lbdep} is also existed for the 2MTF mocks, see Appendix \ref{AP2} and Fig.\ref{BCyssA} for more discussion.
Does this relation also exist for other surveys? From the details of the algorithm presented in Section \ref{sec:box1},
we find that the BC transformation parameter $\lambda$
does not depend on any particular survey. In Appendix \ref{AP2}, we find this relation also existed in the 6dFGSv surveys.
6dFGSv \citep{Springob2014} is a Fundamental Plane survey. Therefore, the linear relation Eq.\ref{lbdep} exists for both Tully-Fisher and Fundamental Plane surveys (at least, for 2MTF and 6dFGSv).
In the future work, we also need to explore whether this relation is true for the peculiar velocity samples measured from Type-Ia supernovae (as well as any other distance measurements techniques). If this relation widely exists, then one can compute
$\lambda$ directly from Eq.\ref{lbdep}, rather than performing the whole algorithm. This will be very time saving for plenty of mocks and the upcoming larger surveys, such as SkyMapper \citep{2018arXiv180107834W}, DESI \citep{DESI2016}, LSST \citep{2008arXiv0805.2366I},  WALLABY \citep{2012PASA...29..359K,Koribalski2020} and Taipan Galaxy Survey \citep{2017PASA...34...47D}, .

The choice of $\delta$ can change the fit parameter $k$, but will not change the linear relation and $b$. Choosing smaller  $\delta$ will result in smaller $k$, but may not  keep all the samples positive in Eq.\ref{boxc1}. Too large $\delta$ will result in overflow in the memory of computer.  See Appendix \ref{AP3} for more discussion.

\begin{figure}
\centering
 \includegraphics[width=100mm]{ms2021-0055fig7.pdf}
 \caption{$\lambda$ as a function of $\epsilon$ for all 2MTF galaxies. The yellow line is the best fit to the blue data points.}
 \label{BCyss}
\end{figure}

\section{Bulk flow estimation techniques} \label{sec:BKest}

In this paper, we take the bulk flow measurement as an example to show the implementation of the Gaussianized peculiar velocities. We will introduce a new bulk flow estimator that estimates bulk flow from the Gaussianized peculiar velocities. We also using mocks to test the technique and compare it to the  techniques used in other literature.
In the future work, we will extend to explore new techniques for the power spectrum and two-point correlation measurements as well as the density field reconstruction using the Gaussianized peculiar velocities.

 \subsection{Bulk flow estimation techniques in previous work}

Galaxies' peculiar motions form the cosmic flow field in the nearby Universe. The bulk flow velocity is the dipole component of the cosmic flow field \citep{Lister1989,Jaffe1995,Parnovsky2001,Feldman2010,Qin2019a}. Measuring the bulk flow velocity and compare to the cosmological model prediction enables us to test whether the model accurately describe the motion of galaxies in the nearby Universe. In the past literature, bulk flow is usually measured in velocity space and log-distance ratio space.

Firstly, measuring the bulk flow in velocity space (v-space). The two main v-space measurement techniques are  maximum likelihood estimation (MLE, \citealt{Kaiser1988}), and minimum variance (MV) estimation \citep{Watkins2009,Feldman2010}. In this paper we only focus on the MLE technique. In \citealt{Kaiser1988}, under the assumption that peculiar velocities have Gaussian errors,  the likelihood of $N$ line-of-sight peculiar velocities can be written as
\begin{equation}\label{tramlesa}
S({\bf B},\alpha_{\star})=\prod_{n=1}^{N}\frac{1}{\sqrt{2 \pi \left(\alpha^2_n+\alpha_{\star}^2 \right)}}\exp\left(-\frac{1}{2}  \frac{    (V_{n}-{\bf B} \cdot {\bf \hat{r}}_n)^2  }{  \alpha^2_n+\alpha_{\star}^2 }\right)~,
\end{equation}
where the vector ${\bf B}=[B_x,B_y,B_z]$ is the bulk flow velocity to be estimated, ${\bf \hat{r}}_n$ is the unit vector point to the $n-$th galaxy, $\alpha_n$ is the measurement error of $V_n$. Finally  $\sigma_{\star}$ is introduced to account for the intrinsic scatter of the peculiar velocities, and is usually assumed to be 300 km s$^{-1}$ \citep{Sarkar2007,Scrimgeour2016} (though in this paper we vary it as a free parameter).
In this technique,the peculiar velocities estimated from Eq.\ref{watvp} can be the input to Eq.\ref{tramlesa}. For convenience, we call this technique $w$MLE.

Secondly, to avoid the non-Gaussianity of the estimated peculiar velocities, the measurement of bulk flow can be performed in the log-distance ratio-space, or $\eta$-space. \citealt{Nusser1995,Nusser2011,Qin2018,Qin2019a}  used the so-called $\eta$MLE to measure the bulk flow. \citealt{Boruah2020} measures the bulk flow in distance modulus space, since $\eta$ is simply linearly converted from the distance modulus, their method and any other similar method also be classified as $\eta$MLE. In this paper we use the $\eta$MLE of \citealt{Qin2018}, and the algorithm is clearly presented in Section 4.2 of that previous work.

\subsection{Bulk flow estimator}\label{ijnh}

In this section, we will introduce the bulk flow estimator that estimates bulk flow from the BC-transformed peculiar velocities.

After we obtain the $(\lambda,\delta,Y,\sigma)$ for each galaxy, we can write the likelihood of $N$ galaxies, each with $(Y_n,\sigma_n)$, as
\begin{equation}\label{smle}
L({\bf B},\sigma_{\star})=\prod_{n=1}^{N}\frac{1}{\sqrt{2 \pi \left(\sigma^2_n+\sigma_{\star}^2 \right)}}\exp\left(-\frac{1}{2}  \frac{    (Y_{n}-F_n({\bf B}))^2  }{  \sigma^2_n+\sigma_{\star}^2 }\right)~,
\end{equation}
where:
\begin{equation}
F_n({\bf B})=\left \{
\begin{aligned}
&\frac{({\bf B} \cdot {\bf \hat{r}}_n+\delta_n)^{\lambda_n}-1}{\lambda_n}, &\lambda_n \neq 0\\
&\ln({\bf B} \cdot {\bf \hat{r}}_n+\delta_n)~, &\lambda_n = 0
\end{aligned}
\right.
\end{equation}
where the vector ${\bf B}$ is the bulk flow velocity to be estimated, ${\bf \hat{r}}_n$ is the unit vector point to the $n$-th galaxy. $\sigma_{\star}$ is introduced to account for the intrinsic scatter of the velocities. In this paper, we set it as a free parameter. $F_n({\bf B})$ is the BC transformation of the model peculiar velocity for the $n$-th galaxy, transformed using $(\lambda_n,\delta_n)$ of that galaxy.

The maximum likelihood ${\bf B}$ cannot be obtained analytically due to the non-linear relationship between the model ${\bf B}$ and $F_n({\bf B})$. Instead, combining uniform priors on the $\sigma_{\star}$ and ${\bf B}$ with the likelihood in Eq.~\ref{smle} to obtain the posterior probability of these four independent parameters, we can estimate the bulk flow using the Metropolis-Hastings Markov chain Monte Carlo (MCMC) algorithm. The flat priors of the four parameters are in the interval $B_{i}\in[-1200,+1200]$ km s$^{-1}$  and $\sigma_{\star}\in[-1000,+1000]$ h km s$^{-1}$ Mpc $^{-1}$.

The measurement error of the bulk flow component,  $e_{B_i}$ ($i=x,y,z$) is the std of the MCMC samples of the corresponding MCMC chain\footnote{We use the {\tiny PYTHON } package {\tiny emcee } \citep{Foreman-Mackey2013} to perform the MCMC. For each of the four parameters, we use 24 walkers, and for each walker, we generated 100,000 MCMC samples. Therefore, there are 2,400,000 samples in each of the four MCMC chains. This is smooth fairly enough to estimate the measurements errors.}. The measurement error of the bulk flow amplitude, $e_{B}$ is calculated using \citep{Scrimgeour2016,Qin2018}:
\begin{equation}\label{bke2}
e^2_B=JC_{ij}J^T~,~~(i=1,2,3)~,
\end{equation}
where $J$ is the Jacobian of the bulk flow, $\partial B/\partial B_i$. $C_{ij}$ is the covariance of the bulk flow components calculated using the MCMC samples.

In the following section,
we will test and compare the above bulk flow estimation technique to $w$MLE and $\eta$MLE using mock 2MTF surveys.

\subsection{Testing using mocks}

In order to compare and test how well the bulk flow estimators are expected to recover the true bulk flow from the 2MTF survey, we applied the three estimators to 16 mock 2MTF catalogues.

The `true' bulk flow velocity, ${\bf B}_t$ within each mock is defined by averaging over the true galaxy velocities ${\bf v}_t$ along orthogonal axes \citep{Qin2018,Qin2019a}
\begin{equation}
B_{t,i}=\frac{1}{N}\sum^N_{n=1}v_{t,in}~,~~(i=x,y,z)~,
\end{equation}
where ${\bf v}_t$ is know from the simulations. Only the mock 2MTF galaxies in the simulation are used to compute ${\bf B}_t$.

Fig.\ref{2mtfmock} shows the measured bulk flow against the true bulk flow in equatorial coordinates. All three bulk flow estimators can recover the true bulk flow. The top panel is the $\eta$MLE measurement.
The middle panel is the $w$MLE measurement.
The bottom panel is the measurement using the technique of Section \ref{ijnh}.

 The scatters of the points in the three panels are  most likely due to the intrinsic scatter $\sigma_{\star}$ (or $\alpha_{\star}$ of wMLE)  of the true velocities in the mocks \citep{Qin2018,Qin2019a}. $\sigma_{\star}$  (or $\alpha_{\star}$) accounts for the non-linear peculiar motions of galaxies. In the future, a more accurate peculiar velocity estimator, which can more accurately predict and model for non-linear motion, needs to be developed.  Such new estimators will result in more non-Gaussianity than Eq.\ref{travp}, indicating the importance and usefulness of our method for Gaussianizing the estimated peculiar velocities.

If only having a look at the scatters of the symbols in the three panels (the difference between the measured values and the true values), one can find that the scatters are almost the same for the three estimators. However,  the technique of Section \ref{ijnh} gives smaller measurements errors
We plot the measurement errors of the bulk flows given by this technique against those of $\eta$MLE and $w$MLE, as shown in Fig,\ref{2mtfmockerr}, we find this technique gives smaller measurement errors comparing to both $\eta$MLE and $w$MLE

  Using the Gaussianized peculiar velocity fields to measure the bulk flow can reduce the measurements errors
    In the future, we will also explore whether using the Gaussianized peculiar velocities can  reduce the measurement errors of the power spectrum and two-points correlation, and then reduce the measurement errors of the cosmological parameters.

The value of $\delta$ will not change the bulk flow measurements. See Appendix \ref{AP3} for more discussion.

\begin{figure}
\centering
  \includegraphics[width=100mm]{ms2021-0055fig8a.pdf}
     \includegraphics[width=100mm]{ms2021-0055fig8b.pdf}
    \includegraphics[width=100mm]{ms2021-0055fig8c.pdf}
 \caption{  Comparing the measured bulk flow for the 16 2MTF mocks in equatorial coordinates. The top and middle panels are for the $\eta$MLE and $w$MLE, respectively. The bottom panel is  measured from the Gaussianized velocities along with the estimator in Section \ref{ijnh}.}
\label{2mtfmock}
\end{figure}

\begin{figure}
\centering
  \includegraphics[width=100mm]{ms2021-0055fig9.pdf}
 \caption{ Comparing the measurement errors of bulk flows measured from the Gaussianized peculiar velocities (of 16 2MTF mocks in equatorial coordinates) to those of $\eta$MLE (top panel) and $w$MLE (bottom panel).
 }
\label{2mtfmockerr}
\end{figure}

\section{Bulk flow Result and discussion}\label{sec:dis}

\subsection{Results}

 Fig.\ref{2mtfbkfmc} shows the bulk flow velocity measurement in Galactic coordinates
using the Gaussianized 2MTF peculiar velocities along with the bulk flow estimator in Section \ref{ijnh}.  The vertical dashed line indicates the best estimated bulk flow velocity components $B_i$ $(i=x,y,z)$. The histograms shows the distribution of MCMC samples for each $B_i$,
the shaded regions are the $1\sigma$ measurement errors of $B_i$.

For comparison, in Table~\ref{bkflb}, we list the measured bulk flow velocity and its direction using the three estimators. Our new estimator gives the smallest error compare to $\eta$MLE and $w$MLE.

\begin{table*}   \small
\caption{Comparing the bulk flow velocities of 2MTF survey measured from the three estimators.
}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hline

&  $|{\bf{B}}|$ & $B_x$ &   $B_y$  &  $B_z$
& $\ell$ & b & Depth \\

&km s$^{-1}$ &   km s$^{-1}$  & km s$^{-1}$&km s$^{-1}$
& degree&degree &Mpc h$^{-1}$\\
\hline

  This paper  &$332.41\pm27.45$    & $126.77\pm30.18$ &   $-298.66\pm27.68$ &  $72.31\pm20.27$ &$292.99\pm 5.30$&   $12.56\pm 3.54$  &30\\
\hline

  $\eta$MLE  &$ 333.99\pm30.31$    & $116.66\pm33.81$ &   $-304.29\pm30.84$ &  $73.16\pm23.33$ &$290.98\pm 5.90$&   $12.65\pm 3.98$  &30\\
\hline

  $w$MLE  &$338.91\pm31.18$    & $107.67\pm34.45$ &   $-313.15\pm32.23$ &  $72.15\pm24.47$ &$288.97\pm 6.01$&   $12.29\pm 4.11$  &30\\
\hline

\end{tabular}
 \label{bkflb}
\end{table*}

\begin{figure}
\centering
  \includegraphics[width=120mm]{ms2021-0055fig10.png}
 \caption{The bulk flow velocity measurements of the 2MTF survey. The marginalised histograms shows the distribution of the MCMC samples of $B_x$, $B_y$ and $B_z$. The shaded region in the histograms is $1\sigma$. The filled 2D contours indicate the 1, 1.5, 2 and 2.5$\sigma$ regions. The vertical dashed line indicates the best estimated value of $B_x$, $B_y$ and $B_z$.}
\label{2mtfbkfmc}
\end{figure}

\subsection{Comparison with $\Lambda$CDM theory}

In this section, we compare the estimated bulk flow amplitude, $|{\bf{B}}|$ to the predictions from $\Lambda$CDM. At redshift zero, assuming the $\Lambda$CDM model, the growth rate $f=\Omega_m^{0.55}$ \citep{Linder2007}. The variance of the bulk flow velocity is \citep{Gorski1988,Li2012,Hong2014,Andersen2016,Qin2018,Qin2019a}
\begin{equation}\label{sigB}
\sigma_B^2=\frac{H_0^2f^2}{2\pi^2}\int\mathcal{W}^2(k)\mathcal{P}(k)dk~,
\end{equation}
where $\mathcal{P}(k)$ is the linear matter density power spectrum generate using the {\tiny CAMB} package \citep{Lewis:1999bs, 2012JCAP...04..027H},  $\mathcal{W}(k)$ is the Fourier transform of the survey window function. The computation of the accurate $\mathcal{W}(k)$ of 2MTF is clearly presented in Section 6.2 of \citealt{Qin2018}.

The PDF of the bulk flow amplitude is given by \citep{Li2012,Hong2014,Scrimgeour2016,Qin2018,Qin2019a,Boruah2020}
\begin{equation}\label{pbb}
p(|{\bf{B}}|)=\sqrt{\frac{2}{\pi}}\left(\frac{3}{\sigma_B^2}\right)^{1.5}|{\bf{B}}|^2\exp\left(-\frac{3|{\bf{B}}|^2}{2\sigma_B^2}\right)~,
\end{equation}
where the most likely $|{\bf{B}}|$ is expressed as $B_p=\sqrt{2/3}\sigma_B$, and the cosmic variance of $|{\bf{B}}|$
is given by $B^{~+0.419\sigma_B}_{p~-0.356\sigma_B}$ ($1\sigma$,   \citealt{Scrimgeour2016,Qin2018}).
The upper and lower limits mean that the integral of Eq.\ref{pbb} in the interval $\left[ B_p-0.356\sigma_B,  B_p+0.419\sigma_B   \right]$ is 0.68.

The $\Lambda$CDM model predicted  bulk flow amplitude for the 2MTF
is quoted from \citealt{Qin2018} and is listed in Table~\ref{bkvst}. The measurement is consistent with $\Lambda$CDM prediction.

\begin{table}   \centering
\caption{Comparing the measured bulk flow to the $\Lambda$CDM prediction. Errors on the $\Lambda$CDM prediction denote the cosmic variance.}
\begin{tabular}{|c|c|c|}
\hline
\hline
Data set &$\eta$MLE&$\Lambda $CDM\\
  &km s$^{-1}$&km s$^{-1}$\\
\hline

2MTF     & $332\pm27$ & 315$^{+161}_{-137}$ \\

\hline
\end{tabular}
 \label{bkvst}
\end{table}

\section{Conclusions}\label{conc}

We developed an algorithm that can Gaussianize the line-of-sight peculiar velocities estimated from Eq.\ref{travp}. We also find that the BC
transformation parameter $\lambda$ is a linear function of the
the measurement error of log-distance ratio $\epsilon$.
This relation exists for the Tully-Fisher survey, 2MTF and the Fundamental Plane survey, 6dFGSv. However, more works need to be done in the future to further exam this relation using different surveys.

We developed a bulk flow estimation technique to measure the bulk flow from the Gaussianized peculiar velocities.  We also test the estimator using 2MTF mocks, and find that measuring bulk flow from the Gaussianized peculiar velocities can reduce the measurement errors compare to $w$MLE and $\eta$MLE. In the future, we will also develop new techniques for the power spectrum and two-point correlation measurements using the Gaussianized peculiar velocities.

We have measured the bulk flow velocity using the Gaussianized 2MTF surveys. The estimated bulk flow is $332\pm27$ km s$^{-1}$ at a depth of $30h^{-1}$ Mpc, the result is consistent with the $\Lambda$CDM prediction.

\section*{Acknowledgements}
We like to thank David Parkinson for multiple discussions.

FQ is supported by the project \begin{CJK}{UTF8}{mj}우주거대구조를 이용한 암흑우주 연구\end{CJK} (``Understanding Dark Universe Using Large Scale Structure of the Universe''), funded by the Ministry of Science.

This research has made use of the
{\verb emcee } package \citep{Foreman-Mackey2013},
{\verb ChainConsumer } package \citep{ChainConsumer},
 {\verb SCIPY } package \citep{Virtanen2020} and  {\verb MATPLOTLIB }
package \citep{Hunter2007}.

redpajama_set_name: RedPajamaArXiv


I work across town, which means I have to fill up my tank at least once a week. With the rising cost of gas, this comes to about $50 a week. What can I do, though? Work is too far to walk or ride my bicycle. Recently, while riding my bike, I was hit by a car. After the doc fixed me up I had my arm in a sling. This meant I couldn't drive my manual transmission vehicle.
A coworker suggested the bus. What a revelation! With coupon books, the bus costs me $13.50 a week and I found a direct route which gets me to work about the same amount of time as driving. This saves me about $37 a week. It's true what they: necessity is the mother of invention. Once my arm heals completely I going to continue to bus it.
Alternate transportation can be a real money saver. I'm always surprised at how many people never think beyond their cars. Especially if you're looking to improve your physical fitness, look into biking to work or walking to the store. It's easy to walk a mile to your grocery store, and then carry your groceries home in a backpack.
My wife rode the bus to work for several years. It took her an hour to make the commute and cost her about $50/month. If she had driven, she could have made the commute in half the time, but it would have cost her three times as much. For a couple of years, I tried to bike to work most of the summer. I did this for fitness, not for frugality, but the savings were a nice side benefit.
Often there are ways to save right under your nose. You just need to open your eyes to see them!
If you have a financial success story, drop a line at . Share it with your fellow GRS readers!
There are 34 reader responses to "Reader Story: Necessity is the Mother of Frugality".
We recently had to become a two-car family, so instead we became a one-car, one-scooter family. My Vespa-like scooter gets me to work in the same amount of time, and I spend 1/10th the amount on gasoline. It's not as sweaty as walking or biking, and less dangerous at night, and with the right inexpensive clothing even rain isn't a problem. I recommend others look into scooters as a viable option for commuting.
A few months ago, I started riding the bus in the morning then riding my bike back home. (I am lucky enough to live in an area where all the buses have bike racks.) When I drove to work, it cost me aprox. $125 a month. Now, an unlimited monthly bus pass cost $10 & my bike costs nothing but sweat. An unexpected benefit of the bus is time to read or listen to podcast & serves as a buffer between my home mindset and work mindset. It is not for everyone, but I highly recommend trying it for a week.
I recently moved with my fiance into a house my parents own, which happens to be right next door to the house they live in. Luckily, we all get along really well. The downside is that it is out in the "country" at least 30 minutes from work (of course, when I lived in the city, my commute was about the same, only it was b/c of stop-and-go traffic). Anyway, my dad and I kept seeing each other on our drive home. We even stopped at the same gas station at the same time…twice! So after being beat in the head with the fact that our schedules were similar enough to commute, we drive to work together now. Granted, my situation is unique, but it does prove that there are options, even if you live too far away to walk or bike.
My previous job was 19 miles one-way on a two-lane, no bikes allowed highway, with no bus routes so I didn't have any option other than driving (which wasn't bad at all since it was against traffic).
When I started my present job 14 miles from home with tons of routes to choose from, I actually made a spreadsheet to compare various commute options.
Bus was out of the question, since the fastest bus route took well over an hour and required at least one transfer (driving by comparison was 25-45 minutes, depending on traffic). My spreadsheet compared driving solo with commuting by cycle and scooter. Obviously cycling is the most economic option, but 14 miles one way was a bit far for me.
Enter the eZee electric/bicycle hybrid from Electric Vehicles NW. Up front costs were a bit steep at $1,600, but as long as I continue to ride it instead of driving at least 2-3 days a week, I'll have made up the cost in just a few years. The $30/month bonus my workplace gives for using "commute alternatives" certainly helps. Plus, it's good for my health.
Of course, I'm lucky in that I live just 2 blocks from Seattle's best bike path/trail, the Burke-Gilman & Sammamish River Trails. The commute by bike is over a mile shorter than the shortest route by car, and takes just 40 minutes, which is less than driving in moderate traffic.
Feel good, save money, and save time. I love it!
My commute to work is 45km round trip, and I do it all on a Yamaha Vino scooter. I traded in my car, and am now saving so much on insurance (only $15/month), maintenance and gas ($5 to fill up). In fact, it's cheaper than buying a monthly bus pass!
For my work commute, I drive one mile to the local light-rail train stop, and then take the light rail for the 15-mile ride into downtown. It slightly increases my commute time if I don't time it well, but it's totally worth it.
During the winter if the weather is bad, there is a bus stop 2 blocks from my home. I'll get myself to the bus stop in lieu of making the one mile drive to the light rail. This does, however, make the whole commuting process 30 to 45 minutes longer so I only do it when icy conditions make driving unfun.
I save on gas, wear-and-tear on my car AND avoid a hefty $10+/day parking fee. My pass costs my $50 a month, and I save a few hundred.
I started riding the bus as a "temporary measure" when our second car got stolen. That was over a year ago, it's been working so well that I don't intend to replace it. In the spring I'll start riding my bike to work.
You all sure live far from work. I live about 200 yards from my office, which also happens to be one of the cheapest apartment complexes in the city. Where I live, rent is cheaper than property taxes alone, not to mention mortgage interest, maintenance, and other home ownership costs. The cost of my commute is just wear and tear on my shoes, and it's a heck of faster than sitting in gridlocked traffic or the various public transportation options.
I started working at home and we became a one car family. I do all the grocery shopping on foot and have lost a good amount of weight too.
I think it's sad that so many parts of north America are so unfriendly to pedestrians.
Lemme suggest the new Schwinn Electric bikes! They're awesome and actually work amazingly well, and you won't look like a dork like those other bikes in post 4. Little 'spensive now, but they should be coming down. And no, they're not for the lazy, they're more for your dedicated commuter who needs a little help with hills or a hot day every now then.
I'm curious how far is "too far to bike to work"? I live 45 miles from where I work, and take the commuter train into the city during much of the year. The cost for this recently increased over 25% to $250/month.
During the summers I bike to work. I start out at the beginning of the summer driving most of the way and bike the last 15 miles or so. As the summer goes along, I drive in a shorter distance and bike further, to the point where I'm biking in 23-25 miles and only driving in 20 or so. I do this twice a day, once in, once out. The amount of time my commute takes is not significantly longer compared to the train, and is actually significantly shorter compared to driving all the way.
This is my 4th year doing this, and let me tell you, an hour bike ride in the morning is a better wake-up than coffee, and a fantastic stress release after work!
Oh, and my first year biking, I got hit by a car too, but it didn't stop me. The weather is way too nice during the summer for me to want to give that up to sit squished into that sardine-can of a train on a 90+ degree day when the train AC is broken.
I live about 4.5 miles from work. I walk almost every morning, which takes 80 minutes (about 45 minutes longer than the bus). I figure for that 45 minute investment I save $2 plus I don't have to spend any time or money at the gym because I'm combining commuting and exercise. I take the bus home. I always carry my camera too, because the world is a much more interesting place on foot.
??????? When we go to the grocery store every 10-14 days or so, we bring back 6-10 bags of food, not to mention the occasional 2-6 12-packs of soda cans (when they're on sale).
Rich has an excellent point. I often walk to the store for small trips. For medium trips, Kris and I go together to carry things home. (Sometimes we ride our bikes.) But for big trips? We drive the car.
I try to work at home and not pay anything for commuting cost. Also saves on meals out, clothing,etc. Of course, it isn't easy. But I don't have to make as much money to replace outside income due to savings. I actually havent had a job in almost 3 years. ( I had 1 year of income saved, cut my expenses in half, 6 months severance, started selling things online, sold 1 website for 4 figures, and never bothered to look for another job when I was laidoff,etc). I have gone back to school in my late 20s ( I guess to "get a career" where I will have drive to work) and am also thinking about getting some kind of job ( doesnt really matter what as long as it pays), just to make things easier in the meantime. However, every time I think about it seems the added expense would wipeout any earnings. Not to mention taking time away from things I value more ( and could potentially be more lucrative). When I fnish my next( and last) degree, I dont think I will look anywhere outside of 15 miles from here. If there is nothing there, I will just keep working at home. Maybe freelance with my newer qualifications, if anything. I actually picked my major somewhat based on the local job market and forecasts,etc. I know that I can find something around here in the field.
Fortunately, I have about 4 grocery stores, Walmart, target, B&N, Malls,etc in about a 10 mile radius. So for shopping and running errands, the fuel cost is minimal ( I get 30 MPG). A Big Shopping Trip might cost me $2 in gas. It costs more for the gas in my lawnmower.
Not everything is about saving or sqeezing money. I can think of a lot of reasons NOT to ride a bike or take a bus somewhere. I have better things to do with my time. There are some places biking is not safe, and some employers where riding a bike is not practical,etc. I think we've been over the "public transportation is not available everywhere" thing a million times. And when it is, it's rarely convenient. I used to have a co-worker who spent about 4 hours a day waiting for buses or walking. He didn't have a car. No one on that particular bus did, or they would drive.
My life is based on frugality out of necessity ( but also a little choice). I know I can get by without needing a lot of money, commuting 100 miles or needing to work 80 hours a week and/or in some high profile profession.
So for me, I just dont go anywhere. Or I will work very close to home and save the time and money ( both apply to driving and biking/public transport), even if it means grossing much less.
Right now I do a 150km roundtrip drive to work every day – takes me about an hour (or less) depending on traffic… at the time I started this commute, I had no money and no job. Now, its looking like my employer wants to keep me on… so I'm moving closer to work. With the cost of gas and maintenance, my $550 a month room, even if I drive back to visit my folks a couple of times a month, will be a heck of a lot cheaper than the maintenance for my old car. Plus, I'll be within walking distance of work, which will mean about 40 min of walking a day, which is wonderful.
If the gas would have been cheaper, or the roads a bit clearer, I probably wouldn't have thought about moving closer. Necessity is the mother of invention, or innovation.
If you're frugal, what's the point of the soda? seriously, this does nothing to fuel the body. It's a senseless, purposeless drink. you're *much* better off with juice or just putting a lemon in your water.
Makes me wonder what the 6-10 bags of "necessities" are- chips, mac n' cheese.
I walk my commute — 4.4 miles round-trip. In the morning, my wife and I walk together (we work in the same building). In the afternoon we leave at different times, so I listen to audio books, music and podcasts on my iPod.
I'm a big fan of living close to your work. I've done long commutes in the past — they wear you down financial and emotional. I hope to never do that again!
I don't have a car, even though I am a professional earning a decent salary. I take the subway to work everyday. I deliberately chose to live in a walkable neighbourhood with a variety of stores (supermarkets, drugstores, hardware store, etc.). I bike to the farmer's market. I carry my groceries home on foot — using backpacks and canvas bags, I can carry up to $75 worth. Every so often I have my groceries delivered — that's when I stock up on heavy items. I don't buy junk food, so there's less to carry. I sometimes stop at a natural foods store on my way home from work. Doing without a car isn't very hard and it saves me a lot of money. It would not work in a suburban area though — but then I wouldn't want to live in a suburban area!
As someone who has been busing to work her entire career (granted it's only been four years) and is now about to purchase a car, I have to say the monetary savings just isn't worth potentially being late to meetings due to late or early buses (an early bus is worse than a late bus because if you miss the early bus you're then left waiting for the next potentially late bus), or dealing with my nice business attire getting ruined due to snowstorms/rainstorms, or having to leave work an hour early just to get to my gym on time for my personal trainer appointment at the gym 10km away from here (should take about 10 minutes to drive).
I agree that using public transportation saves you money, but at some point the costs (not monetary) outweigh the benefits.
Let's keep in mind the fact that not everyone's situation allows them to bike to work. That's great that you can, but what about parents who pick up kids after school? What about people who would have to bike down winding roads with no shoulder (as in my case)? It is dangerous and irresponsible to bike down at least half of my commute, both for bikers and for drivers who have no visibility to pass.
What may work for one person won't necessarily work for another, but I think the real point is to think outside the box to find the best solution for your situation.
I'm by no means saying what I do is do-able by all. I was merely asking what the OP meant by the statement that he lives too far away to bike to work, and trying to communicate that it doesn't have to be an all-or-nothing bike commute. I drive half way, bike half way.
I count myself as quite fortunate to be able to bike, to be able to park freely at the places I bike from, and to have both a shower at work and a schedule flexible enough to allow it.
I apologize if I came across as preaching that everyone should follow my lead. That was not my intent.
I have two options for getting to work, I can drive or I can take the train and then bike in from the train station. Both are about the same price, but the driving option is faster, about 30 minutes compared to 1 hour by train.
So the car options sounds better, but then I think about this. When I drive, I can do nothing but drive. When I take the train, I can read, work or even sleep, and then I get a good workout biking the last two miles from the station to work. So the hour I spend on the train commute is useful, while the 30 minutes I spend in the car is completely wasted. Add to that the physical benefits of the bike ride plus the environmental harm of the car, and it's an easy choice.
60 in 3 — you are right about that. I read a book or knit during my subway commute. It's productive time and I don't arrive at work stressed out by traffic.
When I drive, I can do nothing but drive.
I listen to audiobooks on my commute. Working my way through the Aubrey/Maturin series at the moment. It helps to have local libraries with good book-on-CD stocks.
It's true that none of these solutions will work for everybody. But I know an awful lot of people say they 'need' a car and I'm pretty sure a lot of them are just used to cars and can't imagine life without one.
I'm 48 years old, and with the exception of 2 years when I lived in the country, I've never had a car. A car might make some things easier, but for me it's not worth the expense or hassle.
I second everything that Paul has said, emphatically. Driving part of the way to work and biking the rest of the way is a great way to cut down on commuting costs if it seems too far to bike all the way.
A few years ago I started driving 15 miles in to work and biking the remaining 5, which took less time than either driving all the way or taking public transit, and was significantly cheaper than both. After a while I started driving 7 miles to the rail-trail that comes near our house, and biking the remaining 13 miles. This week I started biking the full 20 miles each way — a routine I will almost certainly not keep up full time, but it's nice to know that I'm at a point where I *can* do it some of the time.
Driving all the way to work: $5/day in gas, $10/day in parking, 1 hour each way.
Driving to the train: $3/day in gas, $5/day parking, $4/day train fare, 1 hour each way.
Driving + biking: $1/day gas, 1 hour 15 minutes each way.
Biking: $0/day, 1 hour 30 minutes each way.
I can't possibly tell anyone else what they should do, and it is certainly true that some people are in a position where they just cannot bike at all, but it is hard for me to contain my enthusiasm. Not only has it reduced my commuting costs in the short term, but the improvements in my stress levels, daily mood, and overall health are hard to put a dollar value on. I wouldn't give it up for anything.
For the past couple of years I had no choice but to use public transportation to get to work which took about 2 hours each way (including a half hour wait between buses). I simply had never learned to drive. I lived in NYC for 15 years after high school so it was never an issue. Once I moved here to TX, I really didn't mind too much since it gave me time to read, do the crossword puzzle, knit etc. and the bus pass is soooo cheap here. I don't worry too much about weather since I can wear a raincoat or carry an umbrella.
I took driving lessons and earned my license last November. Very recently my office moved a bit closer and my commute is only about a half hour each way. I still don't have a car, though I will probably get one next year. I won't use it for getting to work most of the time since parking downtown is outrageously expensive.
I've really enjoyed watching some of my co-workers get used to taking public transportation-many for the first time in their lives. Some have even taken advantage of the express buses that have free wi-fi.
It all just takes a bit of planning. When I was initially looking for a place to live here, I specifically chose an apartment located complex across the street from a shopping center that had a grocery store and a bank and that was convenient to a major bus line. Unfortunately the grocery store closed last year, but there is another down the street and several others that are a quick bus ride away. In many ways this is not that much different from the way I lived in NYC, except most things shut down by 11pm.
The important thing is to do the math.
For me to commute 20 days a month, 16 miles a day (round-trip) at 38 mpg works out to $34/mo in gas. Parking is free.
To ride the bus would cost $60/mo.
Guess what? I drive most days – although I do telecommute once a week or so, thus bringing my commute costs down further.
If you have to drive, make good use of the time. I'm brushing up on my French by listening to language CDs and practicing the exercises. It's been a lot of fun. I'm going to get Spanish CDs next!
My car gets about 20 mpg. My daily commute is 20 miles round trip and takes me 20-30 minutes. Which means it costs me roughly $3/day to get to and from work.
But I wanted to try to drive less so I looked into using public transport to get to work. Because of the way the system is laid out, it would take me at least 90 minutes to get to work (one-way) and the fare is $2.05 one-way. So to get back and forth to work using public transport, it would cost me about $1 more per day and it would take me roughly 3 times as long to make my commute.
So yes, do the math first. It might seem cheaper to use public transport with gas prices being what they are, but it's not necessarily true in all cases.
I take public transportation, but I am curious about something, so I thought I would ask you about it. Should the gas keeping going up and up, would living further away, like these people, from work, be cost effective? How would that work for the suburbs, when people want to live well away from the main city?
When my parents chose a suburb to live in, access to public transport into the city was a consideration. Similarly, I have chosen to stay where I am in an urban area because it cuts down on the commute (altho nowadays I work a lot from home). It is also the hub of the old streetcar transportation grid, so if I HAVE to I can take public transport. Altho I had an experience once of a 4-hr. bus ride (round trip) for a 4-hr job once. That was NOT fun. I do wish the buses here in L.A. were more middle class, too.
by. I drive 10 miles a day, 5 miles each way to/from the train station.
which, given current gas prices, is probably cheap.
miles and could bike the entire distance.


How can I scale the impact of my work?
Should I partner or go it alone?
How many funders do I really need?
And how many miles have I flown?
Given how much this outfit has grown.
Before we all just explode?
Before we burn out from overload?
Channeling the real world challenges of social entrepreneurs!


text:
Q: code iterating through a foreach loop 84 times, unity3d I'm working on a section of code and everything seems to be working correctly so far, but for some reason I have a foreach loop that is iterating 84 times before ending. I want to add more code to the loop to move the tile that I am iterating over, but it runs the movement code 84 times and throws it off the world coordinates.
void Update () {
    if (Input.GetMouseButtonDown (0)) {
        var mousePos = Input.mousePosition;
        mousePos.z = 0f;
        mousePos = Camera.main.ScreenToWorldPoint (mousePos);

        clickedX = boardScript.RoundToScale(mousePos.x);
        clickedY = boardScript.RoundToScale(mousePos.y);
    }

    if (Input.GetMouseButtonUp (0)) {
        boardScript.movingLeft = false;
        boardScript.movingRight = false;
        boardScript.movingUp = false;
        boardScript.movingDown = false;
        tempList.Clear ();

        //This is the foreach loop that is iterating 84 times
        foreach (TileInfo tile in tileInfo) {
            if (tile.tileLocation.y == clickedY) {
                Vector3 clickedLocation = tile.tileObject.transform.position;
                Debug.Log ("we landed at: " + clickedLocation.x + ", " + clickedLocation.y);
            }
        }

        return;
    }

    if (Input.GetMouseButton (0)) {
        if (Input.GetMouseButtonUp (0)) {
            return;
        }
        float mouseMoveX = Input.GetAxis ("Mouse X");
        float mouseMoveY = Input.GetAxis ("Mouse Y");

        if (mouseMoveX < 0) {
            boardScript.movingLeft = true;
            boardScript.movingRight = false;
        }

        if (mouseMoveX > 0) {
            boardScript.movingLeft = false;
            boardScript.movingRight = true;
        }

        foreach (TileInfo tile in tileInfo) {
            if (tile.tileLocation.y == clickedY) {
                tile.tileObject.transform.Translate (mouseMoveX, 0, 0);
            }
        }
    }
}

If you need any other sections of code or anything else let me know, I'm new at this and still learning.
Edit: clarified the question I was asking.
Edit2: added a link to the debug log that I have in the loop to show exactly what is happening.

A: You are calling your foreach in Update and this not work only 1 time, this work each frame. But 84 times is a very high number for this.
You can use a single flag to control and only run 1 time.
    doLoop = true;

    if (doLoop)
    {
     doLoop = false;
     //my loop script
    }

A: I figured out the issue, so I had this script attached to every single tile object in the game. So everything in the script would run 84 times since there were 84 tiles being created.
Thanks for the the help all!

redpajama_set_name: RedPajamaStackExchange