ToonVanDaele / trias-test

test repository ofr trias
0 stars 0 forks source link

Y variable for modelling occupancy #11

Closed damianooldoni closed 4 years ago

damianooldoni commented 4 years ago

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))

Am I right or are I missing something? Thanks.

ToonVanDaele commented 4 years ago

yes, it should be "ncell" instead of "obs". It's corrected in the code