2008년 05월 13일
Inverse Gaussian transform
//Inverse cumulative Gaussian transform.
// This routine takes a proportion p and returns the corresponding
// x-value of a cumulative Gaussian of zero mean and unit standard deviation.
// Odeh, R. E. & Evans, J. O. (1974) Algorithm AS 70: Percentage points
// of the normal distribution. Applied Statistics, 23, 96-97. Described in
// Kennedy, W. J. & Gentle, J. E. (1980) Statistical Computing, New York:
// Dekker, pp. 95-96.
double Random::NormalRandom(float avr, float deviation)
{
const double p0 = -0.322232431088;
const double p1 = -1;
const double p2 = -0.342242088547;
const double p3 = -0.0204231210245;
const double p4 = -0.0000453642210148;
const double q0 = 0.099348462606;
const double q1 = 0.588581570495;
const double q2 = 0.531103462366;
const double q3 = 0.10353775285;
const double q4 = 0.0038560700634;
double y, x, p, R = Random.NextFloat(0.0f, 1.0f);
p = R > 0.5 ? 1.0 - R : R;
y = sqrt (-log (p * p));
x = y + ((((y * p4 + p3) * y + p2) * y + p1) * y + p0) / ((((y * q4 + q3) * y + q2) * y + q1) * y + q0);
if (R < 0.5) x = -x;
return deviation * x + avr;
}
==============================
함수 내용 자체는, 정규 분포를 가지는 랜덤 함수라고는 알겠는데...
이게 어떻게 이렇게 되는지 설명좀 해주실 수 있는분?
... 이라고 해도 OTL

# by | 2008/05/13 20:38 | 트랙백 | 덧글(3)





☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
랜덤프로세스과정이 머리 터지더군요 OTL