Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Impact démographique des collisions aviaires avec les éoliennes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CEFE
Interactions Humains-Animaux
Impact démographique des collisions aviaires avec les éoliennes
Commits
3e583d67
Commit
3e583d67
authored
3 years ago
by
thierrychambert
Browse files
Options
Downloads
Patches
Plain Diff
run_simul : new version of DD (balancing theta and rMAX)
parent
1687577b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
R/run_simul.R
+1
-6
1 addition, 6 deletions
R/run_simul.R
R/run_simul_shiny.R
+22
-8
22 additions, 8 deletions
R/run_simul_shiny.R
run_analysis.R
+1
-1
1 addition, 1 deletion
run_analysis.R
with
24 additions
and
15 deletions
R/run_simul.R
+
1
−
6
View file @
3e583d67
...
@@ -188,12 +188,7 @@ model_demo = NULL
...
@@ -188,12 +188,7 @@ model_demo = NULL
# GROWING population...
# GROWING population...
if
(
lam_it
[
sim
]
>
1
){
if
(
lam_it
[
sim
]
>
1
){
# Calculate rMAX (and theta if needed)
# Extract rMAX
new_rMAX
<-
infer_rMAX
(
K
=
K
,
theta
=
theta
,
new_rMAX
<-
infer_rMAX
(
K
=
K
,
theta
=
theta
,
pop_size_current
=
sum
(
N0
),
pop_growth_current
=
lam_it
[
sim
],
pop_size_current
=
sum
(
N0
),
pop_growth_current
=
lam_it
[
sim
],
rMAX_theoretical
=
Inf
)
rMAX_theoretical
=
Inf
)
...
...
This diff is collapsed.
Click to expand it.
R/run_simul_shiny.R
+
22
−
8
View file @
3e583d67
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
#' It can thus be expressed as the total population or the number of pair.
#' It can thus be expressed as the total population or the number of pair.
#' @param carrying_capacity_se Standard Error for the carrying capacity.
#' @param carrying_capacity_se Standard Error for the carrying capacity.
#'
#'
#' @param theta a strictly positive number. Parameter defining the shape of the density-dependence relationship.
#' @param theta NOT implemented.
#' a strictly positive number. Parameter defining the shape of the density-dependence relationship.
#' The relationship is defined as : r <- rMAX*(1-(N/K)^theta)
#' The relationship is defined as : r <- rMAX*(1-(N/K)^theta)
#' Note lambda = r + 1
#' Note lambda = r + 1
#'
#'
...
@@ -59,7 +60,7 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
...
@@ -59,7 +60,7 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
pop_growth_mean
,
pop_growth_se
,
pop_growth_mean
,
pop_growth_se
,
survivals
,
fecundities
,
survivals
,
fecundities
,
carrying_capacity_mean
,
carrying_capacity_se
,
carrying_capacity_mean
,
carrying_capacity_se
,
theta
=
1
,
rMAX_species
,
theta
=
NULL
,
rMAX_species
,
model_demo
=
NULL
,
time_horizon
,
coeff_var_environ
,
fatal_constant
){
model_demo
=
NULL
,
time_horizon
,
coeff_var_environ
,
fatal_constant
){
...
@@ -68,8 +69,8 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
...
@@ -68,8 +69,8 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
# Fill the list of DD parameters
# Fill the list of DD parameters
DD_params
$
K
<-
NULL
DD_params
$
K
<-
NULL
DD_params
$
theta
<-
theta
DD_params
$
theta
<-
NULL
DD_params
$
rMAX
<-
rMAX_species
DD_params
$
rMAX
<-
NULL
# Number of years
# Number of years
nyr
<-
time_horizon
nyr
<-
time_horizon
...
@@ -163,10 +164,23 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
...
@@ -163,10 +164,23 @@ run_simul_shiny <- function(nsim, cumulated_impacts,
# GROWING population...
# GROWING population...
if
(
lam_it
[
sim
]
>
1
){
if
(
lam_it
[
sim
]
>
1
){
# Extract rMAX
# Calculate rMAX (and theta if needed)
DD_params
$
rMAX
<-
infer_rMAX
(
K
=
K
,
theta
=
theta
,
new_rMAX
<-
infer_rMAX
(
K
=
K
,
theta
=
theta
,
pop_size_current
=
sum
(
N0
),
pop_growth_current
=
lam_it
[
sim
],
pop_size_current
=
sum
(
N0
),
pop_growth_current
=
lam_it
[
sim
],
rMAX_theoretical
=
rMAX_species
)
rMAX_theoretical
=
Inf
)
if
(
new_rMAX
<=
rMAX_species
){
DD_params
$
rMAX
<-
new_rMAX
}
else
{
# Infer theta
DD_params
$
rMAX
<-
rMAX_species
DD_params
$
theta
<-
infer_theta
(
K
=
K
,
pop_size_current
=
sum
(
N0
),
pop_growth_current
=
lam_it
[
sim
],
rMAX
=
rMAX_species
)
}
# ... and initially LARGE population
# ... and initially LARGE population
if
(
sum
(
N0
)
>
500
)
model_demo
<-
M3_WithDD_noDemoStoch
if
(
sum
(
N0
)
>
500
)
model_demo
<-
M3_WithDD_noDemoStoch
...
...
This diff is collapsed.
Click to expand it.
run_analysis.R
+
1
−
1
View file @
3e583d67
...
@@ -9,7 +9,7 @@ library(eolpop)
...
@@ -9,7 +9,7 @@ library(eolpop)
## Inputs
## Inputs
nsim
=
3
nsim
=
3
pop_size_mean
=
30
000
pop_size_mean
=
12
000
pop_size_se
=
0
pop_size_se
=
0
pop_size_type
=
"Ntotal"
pop_size_type
=
"Ntotal"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment