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
0583032d
Commit
0583032d
authored
3 years ago
by
thierrychambert
Browse files
Options
Downloads
Patches
Plain Diff
Further improvements on calibration scaling !
parent
471a5405
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/calibrate_params.R
+15
-4
15 additions, 4 deletions
R/calibrate_params.R
with
15 additions
and
4 deletions
R/calibrate_params.R
+
15
−
4
View file @
0583032d
...
...
@@ -99,11 +99,20 @@ init_calib <- function(s, f, lam0){
nac
=
length
(
s
)
# Define s_init and f_init
s_init
<-
head
(
vr1
,
nac
)
f_init
<-
tail
(
vr1
,
nac
)
# Apply correction to respect relative order of survivals and fecundities
s_init
<-
apply
(
cbind
(
s_init
,
s_init
*
(
s
/
s
[
1
])
/
(
s_init
/
s_init
[
1
])),
1
,
max
,
na.rm
=
TRUE
)
f_init
<-
f_init
*
(
f
/
max
(
f
[
f
!=
0
]))
/
(
f_init
/
max
(
f_init
[
f_init
!=
0
]))
f_init
[
is.nan
(
f_init
)]
<-
0
# Calibrate survivals
s_init
<-
(
(
head
(
vr1
,
nac
))
%>%
sapply
(
.
,
max
,
0.05
))
%>%
sapply
(
.
,
min
,
0.97
)
s_init
<-
(
s_init
%>%
sapply
(
.
,
max
,
0.05
))
%>%
sapply
(
.
,
min
,
0.97
)
# Calibrate fecundities
f_init
<-
(
tail
(
vr1
,
nac
))
%>%
sapply
(
.
,
max
,
0.001
)
f_init
<-
f_init
%>%
sapply
(
.
,
max
,
0.001
)
f_init
[
f
==
0
]
<-
0
# Combine vital rates
...
...
@@ -150,10 +159,12 @@ match_lam_delta <- function(diff_rel_lam, s, f){
# Extract sensitivities and elasticities (for each vital rate)
S
<-
el
$
sens_elas
$
sensitivity
names
(
S
)
<-
el
$
vr_names
E
<-
el
$
sens_elas
$
elasticity
names
(
S
)
<-
names
(
E
)
<-
el
$
vr_names
# Scale the DELTA for each vital rate based on sensitivities
scaling
<-
(
sum
(
S
)
-
S
)
#scaling <- (sum(S)-S)
scaling
<-
(
max
(
E
[
E
!=
0
])
/
E
)
scaling
[
el
$
vital_rates
==
0
]
<-
0
scaling
...
...
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