test=matrix(scan("Leesferry-mon-data.txt"), ncol=13, byrow=T) sepflow = test[,9]*0.0004690502 x=sepflow library(Rlab) ncls = round(log(95,2)+1) # create the grid.. N=250 lbound = 0 #lowerbound xx1=seq(max(lbound,min(x)-sd(x)),max(x)+sd(x),length=N) #histogram and overlay PDF hplot(sepflow,nclass=ncls,probability=T,xlim=range(xx1),xlab="Sep flow",ylab="PDF") lines(xx1,dlnorm(xx1,meanlog=mean(log(x)), sdlog=sd(log(x))), col="red") source("qgaus.r") source("integrand-lnormal.r") N1=N-1 zz=1:N1 for(i in 2:N){ x1=xx1[i-1] x2=xx1[i] zz[i-1]=qgaus(x1,x2,x)} zz=cumsum(zz) plot(xx1[1:N1],zz,type="l",xlab="Sep flow", ylab="CDF")