daily_cost_fun {optistock} | R Documentation |
Compute the instantaneous cost of raising hatchery fish
Description
This is a multivariable function of both time and number of recruits raised. Cost-per-time and cost-per-recruit can be calculated as a quadratic where the slope and exponent can be specified.
Usage
daily_cost_fun(
time,
recruits,
daily_cost,
time_slope = 0,
time_exp = 1,
rec_slope = 1,
rec_exp = 1,
type = "multiplicative"
)
Arguments
time |
The time at which fish are raised in hatchery |
recruits |
The number of recruits raised |
daily_cost |
Baseline daily cost to raise a single fish |
time_slope |
The slope term on the amount of time (see details) |
time_exp |
The exponent on the amount of time |
rec_slope |
The slope term on the number of recruits |
rec_exp |
The exponent on the number of recruits |
type |
Either multiply the number of recruits times the cost-at-time or add to it (see Details). |
Details
The cost-per-fish based on time and number of recruits uses the function:
C = sTtα * s2Rβ + bif type = "multiplicative". Otherwise it uses:
C = sTtα + s2Rβ + bif type = "additive"
where C = the cost to rear R number of recruits at time T, the s values are the slopes, α and β, are the exponents on time (T) and recruits (R), respectively, and b is the intercept. The instantaneous cost is really what is of interest, and the number of recruits essentially adjusts the intercept on that dimension of the equation.
Increasing the exponent will dramatically increase the cost of raising
hatchery fish as time goes on. Increasing the exponent dramatically
increases the cost of raising a greater number of fish. Integrating this
equation across time will compute the total cost to raise the number of
recruits
to time T. Use the total_daily_cost
function to
do this automatically.
Value
A numeric value representing the cost of rearing the number of
recruits
at a given time and given the number of recruits raised
Examples
# compute the instantaneous cost of raising 1000 fish on day 100
daily_cost_fun(time = 100, recruits = 1000, daily_cost = 0.05,
time_slope = 0, time_exp = 1,
rec_slope = 0.01, rec_exp = 1)
# plot a curve of instantaneous cost against time
curve(daily_cost_fun(x, 1000, 0.05, 0.01, 1.2, 0.05, 1), 0, 1000,
xlab = "Time", ylab = "$")
## Not run:
# 3d plot of costs by time and recruit
emdbook::curve3d(daily_cost_fun(x, y, 0.05, 0.01, 1.2, 0.05, 1),
from = c(0, 0),
to = c(1000, 1000),
xlab = "Time", ylab = "Recruits",
zlab = "$", sys3d = "wireframe")
## End(Not run)