I hereby claim:
- I am oliviergimenez on github.
- I am oliviergimenez (https://keybase.io/oliviergimenez) on keybase.
- I have a public key ASB-o-5D4dk5Z6DU4-8VoO-wp5QG9xYe5qDlKeahp3FveAo
To claim this, I am signing this object:
# we seek to test whether two parameters, say theta1 and theta2, are diff from each other, using a z-test | |
# we assume we have an estimate of the thetaj's (mle1 and mle2) and associated standard errors (se1 and se2) | |
# we write a function that calculate the z-statistic and return the p-value (both-sided test) | |
# function | |
ztest <- function(mle1, mle2, se1, se2){ | |
stat <- (mle1 - mle2)/sqrt(se1^2+se2^2) | |
pvalue <- ifelse(stat > 0, 2 * pnorm(stat, lower.tail = FALSE), 2 * pnorm(stat, lower.tail = TRUE)) | |
return(data.frame("z-score" = stat, "p-value" = pvalue)) | |
} |
# Cook, J. D., D. M. Williams, W. F. Porter, and S. A. Christensen. 2022. | |
# Improved predictions and forecasts of chronic wasting disease occurrence | |
# using multiple mechanism dynamic occupancy modelling. | |
# Journal of Wildlife Management. | |
# Simulation and multi-mechanism dynamic occupancy model code | |
#load necessary libraries | |
library(raster) | |
library(mvtnorm) |
# from Cole Monnahan https://github.com/colemonnahan/fcwhales | |
convert_to_df <- function(fit, name = NULL){ | |
fit <- as.mcmc(fit) | |
post <- data.frame(do.call(rbind, fit)) | |
new <- gsub('[.]$', '', names(post)) | |
new <- gsub('[.]','_', new) | |
names(post) <- new | |
if(!is.null(name)) post$model <- name | |
return(post) | |
} |
##--- Finite-mixture capture-recapture models | |
##--- O. Gimenez & D. Turek, December 2019 & October 2020 | |
##--- Check out our paper | |
##--- Turek, D., C. Wehrhahn, Gimenez O. (2021). Bayesian Non-Parametric Detection Heterogeneity in Ecological Models. | |
##--- Environmental and Ecological Statistics 28: 355-381. | |
##--- PDF available here: https://arxiv.org/abs/2007.10163 | |
##--- More on heterogeneity in capture-recapture models in | |
##--- https://onlinelibrary.wiley.com/doi/abs/10.1111/oik.04532 |
# we get same AIC when fitting Rota model with no interaction | |
# vs fitting MacKenzie model to species separatately | |
library(unmarked) | |
library(mipfp) | |
?occuMulti | |
# simulate 2 species data | |
# https://github.com/oliviergimenez/2speciesoccupancy |
I hereby claim:
To claim this, I am signing this object:
# some R code to mimic animated gifs created by Etienne Jacob | |
# @etiennejcb | |
# https://bleuje.github.io/tutorials/ | |
## load required packages | |
library(tidyverse) | |
theme_set(theme_void(base_size = 14)) | |
library(gganimate) | |
##-- first tutorial https://bleuje.github.io/tutorial1/ |
# https://zhuhao.org/post/tips-on-designing-a-hex-sticker-for-rstats-packages/ | |
# https://github.com/GuangchuangYu/hexSticker/ | |
library(tidyverse) | |
library(hexSticker) | |
library(png) | |
library(grid) | |
theme_set(theme_minimal()) | |
df <- 4 |
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: |
library(tidyverse) | |
library(sf) | |
library(ggthemes) | |
#import des données spatiales | |
ContoursCommunes<-st_read("https://github.com/Valexandre/france-geojson/raw/master/communes.geojson")%>%st_transform(crs = 2154) | |
arr<-st_read("https://raw.githubusercontent.com/Valexandre/france-geojson/master/arrondissements-millesimes0.geojson")%>%st_transform(crs=2154) | |
DepsMetro<-st_read("https://raw.githubusercontent.com/Valexandre/france-geojson/master/departements.geojson")%>% | |
filter(nchar(code)==2)%>% |