블로그 이미지
생각처럼

카테고리

전체보기 (209)
TOOL (1)
다이어리 (1)
Bit (200)
HELP? (0)
Total
Today
Yesterday

달력

« » 2025.2
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

공지사항

태그목록

최근에 올라온 글

/*Lognormdist = NORMSDIST((LN(x) – mu)/sigma)  eg:- Lognormdist(0.367879441,3,2) will give  0.022750062 with this function and in excel it will give 0.022750132*/

/* Note: Doouble quotes for “en-US” and “F” may not be properly shown while pasting this code.you need to manaully remove the double quotes and add it again*/

   public double Lognormdist( double x, double zeta, double sigma)

  {
  /*Gets a NumberFormatInfo associated with the en-US culture.*/

  System.Globalization.NumberFormatInfo nfi =new System.Globalization.CultureInfo( “en-US”, false ).NumberFormat;nfi.NumberDecimalDigits = 9;

  double u = (Math.Log(x) – zeta)/sigma; double p = this.NormalDistribution(u);

  return Convert.ToDouble(p.ToString(“F”, nfi) );
  }
  private double NormalDistribution(double X)
  {

  /* Gets a NumberFormatInfo associated with the en-US culture.*/
  System.Globalization.NumberFormatInfo nfi =new System.Globalization.CultureInfo( “en-US”, false ).NumberFormat;nfi.NumberDecimalDigits = 9;

  double L = 0.0; double K = 0.0; double dCND = 0.0; const double a1 = 0.31938153; const double a2 = -0.356563782; const double a3 = 1.781477937; const double a4 = -1.821255978; const double a5 = 1.330274429;L = Math.Abs(X);K = 1.0 / (1.0 + 0.2316419 * L);dCND = 1.0 – 1.0 / Math.Sqrt(2 * Convert.ToDouble(Math.PI.ToString())) * Math.Exp(-L * L / 2.0) * (a1 * K + a2 * K * K + a3 * Math.Pow(K, 3.0) + a4 * Math.Pow(K, 4.0) + a5 * Math.Pow (K, 5.0));

  if (X < 0){double ff = Convert.ToDouble(dCND.ToString( “F”, nfi )); return 1.0 – dCND;}

  else{ return dCND;}
  }

Posted by 생각처럼
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함