summaryrefslogtreecommitdiffstats
path: root/src/lossdistrib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lossdistrib.c')
-rw-r--r--src/lossdistrib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lossdistrib.c b/src/lossdistrib.c
index e472a44..6e43a36 100644
--- a/src/lossdistrib.c
+++ b/src/lossdistrib.c
@@ -394,7 +394,11 @@ void recovdist(const double *dp, const double *pp, const int *n, const double *w
double shockprob(double p, double rho, double Z, int give_log){
if(rho == 1.) {
- return((double)(Z<=qnorm(p, 0, 1, 1, 0)));
+ if( give_log ) {
+ abort();
+ } else {
+ return (double)(Z <= qnorm(p, 0, 1, 1, 0));
+ }
} else if (rho == 0.) {
return p;
} else {
@@ -425,6 +429,8 @@ double shockseverity(double S, double Z, double rho, double p){
return 0;
} else if (rho == 0.) {
return S;
+ } else if (rho == 1.) {
+ return Z <= qnorm(S * p, 0, 1, 1, 0) ? 1. : 0.;
} else {
return( exp(shockprob(S * p, rho, Z, 1) - shockprob(p, rho, Z, 1)) );
}