salbeke / rKIN

Estimate Niche space using Kernel Density Estimates
4 stars 0 forks source link

Shape Area Calculation #26

Open joanmoreaux opened 4 months ago

joanmoreaux commented 4 months ago

Sorry if this is a dumb question, but I am not sure to understand how to the shape area is calculated... I ran the rodent example with Standard Ellipse Area (SEA) in rKIN and in SIBER and I get very different answers. Am I miss understanding what the ShapeArea actually is?

Thanks for your help!

Using rKIN:

data("rodents")
head(rodents)
test.elp<- estEllipse(data=rodents, x="Ave_C", y="Ave_N", group="Species", levels=c(95))

elp.area<- getArea(test.elp)
elp.area

Generates:

   Method    Group ConfInt ShapeArea
1 Ellipse Species1      95  45.10501
2 Ellipse Species2      95  14.00697

Using SIBER:

SIBER_rodents <- rodents %>% 
  rename("iso1" = "Ave_C", "iso2" = "Ave_N") %>% 
  mutate(group = NA, community = 1)

SIBER_rodents$group <- ifelse(SIBER_rodents$Species == "Species1", 1, 
                              ifelse(SIBER_rodents$Species == "Species2", 2,NA))

SIBER_rodents <- SIBER_rodents %>% 
  select(-c(Species, Habitat))

SIBER_rodents_obj <- createSiberObject(SIBER_rodents)

group.ML <- groupMetricsML(SIBER_rodents_obj) 
group.ML

Generates:

           1.1       1.2
TA   49.805000 22.060000
SEA   7.533267  2.339391
SEAc  7.559981  2.348978
joanmoreaux commented 4 months ago

Hello, I finally understood why the areas were so different: SIBER ellipses are based on the maximum likelyhood estimates of the bivariate data, which can range from 40-100% credible intervals, whereas the Shape Area of this package uses pre-defined credible intervals set by the user. So please disregard this question :)