Learn R Programming

capn (version 2.0.0)

vsim: Simulation of Value Function Approximation

Description

Simulates the value function and shadow (accounting) prices using the Chebyshev polynomial approximation obtained from vaprox, vaprox.pindyck, and vaprox.pjump.

Usage

vsim(vcoeff, stock, wval = NULL)

Value

A list containing simulation results. Individual elements can be accessed using results$item or results[["item"]].

shadowp

Matrix of shadow (accounting) prices for each stock.

iweach

Inclusive wealth contribution of each stock (multi-stock case).

iw

Inclusive wealth.

vfun

Approximated value function.

stock

Stock values used in the simulation.

wval

Welfare values if wval is provided.

model.type

Either "deterministic" or "stochastic".

Arguments

vcoeff

An approximation object returned by the vaprox function.

stock

A numeric vector, matrix, or data.frame containing stock values \(\mathbf{S}\) at which the value function and shadow prices are evaluated.

wval

(Optional; used by plotgen) A vector or array of instantaneous welfare values \(W(\mathbf{S})\).

Details

Let \(\hat{\boldsymbol{\beta}}\) denote the vector of approximation coefficients obtained from vaprox. For stock vector \(s\), the estimated shadow (accounting) price of stock is given by $$ \hat{p}(s) = \frac{\partial {\Phi (s)}}{\partial s} \hat{\beta}, $$ where \(\Phi(s)\) denotes the Chebyshev polynomial basis.

The approximated value function is $$ \hat{V}(s) = \Phi (s) \hat{\beta}. $$

Inclusive wealth is computed as the inner product of shadow prices and stock levels.

For further theoretical details, see Abbott, Fenichel, and Yun (2026), Fenichel and Abbott (2014), and Yun et al. (2017).

References

Abbott, Joshua K., Eli P. Fenichel, and Seong D. Yun. (2026). Risky (Natural) Assets: Stochasticity, Nonconvexity, and the Value of Natural Capital. Journal of the Association of Environmental and Resource Economists, 13(5), 1269-1309. tools:::Rd_expr_doi("10.1086/741689")

Fenichel, Eli P. and Joshua K. Abbott. (2014). Natural Capital: From Metaphor to Measurement. Journal of the Association of Environmental Economists, 1(1/2), 1--27. tools:::Rd_expr_doi("10.1086/676034")

Yun, Seong D., Barbara Hutniczak, Joshua K. Abbott, and Eli P. Fenichel. (2017). Ecosystem-Based Management and the Wealth of Ecosystems. Proceedings of the National Academy of Sciences, 114(25), 6539--6544. tools:::Rd_expr_doi("10.1073/pnas.1617666114")

See Also

AFY aproxdef, GOM, LV, plotgen, vaprox, vaprox.pindyck, vaprox.pjump, vaprox.split

Examples

Run this code
# 1-D Deterministic: Reef-fish example (Fenichel and Abbott, 2014)
data("GOM")

param <- GOM$param
simData <- GOM$simData

Aspace <- aproxdef(param$order, param$lowerK, param$upperK, param$delta)

vC <- vaprox(
  Aspace,
  simData$stock,
  simData$sdot,
  simData$profit
)

GOMSimV <- vsim(vC,
                simData$stock,
                simData$profit)

# plot shadow (accounting) price: Figure 4 in Fenichel and Abbott (2014)
plotgen(GOMSimV, xlabel="Stock size, s", ylabel="Shadow price")

## 1-D Stochastic: Pindyck (1984) extension (Abbott et al., 2026)
data("AFY")

Aspace <- aproxdef(35, 0.2, 1.4, 0.05)

## deterministic
vCd <- vaprox(
  Aspace,
  AFY$simData$stock,
  AFY$simData$mus.d,
  AFY$simData$profit.d
)

simVd <- vsim(vCd,AFY$simData$stock)

# plot value function
plotgen(simVd,ftype="vw",xlabel="Stock Size", ylabel="Value Function")

# plot shadow (accounting) prices
plotgen(simVd,ftype="p",xlabel="Stock Size", ylabel="Shadow Price")

## stochastic
vCs <- vaprox(
  Aspace,
  AFY$simData$stock,
  AFY$simData$mus.s,
  AFY$simData$profit.s,
  AFY$simData$sigs
)

simVs <- vsim(vCs,AFY$simData$stock)

# plot value function
plotgen(simVs,ftype="vw",xlabel="Stock Size", ylabel="Value Function")

# plot shadow (accounting) prices
plotgen(simVs,ftype="p",xlabel="Stock Size", ylabel="Shadow Price")

Run the code above in your browser using DataLab