EDIT: It turns out I just made a dumb mistake:


A portion of my "factor" is actually inside the derivative. Thanks to everyone who helped!

I'm using Mathematica to try to solve: https://math.stackexchange.com/questions/1700486

The probability distribution function (PDF) of the maximum of n standard normally distributed variables is:

(2^(1/2 - n)*n*(1 + Erf[x/Sqrt[2]])^(-1 + n))/(E^(x^2/2)*Sqrt[Pi]) 

To find the mode, I take the derivative and set equal to 0. The "raw" derivative is:

(2^(1 - n)*(-1 + n)*n*(1 + Erf[x/Sqrt[2]])^(-2 + n))/(E^x^2*Pi) -  
 (2^(1/2 - n)*n*x*(1 + Erf[x/Sqrt[2]])^(-1 + n))/(E^(x^2/2)*Sqrt[Pi]) 

and Simplify will reduce it to:

-((n*(1 + Erf[x/Sqrt[2]])^(-2 + n)*(2 - 2*n + E^(x^2/2)*Sqrt[2*Pi]*x +  

Since I only need to see when this value is $0$, I can multiply it by anything that's not $0$ (or undefined), in particular:

Exp[x^2] 2^n Pi/n (1 + Erf[x/Sqrt[2]])^(2 - n)

Multiplying the simplified derivative by that quantity yields:

2^n E^x^2 Pi (2^(1 - n)/(E^x^2 Pi) - (2^(1/2 - n) x (1 + Erf[x/Sqrt[2]])) /
 (E^(x^2/2) Sqrt[Pi])) 

Simplifying again, we have:

2 - E^(x^2/2) Sqrt[2 Pi] x - E^(x^2/2) Sqrt[2 Pi] x Erf[x/Sqrt[2]]

The problem? This value no longer depends on $n$.

However, graphing the PDF for various values of $n$ shows that the mode changes:

enter image description here


I wonder if your calculations have gone astray somewhere. I seem to get a different result.

Below pdf is your expression for the PDF you are working with, factor is the non-zero expression by which you want to multiply your derivative:

pdf = (2^(1/2 - n)*n*(1 + Erf[x/Sqrt[2]])^(-1 + n))/(E^(x^2/2)*Sqrt[Pi]);
factor = Exp[x^2]*2^n*Pi/n*(1 + Erf[x/Sqrt[2]])^(2 - n);

Calculating D[pdf, x] // Simplify agrees with your raw and simplified results in the question. However, multiplying by your factor and simplifying did not remove the dependence on n:

D[pdf, x] factor // Simplify

Mathematica graphics

Solve[D[pdf, x] factor == 0, n]

Mathematica graphics

  • $\begingroup$ I was about to write an answer, but I'll leave this comment instead: have a look at FullSimplify[D[PDF[OrderDistribution[{NormalDistribution[], n}, n], x], x]]. $\endgroup$ – J. M.'s torpor Mar 20 '16 at 16:25
  • $\begingroup$ Thanks, @MarcoB! As a minor note, finding the value of n for where the derivative is 0 is quite interesting, but I think I need the solution for x to find the mode :) $\endgroup$ – user1722 Mar 20 '16 at 17:27
  • $\begingroup$ Something like With[{n = 25}, x /. FindRoot[-2 + 2 n + Exp[x^2/2] Sqrt[2 π] x (-2 + Erfc[x/Sqrt[2]]), {x, -Sqrt[2] InverseErfc[2^(1 - 1/n)]}]] then, @barry? $\endgroup$ – J. M.'s torpor Mar 20 '16 at 17:47
  • $\begingroup$ Yes, that's what I had been doing, and was hoping to find a closed form solution, but no luck, alas. github.com/barrycarter/bcapps/blob/master/STACK/bc-prob-max.m for the morbidly curious :) $\endgroup$ – user1722 Mar 20 '16 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy