c****|===|====-====|====-====|====-====|====-====|====-====|====-====|==//////// subroutine emafit(n,ql,qu,tl,tu,reg_skew,reg_mse,pq, 1 sysmoms,wrcmoms,sysyp,wrcyp,ci_low,ci_high) c****|===|====-====|====-====|====-====|====-====|====-====|====-====|==//////// c c This routine fits the Pearson Type III distribution to c a data set using the EMA algorithm c c This was prepared for Aquaterra by Tim Cohn, US Geological Survey c c Timothy A. Cohn 09 November 2003 c c c****|===|====-====|====-====|====-====|====-====|====-====|====-====|==//////// c c input variables: c --------------------------------------------------------------------------- c n i*4 number of observations (censored, uncensored, or other) c ql(n) r*8 vector of lower bounds on (log) floods c qu(n) r*8 vector of upper bounds on (log) floods c tl(n) r*8 vector of lower bounds on (log) flood threshold c tu(n) r*8 vector of upper bounds on (log) flood threshold c reg_skew r*8 regional skew c reg_mse r*8 mean square error of regional skew c pq r*8 quantile to be estimated c --pq=0.99 corresponds to "100-year flood" c c****|===|====-====|====-====|====-====|====-====|====-====|====-====|==//////// c c N.B. There are two distinct concepts here: c a. The observations, which are described by {ql,qu}; c specifically, the true value of q is assumed to lie c wihin the interval ql(i) <= q(i) <= qu(i); c if q(i) is known exactly, then ql(i) = q(i) = qu(i); c c {ql,qu} are required by EMA to fit P3 dist'n to data c c b. The censoring pattern, which is described by {tl,tu} c {tl,tu} define interval on which data get observed: c if q is not inside {tl,tu}, q is either left or right censored. c Examples: c {-inf,+inf} => Systematic data (everything known exactly) c {T, +inf} => Historical data (q>=t known exactly; q