###PMF Plots rm(list=ls()) PXL=function(par,x){ beta=par[1] (beta*((1+beta)^(-2-x))*(-beta*(1+x)+log(beta)*(1+beta)))/(-1+log(beta)) } par(mfrow=c(2,3), mai = c(0.6, 0.6, 0.4, 0.4)) x = 0:15 plot(x, PXL(c(0.1),x), type="h", lwd=1, col="blue",ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.1 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.1),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.5),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.8),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.8),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.9),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.9 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.9),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.5),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 1.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.8),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 1.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.8),x),pch=16,cex=1,col="red") ############## HRF Plots ############################ rm(list=ls()) PXL=function(par,x){ ###PMF Plots rm(list=ls()) PXL=function(par,x){ beta=par[1] (beta*((1+beta)^(-2-x))*(-beta*(1+x)+log(beta)*(1+beta)))/(-1+log(beta)) } par(mfrow=c(2,3), mai = c(0.6, 0.6, 0.4, 0.4)) x = 0:15 plot(x, PXL(c(0.1),x), type="h", lwd=1, col="blue",ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.1 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.1),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.5),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.8),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.8),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.9),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 0.9 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.9),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.5),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 1.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.8),x), type="h", lwd=1, col="blue", ylab="p(x)",main="") legend("topright",legend=c(expression(paste(beta," = 1.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.8),x),pch=16,cex=1,col="red") ############## HRF Plots ############################ rm(list=ls()) PXL=function(par,x){ beta=par[1] f<- (beta*((1+beta)^(-2-x))*(-beta*(1+x)+log(beta)*(1+beta)))/(-1+log(beta)) S<- 1-(1+(((1+beta)^(-2-x))*(1+beta*(2+x)-log(beta)*(1+beta)))/(-1+log(beta))) hrf<- f/S return(hrf) } par(mfrow=c(2,3), mai = c(0.6, 0.6, 0.4, 0.4)) x = 0:15 plot(x, PXL(c(0.1),x), type="h", lwd=1, col="blue",ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 0.1 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.1),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.5),x), type="h", lwd=1, col="blue", ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 0.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.8),x), type="h", lwd=1, col="blue", ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 0.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.8),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(0.9),x), type="h", lwd=1, col="blue", ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 0.9 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(0.9),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.5),x), type="h", lwd=1, col="blue", ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 1.5 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.5),x),pch=16,cex=1,col="red") x = 0:15 plot(x, PXL(c(1.8),x), type="h", lwd=1, col="blue", ylab="h(x)",main="") legend("topleft",legend=c(expression(paste(beta," = 1.8 "))), lwd=1,cex=1.2,lty=c(1), col=c("blue"),bty="n") points(x, PXL(c(1.8),x),pch=16,cex=1,col="red")