# fit list for detectionfms2<-fitList("p(.) Ocu(.)"=fit_unm_sp2_0,#"p(h) Ocu(.)"=fit_unm_sp2_0h, #,#"p(c) Ocu(.)"=fit_unm_sp2_0c,"p(.) Ocu(elev)"=fit_unm_sp2_1,"p(.) Ocu(AGB_Spawn)"=fit_unm_sp2_2,"p(.) Ocu(roads)"=fit_unm_sp2_3,"p(.) Ocu(carbon)"=fit_unm_sp2_4,"p(.) Ocu(NDVI)"=fit_unm_sp2_5,"p(.) Ocu(canopy)"=fit_unm_sp2_6)# model selection detection unmarkedmodSel(fms2)
# fit list for detectionfms2<-fitList("p(.) Ocu(.)"=fit_unm_sp3_0,#"p(h) Ocu(.)"=fit_unm_sp2_0h, #,#"p(c) Ocu(.)"=fit_unm_sp3_0c,"p(.) Ocu(elev)"=fit_unm_sp3_1,"p(.) Ocu(AGB_Spawn)"=fit_unm_sp3_2,"p(.) Ocu(roads)"=fit_unm_sp3_3,"p(.) Ocu(carbon)"=fit_unm_sp3_4,"p(.) Ocu(NDVI)"=fit_unm_sp3_5,"p(.) Ocu(canopy)"=fit_unm_sp3_6)# model selection detection unmarkedmodSel(fms2)
# fit list for detectionfms2<-fitList("p(.) Ocu(.)"=fit_unm_sp4_0,#"p(h) Ocu(.)"=fit_unm_sp2_0h, #,"p(c) Ocu(.)"=fit_unm_sp4_0c,"p(c) Ocu(elev)"=fit_unm_sp4_1,"p(c) Ocu(AGB_Spawn)"=fit_unm_sp4_2,"p(c) Ocu(roads)"=fit_unm_sp4_3,"p(c) Ocu(carbon)"=fit_unm_sp4_4,"p(c) Ocu(NDVI)"=fit_unm_sp4_5,"p(c) Ocu(canopy)"=fit_unm_sp4_6)# model selection detection unmarkedmodSel(fms2)
# fit list for detectionfms2<-fitList("p(.) Ocu(.)"=fit_unm_sp4_0,#"p(h) Ocu(.)"=fit_unm_sp2_0h, #,"p(c) Ocu(.)"=fit_unm_sp4_0c,"p(c) Ocu(elev)"=fit_unm_sp4_1,"p(c) Ocu(AGB_Spawn)"=fit_unm_sp4_2,"p(c) Ocu(roads)"=fit_unm_sp4_3,"p(c) Ocu(carbon)"=fit_unm_sp4_4,"p(c) Ocu(NDVI)"=fit_unm_sp4_5,"p(c) Ocu(canopy)"=fit_unm_sp4_6)# model selection detection unmarkedmodSel(fms2)
# detectionobsCovs(umf_y_full_1) <-list(hour =matrix(parita$dete[[1]]),canopy = covs_raster_val$canopy ) # hora# Double formula: first part is for detection, second for occupancy# form <- ~detCov1 + detCov2 ~habCov1 + habCov2 + RSR(x, y, threshold=1)# fit unmarkedfit_unm_sp1_0 <- unmarked::occu(~1~1, data=umf_y_full_1) # Model did not converge!fit_unm_sp1_0h <- unmarked::occu(~hour~1, data=umf_y_full_1) # Does work but not comparable!fit_unm_sp1_0c <- unmarked::occu(~scale(canopy)~1, data=umf_y_full_1) # Does work!fit_unm_sp1_1 <- unmarked::occu(~1~scale(elevation), data=umf_y_full_1)fit_unm_sp1_2 <- unmarked::occu(~1~scale(AGB_Spawn), data=umf_y_full_1)fit_unm_sp1_3 <- unmarked::occu(~1~scale(roads), data=umf_y_full_1) # ok!fit_unm_sp1_4 <- unmarked::occu(~1~scale(carbon), data=umf_y_full_1)fit_unm_sp1_5 <- unmarked::occu(~1~scale(NDVI), data=umf_y_full_1)fit_unm_sp1_6 <- unmarked::occu(~1~scale(canopy), data=umf_y_full_1)fit_unm_sp1_2b <- unmarked::occu(~1~scale(AGB_Spawn), data=umf_y_full_1)# fit list for detectionfms1<-fitList("p(.) Ocu(.)"=fit_unm_sp1_0,#"p(h) Ocu(.)"=fit_unm_sp1_0h, # NA problem!"p(c) Ocu(.)"=fit_unm_sp1_0c)#,# "p(.) Ocu(elev)"=fit_unm_sp2_1,# "p(.) Ocu(slope)"=fit_unm_sp2_2,# "p(.) Ocu(aspect)"=fit_unm_sp2_3,# "p(.) Ocu(roughness)"=fit_unm_sp2_4,# "p(elev^2) Ocu(elev^2)"=fit_unm_sp2_5 )# model selection detection unmarkedmodSel(fms1) #bad!.. null model ranks better
# fit list for detectionfms2<-fitList("p(.) Ocu(.)"=fit_unm_sp1_0,#"p(h) Ocu(.)"=fit_unm_sp2_0h, #,"p(c) Ocu(.)"=fit_unm_sp1_0c,"p(.) Ocu(elev)"=fit_unm_sp1_1,"p(.) Ocu(AGB_Spawn)"=fit_unm_sp1_2,"p(.) Ocu(roads)"=fit_unm_sp1_3,"p(.) Ocu(carbon)"=fit_unm_sp1_4,"p(.) Ocu(NDVI)"=fit_unm_sp1_5,"p(.) Ocu(canopy)"=fit_unm_sp1_6)# model selection detection unmarkedmodSel(fms2)