predict_hatchday: predict_hatchday

Description Usage Arguments Value Examples

Description

predict_hatchday

Usage

1
predict_hatchday(fm, dat = Breeding(), ci = 0.95, days_below_lwr = 1.5)

Arguments

fm

fitted model (eg. by predict_hatchday_model () )

dat

newdat for prediction

ci

lower CI

days_below_lwr

Value

lower CI of the prediction - days_below_lwr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  
d = Breeding() 
fm = predict_hatchday_model(d)
d[, predHatch := predict_hatchday(fm, d,0.95, 1.5) ]
# check prediction     
d[, missed := difftime(hatchDate, predHatch, units= 'days') %>% as.numeric]
d[, .N/nrow(d), by = missed < -1]

# check incubation duration
d[, incub := difftime(hatchDate, as.Date(firstEgg) + clutch, units= 'days')]
d[, range(incub)]
d[, quantile(incub)]     

# check predicted incubation duration
d[, pincub := difftime(predHatch, as.Date(firstEgg) + clutch, units= 'days')]
d[, range(pincub)]
d[, quantile(pincub)]
plot(incub ~ pincub, d)

mpio-be/bib2 documentation built on Dec. 12, 2021, 10:48 p.m.