Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CHIN_sim
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
Container 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
Margarete Walden
CHIN_sim
Commits
f66008e4
Commit
f66008e4
authored
6 months ago
by
Margarete Walden
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File: sim_variables
parent
41880c7d
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
chin_tune/scripts/sim_variables.R
+73
-0
73 additions, 0 deletions
chin_tune/scripts/sim_variables.R
with
73 additions
and
0 deletions
chin_tune/scripts/sim_variables.R
0 → 100644
+
73
−
0
View file @
f66008e4
####
####----1. ABOUT------------------------------------------------------------####
####
#### Evaluating alternative methods for modeling trap
#### efficiencies of outmigrating juvenile salmonids
####
#### Authors: Walden et al.
####
#### Content: R-Code for sourcing declared variables.
####
#### This is the file for Supplement X of the manuscript.
####
####----2. "True" parameter values for simulated data-----------------------####
## Covariates
Qmin
<-
500
# discharge
Qmax
<-
7000
# discharge
degCmin
<-
6
# temperature
degCmax
<-
21
# temperature
effortmin
<-
720
# effort
effortmax
<-
3840
# effort
precipitation
<-
0
# precipitation (yes/no) (nuisance)
nyear
<-
10
# groups (random effects)
## Set parameter values
Beta0_maxpt1
<-
-3.2
# Trap efficiency max 0.10
Beta0_maxpt25
<-
-2.1
# Trap efficiency max 0.25
Beta1
<-
-0.3
# discharge
Beta2
<-
0.2
# temperature
Beta3
<-
0.2
# effort
Beta4
<-
0.0
# precipitation yes/no
Beta5
<-
-0.4
# effort^2
Beta6
<-
0.4
# discharge x temperature interaction
raneffSD
<-
0.1
# year effect standard deviation
phiTrue
<-
0.0002
####----3. Simulation variables---------------------------------------------####
# vector of sample sizes to test
nset
<-
c
(
50
,
100
,
150
,
200
)
# vector of trap efficiencies to test
theseefficiencies
<-
c
(
"Max efficiency 0.1"
,
"Max efficiency 0.25"
)
# Number of simulations to complete
nsim
<-
1000
# size of test dataset
ntest
<-
100
####----4. Model parameters, hyperparameters, or variables------------------####
## For boosted regression modeling
mutuneiter
<-
2000
phituneiter
<-
2000
nu_hp
=
0.1
fmu_null
<-
as.formula
(
y
~
1
)
fmu
<-
as.formula
(
y
~
1
+
bols
(
discharge
,
intercept
=
FALSE
)
+
bols
(
temperature
,
intercept
=
FALSE
)
+
bols
(
effort
,
intercept
=
FALSE
)
+
bols
(
precip
,
intercept
=
FALSE
)
+
bbs
(
effort
,
knots
=
2
,
boundary.knots
=
NULL
,
degree
=
2
,
df
=
1
,
center
=
TRUE
)
+
bols
(
temperature
,
intercept
=
FALSE
,
df
=
1
)
%X%
bols
(
discharge
,
intercept
=
FALSE
,
df
=
1
)
+
brandom
(
year
)
)
fphi
<-
as.formula
(
y
~
1
)
nboot
<-
100
kfoldB
<-
25
## For random forest modeling
seed.forest
<-
234672817
rftrees
<-
2000
\ No newline at end of file
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