I am trying to understand the behavior of this equation with regards to changes in mu and sigma. Would you be able to help me find the min/max of these functions and how it changes (maybe do the derivatives?)
Of course! This is an excellent equation to analyze. It represents the Mean Absolute Error (MAE) when your forecast is a single value, A, and the true outcome Fi is a random variable drawn from a normal distribution with mean μ and standard deviation σ, i.e., Fi∼N(μ,σ2).
Let's break down its behavior with respect to μ and σ.
Executive Summary
Behavior wrt. μ (the "Bias"):
The function has a global minimum when μ=A (i.e., when the mean of the process is equal to your forecast, or zero bias).
The value of this minimum error is σ2/π.
Detailed Analysis
Let's simplify the notation to make the math easier. Let:
E(μ,σ)=E[∣Fi−A∣]
be the bias. The equation depends on .
Using this, your equation can be written as:
E=σ⋅2ϕ(σb
A useful identity for the standard normal CDF is 1−Φ(x)=Φ(−x). Using this, the term in the brackets can be simplified:
where is the error function.
So, the equation is equivalent to:
E=σπ2
This form is a bit cleaner for taking derivatives.
1. Behavior with Respect to μ (Holding σ Constant)
To find the min/max with respect to μ, we can take the derivative of E with respect to μ and set it to zero. Note that ∂μ.
Let's take the derivative ∂μ∂E. This is a bit tricky due to the absolute value ∣b∣. Let's consider the case where b (i.e., ) and use the chain rule. The case for will be symmetric.
When b>0, ∣b∣=b.
. So we can find and flip the sign.
E(b,σ)=σπ
∂b
The first and third terms cancel out perfectly!
∂b∂E=erf(
So, ∂μ∂E=−erf(.
Finding the Minimum:
To find the minimum, we set the derivative to zero:
−erf(σ2
The error function is zero only when .
.
This confirms that the error is minimized when the bias is zero.
When μ<A, (A−μ)>0, so . The error decreases as increases towards .
This proves that μ=A is a global minimum.
Value at the Minimum:
Set μ=A (so A−μ=0) in the original equation:
This is the famous formula for the mean absolute deviation of a normal distribution.
2. Behavior with Respect to σ (Holding μ Constant)
Now let's see how the error changes as volatility σ changes. We take the derivative of E with respect to σ. Again, let b=A−μ.
E(σ)=σπ
This derivative is a bit more involved, but it simplifies beautifully.
∂σ
Using the product and chain rules:
Part 1:
Part 2:∣b∣[−2ϕ(−
Adding them together:∂σ∂E
Interpreting the Result:
This derivative is remarkably simple! Since the exponential function is always positive, ∂σ∂E is always positive (for σ>0).
This means that the expected absolute error E is strictly and monotonically increasing with respect to σ. There is no minimum or maximum. The more volatile your process is, the higher your expected error will be, no matter what your forecast A is.
Summary Table
Parameter
Min/Max Behavior
Value at Minimum
Derivative
Interpretation
μ
Has a global minimum at μ=A. No maximum.
σ2/π
Visualization
To make this even clearer, here are plots of the behavior. Let's assume your forecast is A=10.
1. Error vs. μ (for different σ)
You can see the U-shaped curves, all with a minimum at μ=10. A higher σ lifts the entire curve up, increasing the error everywhere.
2. Error vs. σ (for different biases)
Here we plot the error against σ for different fixed values of bias, ∣A−μ∣. You can see that every curve is strictly increasing. A larger bias simply starts the curve at a higher initial error (at σ→0, the error is just the bias itself).