Fit Random Encounter Model (REM)
mm_fit_rem.Rd
Fits a random encounter model using observed data and trap rate information. Automatically estimates detection radius, detection angle, animal speed, and activity pattern models if not provided.
Usage
mm_fit_rem(
data,
traprate_data,
radius_model = NULL,
angle_model = NULL,
speed_model = NULL,
activity_model = NULL,
strata = NULL,
time_of_day,
n_bootstrap = 1000
)
Arguments
- data
A data frame of observations, including distance, angle, speed, and time-of-day (in radians).
- traprate_data
A data frame created by
mm_traprate_data()
.- radius_model
Optional. A detection function model for radius (distance) fitted using
mm_fit_detmodel()
.- angle_model
Optional. A detection function model for angle fitted using
mm_fit_detmodel()
.- speed_model
Optional. A model for movement speed fitted using
mm_fit_speedmodel()
.- activity_model
Optional. An activity model fitted with
activity::fitact()
.- strata
Optional. A data frame of stratification information with columns
stratumID
andarea
.- time_of_day
The column name (unquoted or as a string) representing time-of-day in radians.
- n_bootstrap
Number of bootstrap replicates for uncertainty estimation. Default is 1000.
Value
A data frame with columns:
parameters
: Model parameter nameestimate
: Estimated valuese
: Standard errorcv
: Coefficient of variationlower_ci
: Lower bound of 95% confidence intervalupper_ci
: Upper bound of 95% confidence interval
Examples
data("camtrapdp")
deployments <- camtrapdp$data$deployments
observations <- camtrapdp$data$observations %>%
dplyr::filter(scientificName == "Vulpes vulpes") %>%
# Add time of day
dplyr::mutate(time_of_day = mm_to_radian(times = timestamp))
# Prepare trap rate data
trap_rate <- mm_traprate_data(observation_data = observations,
deployment_data = deployments,
deployment_column = deploymentID,
datetime_column = timestamp,
start = start, end = 'end'
)
# Fit REM
mm_fit_rem(data = observations,
traprate_data = trap_rate,
time_of_day = time_of_day)
#> ℹ Fitting radius model
#> ✔ Fitting radius model ... done
#>
#> ℹ Fitting angle model
#> ✔ Fitting angle model ... done
#>
#> ℹ Fitting speed model
#> ✔ Fitting speed model ... done
#>
#> ℹ Fitting activity model
#> ✔ Fitting activity model ... done
#>
#> ℹ Calculating density
#> ✔ Calculating density ... done
#>
#>
#> # A tibble: 7 × 8
#> parameters estimate se cv lower_ci upper_ci n unit
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <chr>
#> 1 radius 4.18 0.886 0.212 2.44 5.91 4 m
#> 2 angle 44.4 11.3 0.254 0.39 1.16 5 degree
#> 3 active_speed 3.08 0.765 0.248 0.439 1.27 4 km/hour
#> 4 activity_level 0.243 0.076 0.311 0.095 0.391 15 none
#> 5 overall_speed 17.9 7.15 0.398 0.046 0.37 NA km/day
#> 6 trap_rate 0.441 0.117 0.266 0.239 0.635 3 n/day
#> 7 density 6.66 3.52 0.529 2.52 17.6 NA n/km2