This document contains the allometric uncertainty analysis performed on the Vector Capacity Model in the Murdock et al. 2017 paper.

We calculate uncertainty regarding the allometric equation from Lounibos et al. 2002.

loun <- read.csv("../data/Lounibos2002Data.csv", header=F)
names(loun) <- c("wingLength", "eggs")
wingreg <- lm(loun$eggs~loun$wingLength)
wingreg
## 
## Call:
## lm(formula = loun$eggs ~ loun$wingLength)
## 
## Coefficients:
##     (Intercept)  loun$wingLength  
##         -126.38            80.13
ret <- rmvnorm(10000,mean=wingreg$coefficients,sigma=vcov(wingreg)) 
colnames(ret)<-c('beta0','beta1')
courtney <- read.csv("../data/courtneysParams.csv")
for (i in 1:999){
  #create new temporary parameter dataframe
  paramsTemp <- courtney
  #set new seed
  set.seed(8675309-i)
  #sample allometric b0 and b1
  ind <- sample.int(10000,1)
  B0 <- ret[ind,1]
  B1 <- ret[ind,2]
  #calculate fecundity and EFD
  paramsTemp$fecundity <- B0 + (B1*paramsTemp$WL)
  paramsTemp$EFD <- paramsTemp$fecundity/(paramsTemp$GC*2)
  paramsTemp$M <- paramsTemp$EFD*paramsTemp$pEA*paramsTemp$MDR/(paramsTemp$u^2)
  if (!exists("paramsCourt")) {
    paramsCourt <- paramsTemp
  } else  paramsCourt <- rbind(paramsCourt, paramsTemp)
}
paramsVCcourt <- paramsCourt %>%
    group_by(Block, Class, Site_ID) %>%
    mutate(VC=(M*a^2*b*c*(exp(-u*EIP))/u)) %>%
    summarise(VCmean=mean(VC, na.rm=T), minVC=min(VC, na.rm=T), maxVC=max(VC, na.rm=T)) %>%
    ungroup()

knitr::kable(paramsVCcourt)
Block Class Site_ID VCmean minVC maxVC
1 R 2 175583.278 160520.6394 191406.231
1 R 6 214873.716 194156.6094 237142.976
1 R 9 232811.434 211425.3091 255323.869
1 S 3 135337.674 123028.4882 148291.327
1 S 5 155960.398 141876.9297 170778.065
1 S 8 170017.802 154688.3689 186145.651
1 U 1 151830.274 139147.2812 165142.147
1 U 4 208397.620 189614.6068 228158.708
1 U 7 96875.742 88391.2080 105794.305
2 R 2 21019.076 18595.4923 23925.357
2 R 6 25645.993 22512.2749 29413.687
2 R 9 17789.474 15601.8652 20420.385
2 S 3 25435.399 22699.6868 28704.990
2 S 5 9629.432 8509.1677 10973.371
2 S 8 1007.864 889.1857 1150.317
2 U 1 39208.829 34965.5383 44281.767
2 U 4 66960.373 59181.2701 76292.064
2 U 7 52274.020 46854.3782 58701.509