Hi every one,
I am writing a function using probit function to convert probabilities to a z_normal values like this:
When I use probabilities that smaller than 1 and greater than 0, Probit works well.
( for this I use this piece of code: z_inv = probit(Cum_TM[2:6,1:6]); )
but when I use probabilities that equal 1 or 0, Probit does not work any more.
( for this I use this piece of code: z_inv = probit(Cum_TM[1:8,1:7]); ) and I got this error:
ERROR: (execution) Invalid argument to function.
count : number of occurrences is 23
operation : PROBIT at line 42 column 17
operands : _TEM1003
I just wonder if you please help me to solve this error.
Thank you very much for your help!
Here is my complete code and data for your reference:
proc import datafile = '/proj/sas/sasdata/risk/discovery/grm/ifrs/au/sme/phase2/OLL/OLL_transition_matrix_1.xlsx'
replace dbms = xlsx out = Calibrated_matrix_OLL;
run;
%let tm_in = Calibrated_matrix_OLL;;
%let z_in = z_25;
%let w =0.06;
%let TM_out = matrix_ca_da_oll_out;
proc iml;
use &TM_in.;
read all var _ALL_ into TM_Input;
close &TM_in.;
TM = TM_Input[,3:10]; *print TM;
Start rowcumsum(x);
Step1 = cusum(x);
Step2 = 0 // Step1[1:nrow(Step1)-1,ncol(Step1)];
Output = Step1 - repeat(Step2,1,ncol(Step1));
return(Output);
Finish rowcumsum;
do i = 1 to 1; *number of quarters;
Pre_cycle_adj = TM[(1+8*(i-1)):(8*i),1:8]; print Pre_cycle_adj;
Cum_TM = rowcumsum(Pre_cycle_adj); print Cum_TM;
z_inv = probit(Cum_TM[1:8,1:7]); print z_inv;
end;
quit;