R/plot_phi_trace.R

Defines functions plot_phi_trace

Documented in plot_phi_trace

plot_phi_trace <-
function(phi,percent.burnin=0,thinning=1,population.names=NULL,pop.index=NULL){
		burnin <- (percent.burnin/100)*length(which(phi!=0))
		x <- seq(from = burnin,to = length(which(phi!=0)),by = thinning)
			Fk <- 1/(1+phi[x])
			if(is.null(population.names)){
				plot(Fk,
					pch=19,
					ylim=c(0,1),
					col=grDevices::adjustcolor(1,alpha.f=0.4),
					main=sprintf("Trace Plot of F parameter, population %s",pop.index),
					xlab="MCMC sampled generations",
					ylab=sprintf("F parameter, population %s",pop.index)
                )
                graphics::abline(h=stats::median(Fk),col="red")	
			}
				if(!is.null(population.names)){
				plot(Fk,
					pch=19,
					ylim=c(0,1),
					col=grDevices::adjustcolor(1,alpha.f=0.4),
					main=paste("Trace Plot of F parameter,",population.names,sep=" "),
					xlab="MCMC sampled generations",
					ylab=paste("F parameter,",population.names,sep=" ")
                )
                graphics::abline(h=stats::median(Fk),col="red")	
			}
	}

Try the BEDASSLE package in your browser

Any scripts or data that you put into this service are public.

BEDASSLE documentation built on April 11, 2022, 1:07 a.m.