This function returns a set of pseudo-random recruitment deviations based on an iteration number. Given the same iteration number the function will return the same recruitment deviations. The deviations are standard normal. I.e., they have a mean of 0 and a standard deviation of 1.

get_recdevs(iteration, n, seed = 21)

Arguments

iteration

The iteration number. This is used as an ID to set the random number seed.

n

The length of the vector returned.

seed

An integer value to pass to set.seed().

Value

A vector of standard normal recruitment deviations.

Examples

get_recdevs(1, 10)
#>  [1]  0.77405533  0.76850421 -1.08118174 -1.15534044  0.25203746  0.58729727
#>  [7] -0.65686337  0.70580555 -0.04103809 -0.44137493
get_recdevs(1, 10)
#>  [1]  0.77405533  0.76850421 -1.08118174 -1.15534044  0.25203746  0.58729727
#>  [7] -0.65686337  0.70580555 -0.04103809 -0.44137493
get_recdevs(2, 10)
#>  [1] -1.53858010  1.20388304 -0.09972517  1.31356006  0.44687592  0.57283005
#>  [7] -1.12086404 -0.02526612  0.95191761 -0.38421376