GMACRO note note Überdeckungswahrscheinlichkeiten der note Vertrauensgrenzen bei der Binomialverteilung note note Fuer theta_l(k-1) < theta < theta_l(k) gilt: note Prob(theta_l < theta) = Pr{Bi(n,theta) <= k-1} note Fuer theta_r(k-1) < theta < theta_r(k) gilt: note Prob(theta < theta_r = Pr{Bi(n,theta) >= k} note note Eingabedaten note c1: k = 0,1,...,n note c2: theta_l(k), k=0,1,...,n note c3: theta_r(k), k=0,1,...,n note c4: Werte von theta, für welche die note Überdeckungswahrscheinlichkeiten zu berechnen sind name c1 'k-Werte' name c2 'theta_l' name c3 'theta_r' info note Sind die Eingabewerte in Ordnung (Y/N)? yesno k10 if k10=0 exit endif name k1 'n' name k2 'k' name k3 'i' name k4 'theta_i' name c4 'theta' name c5 'Pr{theta_l < theta}' name c6 'Pr{theta < theta_r}' let k1 = count(c1)-1 # k1 = n let k5=count(c4) # k5 = Anzahl der theta-Werte set c5 # c5 vorbesetzen mit 1 (1 : 1 / 1)k5 end. set c6 # c6 vorbesetzen mit 1 (1 : 1 / 1)k5 end. name k9 'kplus1' # Überdeckungswahrscheinlichkeiten zur linken Vertrauensgrenze let 'k' = 1 let 'kplus1' = 'k'+1 DO 'i' = 1 : k5 let 'theta_i'=c4('i') if 'theta_i' > 'theta_l'('kplus1') let 'k' = 'k'+1 let 'kplus1' = 'k'+1 endif if 'k' > 'n' break endif let k7 = 'k'-1 CDF k7 k8; # Pr{Bi(n,theta) < k} Binomial 'n' 'theta_i'. let c5('i')= k8 # Pr{theta_l < theta} ENDDO # Überdeckungswahrscheinlichkeiten zur rechten Vertrauensgrenze let 'k' = 'n'-1 let 'kplus1' = 'k'+1 DO k6 = 1 : k5 let 'i' = k5-k6+1 # Rückwärts-Rekursion let 'theta_i'=c4('i') if 'theta_i' < 'theta_r'('kplus1') let 'k'='k'-1 let 'kplus1'='k'+1 endif if 'k' < 0 break endif CDF 'k' k8; # Pr{Bi(n,theta) <= k} Binomial 'n' 'theta_i'. let c6('i')= 1-k8 # Pr{theta_l < theta} ENDDO endmacro