Standard deviation for a half-normal distribution I have a vector of numbers which is generated from a normal distribution with standard deviation $\sigma$ and $\mu = 0$. When I'm turning these numbers into absolute values, I suppose that the they will follow half-normal distribution with the same standard deviation.
My question is, if I initially start at having a vector of absolute values which generated from half-normal distribution, would it be mathematically sound to add the negative values of these numbers and then find the combined standard deviation between absolute values and negative values to recreate the normal distribution?

With data $x_1, x_2, \ldots, x_n,$ you propose synthesizing a dataset of $2n$ values $|x_1|, -|x_1|, |x_2|, -|x_2|, \ldots, |x_n|, -|x_n|.$  Because each absolute value $|x_i|$ balances its negative $-|x_i|,$ the mean is zero. The usual standard deviation estimator therefore reduces to the square root of
$$\frac{1}{2n-1}\left((|x_1|-0)^2 + (-|x_1|-0)^2 + \cdots + (-|x_n|-0)^2\right) = \frac{1}{n-1/2}\sum_{i=1}^n x_i^2.$$
As we will see, this needs a slight modification to work well.

One way to derive an answer uses the method of maximum likelihood.  One definition of the half-normal distribution with standard deviation $\sigma$ is that the probability density of any value $x\ge 0$ is proportional to $\exp(-(x/\sigma)^2/2) / \sigma.$  (Notice how extremely close that is to the definition of a Normal distribution: the only difference is the restriction $x\ge 0.$)
Thus, given a dataset of (absolute) values $\mathbf{x}=x_1, x_2, \ldots, x_n$ drawn independently from such a distribution, the log likelihood takes the form
$$\Lambda(\sigma, \mathbf{x}) = C(n) -\sum_{i=1}^n \left(\log\sigma + \frac{1}{2}\left(\frac{x_i}{\sigma}\right)^2\right)$$
which attains its maximum either as $\sigma\to0,$ as $\sigma\to\infty,$ or where the derivative of $\Lambda$ is zero; that is, at the solutions to
$$0 =\frac{\mathbf{d}}{\mathbf{d}\sigma}\Lambda(\sigma,\mathbf x) = -\frac{n}{\sigma} + \frac{1}{\sigma^3}\sum_{i=1}^n x_i^2.$$
You can check that (unless all the $x_i$ are equal) the values at $0$ and $\infty$ are not solutions.  (When all the $x_i$ are equal, the unique maximum occurs as $\hat\sigma\to0.$) The resulting estimate is

$$\hat\sigma^2 = \frac{1}{n}\sum_{i=1}^n x_i^2.$$

The maximum likelihood estimate of $\hat\sigma$ will be the square root of this quantity.
Now suppose, as you propose, we were to replace the data $(x_i)$ with a dataset twice this size by introducing the negatives of the $x_i.$  This has the following obvious effects:

*

*The count doubles from $n$ to $2n.$


*The mean of the new data is $0.$
Therefore the standard deviation of the new data is
$$s^2 = \frac{1}{2n}\left(\sum_{i=1}^n (x_i-0)^2 + \sum_{i=1}^n (-x_i-0)^2\right) = \frac{1}{2n}\sum_{i=1}^n 2x_i^2 = \hat\sigma^2$$
provided we compute it using a denominator of $2n$ rather than a denominator of $2n-1$ as I sketched at the outset.    With this small modification, your procedure is identical to the maximum likelihood estimate.
It is worthwhile to inquire what properties this estimator has.  The property usually invoked to justify using $n-1$ in the denominator is that $\hat \sigma^2$ be an unbiased estimator of the variance.  Let us therefore compute that expectation:
$$E[\hat\sigma^2] = E\left[\frac{1}{n}\sum_{i=1}^n x_i^2\right] = \frac{1}{n}\sum_{i=1}^n E\left[x_i^2\right] = \frac{1}{n}\sum_{i=1}^n \sigma^2 = \sigma^2.$$
$\hat \sigma^2$ is an unbiased estimator of the variance.
This reinforces the growing sense that your estimator is a good one.  Moreover, you may now exploit all the additional properties of maximum likelihood estimation to develop confidence intervals for $\sigma,$ etc.  Be careful, though, not to make the mistake of using $2n$ for the dataset size!  You have only $n$ data values and the uncertainties in your estimates and predictions need to reflect that number rather than being based on the larger $2n.$
