r - Improving on a visual fitting process for fecundity data -
i can find little information out there on subject, wish fit pearson curves fecundity data. data , solution below lifted book (applied demography biologists, carey 1993). wish automate process using maximum likelihood, apply goodness of fit tests. purely visual/ trial , error exercise fitting curve data. i've not had success pearsonds package or other methods such fitdist.
#par(mar=c(5,5,3,4),cex=1.2) ###taken carey 1993,egg/fem/day egg=c(0,0,0,2.32,17.82,36.34,80.77,68.49,75.00,82.12,75.16,65.20,56.04,43.28,53.52,49.50,27.85,37.62,28.53,30.34,29.57,48.17,27.25,25.37,28.66,13.00,17.13,8,12.70,10.25,4) ##vector days,x d=seq(from=0,to=length(med)-1) ###parameters pearson function a1=.55 a2=34 m1=1.46 m2=3 ##the pearson function y=2.8 peari=function(pearson) { y*((1+d/a1)^m1)*((1-d/a2)^m2) } pr2=(peari(egg)) ## plot(egg,main=expression(bold( paste("pearson type function fitted ", m[x]))), xlab="age (days)",ylab="eggs/fem", pch=16,cex.lab=1.4) #lines(egg,col="red") lines(pr2,type="b",col="blue",pch=16, cex=1.3)
Comments
Post a Comment