I need some help. I try to run the code below, but at the end I1 = 0, I2 = 0 (the same as their initial values). I'm not sure which part of my code is wrong.
Q = 1415; μ = 1000; σ = 500;
double dx;
double x;
double fx;
double fxplusdx;
double I1;
double I2;
I1 = 0;
I2 = 0;
For[x = 0, x <= Q - dx, dx += 0.01,
fx =
PDF[NormalDistribution[0, 1], (InverseCDF[NormalDistribution[μ, σ], x] - μ)/σ];
fxplusdx =
PDF[NormalDistribution[0, 1], (InverseCDF[NormalDistribution[μ, σ], x + dx] - μ)/σ];
I1 = I1 + 0.5*(x*fx + (x + dx)*fxplusdx)*dx;
I2 = I2 + 0.5*(fx + fxplusdx)*dx]
I1
I2