Skip to content
Snippets Groups Projects
Commit f66008e4 authored by Margarete Walden's avatar Margarete Walden
Browse files

Upload New File: sim_variables

parent 41880c7d
No related branches found
No related tags found
No related merge requests found
####
####----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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment