Following your workflow in main_FULL.R, I see you analyze occupancy by applying GAM in lines 85-86. You do by means of two functions, spGAM_lpa_cobs and spGAM_lpa.
So, reading formula used in spGAM_lpa_cobs and spGAM_lpa, I see the following (lines 118-119 in 5c_method_GAM_short.R):
fm <- formula(obs ~ s(year, k = maxk, m = 3, bs = "tp"))
if (method_em == "GAM_lpa_cobs") fm <- update(fm, ~. + s(cobs))
Should the y-variable be ncell instead of obs? Otherwise I don't see where these formulas differ from the formulas used to model observations (lines 28-29):
fm <- formula(obs ~ s(year, k = maxk, m = 3, bs = "tp"))
if (method_em == "GAM_lcount_cobs") fm <- update(fm, ~. + s(cobs))
Following your workflow in
main_FULL.R
, I see you analyze occupancy by applying GAM in lines 85-86. You do by means of two functions,spGAM_lpa_cobs
andspGAM_lpa
.So, reading formula used in
spGAM_lpa_cobs
andspGAM_lpa
, I see the following (lines 118-119 in5c_method_GAM_short.R
):Should the y-variable be
ncell
instead ofobs
? Otherwise I don't see where these formulas differ from the formulas used to model observations (lines 28-29):Am I right or are I missing something? Thanks.