def pdf_mvsk(mvsk):
 N = len(mvsk)
 if (N < 4):
  raise ValueError('Four moments must be given to approximate the pdf.')
 (mu, mc2, skew, kurt) = mvsk
 totp = poly1d(1)
 sig = sqrt(mc2)
 if (N > 2):
  Dvals = _hermnorm((N + 1))
  C3 = (skew / 6.0)
  C4 = (kurt / 24.0)
  totp = ((totp - (C3 * Dvals[3])) + (C4 * Dvals[4]))
 def pdffunc(x):
  xn = ((x - mu) / sig)
  return (((totp(xn) * np.exp((((- xn) * xn) / 2.0))) / np.sqrt((2 * np.pi))) / sig)
 return pdffunc

def pdf_mvsk ( mvsk ) : N = len ( mvsk ) if ( N < 4 ) : raise ValueError ( 'Four moments must be given to approximate the pdf.' ) ( mu , mc2 , skew , kurt ) = mvsk totp = poly1d ( 1 ) sig = sqrt ( mc2 ) if ( N > 2 ) : Dvals = _hermnorm ( ( N + 1 ) ) C3 = ( skew / 6.0 ) C4 = ( kurt / 24.0 ) totp = ( ( totp - ( C3 * Dvals [ 3 ] ) ) + ( C4 * Dvals [ 4 ] ) ) def pdffunc ( x ) : xn = ( ( x - mu ) / sig ) return ( ( ( totp ( xn ) * np . exp ( ( ( ( - xn ) * xn ) / 2.0 ) ) ) / np . sqrt ( ( 2 * np . pi ) ) ) / sig ) return pdffunc
return the gaussian expanded pdf function given the list of 1st .