Can someone please help me understand why the standard score $(X - \mu)/\sigma$ is a linear transformation since both mean and standard deviation depend on X?
-
1$\begingroup$ They both were computed out of X, since then they don't depend on X, in the formula, they don't depend, just two numbers from somewhere. A nd the formula is a linear transform formula (addition, multiplication). $\endgroup$– ttnphnsCommented Mar 25, 2019 at 8:05
2 Answers
The function $$ Z = \frac{X - \mu}{\sigma} = \frac{1}{\sigma} X - \frac{\mu}{\sigma} $$ is linear ($a = \frac{1}{\sigma}$ and $b=\frac{\mu}{\sigma}$ in the Wikipedia notation). As gunes said, $\mu$ and $\sigma$ are constants (they are a property of the distribution irrespectively of we decide to do some sampling or not).
Note that a linear map (also called linear transformation) is not the same thing.
-
1$\begingroup$ @natt010: You're welcome. By the way, if you think it's appropriate, you can accept my answer (it's a green button). $\endgroup$ Commented Mar 26, 2019 at 11:52
-
$\begingroup$ Hi, i will thanks...I have just one final clarification...we treat $\mu$ and $\sigma$ as constants even though we estimate them from samples, due to the fact that X is sampled from the same distribution right? Now if this is the case...can we say the same for the MinMaxScaler $(X - \min(X))/(\max(X) - \min(X))$ $\endgroup$– natt010Commented Mar 29, 2019 at 10:34
-
1$\begingroup$ It still is a linear function. It's more prone to fluctuations in the data than the $Z$ transformation, unless there are well known bounds on the min and on the max (e.g., the height of a person cannot be negative or we are studying grades in a scale between 1 and 5). $\endgroup$ Commented Mar 29, 2019 at 11:11
Once calculated, $\mu$ and $\sigma$ are just constants. Even if you use sample mean and sample standard deviation, the transform is $aX+b$. It's a linear transform since relative distances remain the same, i.e. $$\frac{d(X_i,X_j)}{d(X_k,X_l)}=\frac{d((X_i-\mu)/\sigma,(X_j-\mu)/\sigma)}{d((X_k-\mu)/\sigma,(X_l-\mu)/\sigma)}$$