11-15-2020, 08:11 AM
Hi everybody,
I wrote a little program that computes the mean EZ and standard deviation SZ of the ratio of two normal distributed variables X and Y with means X1 and Y1, correlation R and standard deviations 1.
The program is like this:
EXPORT RATIO()
BEGIN
LOCAL X1,Y1,R,FL,EZ,SZ,X,Y;
INPUT(X1,"MUE1=?");
INPUT(Y1,"MUE2=?");
INPUT(R,"CORR=?");
∫(√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶FL;
∫(Y*√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶EZ;
EZ/FL▶EZ;
∫(Y^2*√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶SZ;
√(SZ/FL-EZ^2)▶SZ;
PRINT("--------------------------------");
PRINT("MUE1=" +X1);
PRINT("MUE2=" +Y1);
PRINT("CORR=" +R);
PRINT("FL=" +FL);
PRINT("EZ=" +EZ);
PRINT("SZ=" +SZ);
END;
It works both on HP prime G1 and G2 as expected. If I run it on the prime pro app for windows (Build 2.1.14527 (2020 6 24)) it let me put in X1, Y1 (both 4.), R (0.5), then it seems to compute and then the app is closed without any error message. I made a debug stepwise. It happens in the first line with an integral directly after the input of R.
Does anybody know what to do about this?
Thank you very much and best regards
Raimund
I wrote a little program that computes the mean EZ and standard deviation SZ of the ratio of two normal distributed variables X and Y with means X1 and Y1, correlation R and standard deviations 1.
The program is like this:
EXPORT RATIO()
BEGIN
LOCAL X1,Y1,R,FL,EZ,SZ,X,Y;
INPUT(X1,"MUE1=?");
INPUT(Y1,"MUE2=?");
INPUT(R,"CORR=?");
∫(√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶FL;
∫(Y*√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶EZ;
EZ/FL▶EZ;
∫(Y^2*√((1+Y^2)/(1+R^2))/2/π*∫(e^(−((X-X1)^2+(Y*X-Y1)^2-2*R*(X-X1)*(Y*X-Y1))/(2*(1-R^2))),X,X1-6,X1+6),Y,Y1-6,Y1+6)▶SZ;
√(SZ/FL-EZ^2)▶SZ;
PRINT("--------------------------------");
PRINT("MUE1=" +X1);
PRINT("MUE2=" +Y1);
PRINT("CORR=" +R);
PRINT("FL=" +FL);
PRINT("EZ=" +EZ);
PRINT("SZ=" +SZ);
END;
It works both on HP prime G1 and G2 as expected. If I run it on the prime pro app for windows (Build 2.1.14527 (2020 6 24)) it let me put in X1, Y1 (both 4.), R (0.5), then it seems to compute and then the app is closed without any error message. I made a debug stepwise. It happens in the first line with an integral directly after the input of R.
Does anybody know what to do about this?
Thank you very much and best regards
Raimund