Skip to content

kenkellner/Unmarked.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unmarked.jl

Build Status codecov

Unofficial Julia port of the R package unmarked, for analyzing ecological data while accounting for imperfect detection.

using Unmarked, DataFrames

#Simulate an occupancy dataset
ψ_formula = @formula~elev+forest);
p_formula = @formula(p~precip+wind);
β_truth = [0, -0.5, 1.2, -0.2, 0, 0.7];
umd = simulate(Occu, ψ_formula, p_formula, (1000, 5), β_truth);

#Fit the model
fit = occu(ψ_formula, p_formula, umd)

#Compare with true coefficient values
hcat(coef(fit), β_truth)

#Plot results
effectsplot(fit)

#Predict occupancy probabilities from DataFrame
newdata = DataFrame(elev=[0.5, -0.3], forest=[1,-1]);
predict(occupancy(fit), newdata)

#Goodness-of-fit
gof(fit)

#Fit all subsets of model covariates and compare with AIC
occu(allsub(ψ_formula), allsub(p_formula), umd)

Releases

No releases published

Packages

No packages published

Languages