salmon_bif_run: Calculate and plot bifurcation diagram for Larkin model

View source: R/salmon_bif.R

salmon_bif_runR Documentation

Calculate and plot bifurcation diagram for Larkin model

Description

Defaults give great looking bifurcation diagram (need to work out what they reduce the model to). Bifurcation diagram calculated by simple simulation.

Usage

salmon_bif_run(
  alpha_vec = seq(0.01, 30, by = 0.01),
  p_prime = c(0, 1, 0),
  T = 1000,
  col = "black",
  new_plot = TRUE,
  ...
)

Arguments

alpha_vec

Vector of alpha values to use.

p_prime

Vector of typical proportion of recruits spawned in a year that will come back to freshwater as age-3, age-4 and age-5, for input into salmon_sim().

T

Number of years to run the simulation. May need longer to see full structure.

col

Colour of plotted points (can be "red" etc., or 1:6).

new_plot

Start a new plot or not.

...

Further inputs for salmon_bif().

Value

(invisible) matrix of final R_t values as columns, with each column corresponding to a value of alpha.

Examples

## Not run: 
  # beautiful bifurcation diagram (at least as of commit 346039fd8, things
  #  may change if defaults change) :
  salmon_bif_run(alpha_vec = seq(0.01, 40, by = 0.01), beta = c(0.8, 0, 0,
    0), T = 1000, col = 1:6)
  salmon_bif_run(alpha_vec = seq(0.01, 40, by = 0.01), beta = c(0.8, 0, 0,
    0), T = 100, col = 1:6)  # quicker, contains some nice transients
  salmon_bif_run()           # the mixing up of density dependence smears
                             #   the plot a litte

  salmon_bif_run(T=100, col=1:6)   # squid plot, contains transients
  salmon_bif_run(col=1:6)   # squid plot, but blurry than one above (!?)

  alpha_vec <- seq(1.231, 1.27, by = 0.001)
  x <- salmon_bif_run(alpha_vec = seq(1.231, 1.27, by = 0.001), T = 10000)
  tail(x[,17:23])            # shows bifurcation at 1.25

  salmon_bif_run(beta = c(0.8, 0, 0, 0), p_prime=c(1, 0, 0))
  abline(v=exp(2)/0.8)     # Should reduce to simple Ricker model with
  harvesting, with analytically calculation bifurcation point at
  the vertical line alpha = exp(2)/(1-h).

  salmon_bif_run(p_prime = c(0.1, 0.8, 0.1), T = 10000)  # shows some
    structure, bifurcation point has moved to the right
  salmon_bif_run(alpha_vec = seq(25, 27, by = 0.001), p_prime = c(0.1, 0.8,
    0.1), T = 10000)   # Blow up an interesting region

## End(Not run)

andrew-edwards/EDMsimulate documentation built on Oct. 25, 2023, 2:43 p.m.