Title: | Capital Asset Pricing for Nature |
---|---|
Description: | Implements approximation methods for natural capital asset prices suggested by Fenichel and Abbott (2014) <doi:10.1086/676034> in Journal of the Associations of Environmental and Resource Economists (JAERE), Fenichel et al. (2016) <doi:10.1073/pnas.1513779113> in Proceedings of the National Academy of Sciences (PNAS), and Yun et al. (2017) in PNAS (accepted), and their extensions: creating Chebyshev polynomial nodes and grids, calculating basis of Chebyshev polynomials, approximation and their simulations for: V-approximation (single and multiple stocks, PNAS), P-approximation (single stock, PNAS), and Pdot-approximation (single stock, JAERE). Development of this package was generously supported by the Knobloch Family Foundation. |
Authors: | Seong Do Yun [aut, cre], Eli P. Fenichel [aut, ctb], Joshua K. Abbott [aut, ctb] |
Maintainer: | Seong Do Yun <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2024-11-17 06:33:59 UTC |
Source: | CRAN |
The function defines an approximation space for all three approximation apporoaches (V, P, and Pdot).
aproxdef(deg, lb, ub, delta)
aproxdef(deg, lb, ub, delta)
deg |
An array of degrees of approximation function: degrees of Chebyshev polynomials |
lb |
An array of lower bounds |
ub |
An array of upper bounds |
delta |
discount rate |
For the -th dimension of
, suppose a polynomial approximant
over a bounded interval
is defined by Chebysev nodes. Then, a
-dimensional
Chebyshev grids can be defined as:
.
Suppose we impletement numbers of polynomials (i.e.,
-th order) for the
-th dimension.
The approximation space is defined as:
deg = c(),
lb = c(), and
ub = c().
delta
is the given constant discount rate.
A list containing the approximation space
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.
vaprox, vsim, paprox, psim, pdotaprox, pdotsim
## Reef-fish example: see Fenichel and Abbott (2014) delta <- 0.02 upper <- 359016000 # upper bound on approximation space lower <- 5*10^6 # lower bound on approximation space myspace <- aproxdef(50,lower,upper,delta) ## Two dimensional example ub <- c(1.5,1.5) lb <- c(0.1,0.1) deg <- c(20,20) delta <- 0.03 myspace <- aproxdef(deg,lb,ub,delta)
## Reef-fish example: see Fenichel and Abbott (2014) delta <- 0.02 upper <- 359016000 # upper bound on approximation space lower <- 5*10^6 # lower bound on approximation space myspace <- aproxdef(50,lower,upper,delta) ## Two dimensional example ub <- c(1.5,1.5) lb <- c(0.1,0.1) deg <- c(20,20) delta <- 0.03 myspace <- aproxdef(deg,lb,ub,delta)
The function calulates the catchment in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
catch(s,Z)
catch(s,Z)
s |
stock |
Z |
parameter vector |
This catch function is adopted in GOM
dataset.
Quantity of catchment
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.
The function calculates the monomial basis of Chebyshev polynomials for the given unidimensional nodes,
, over a bounded interval [a,b].
chebbasisgen(stock, npol, a, b, dorder = NULL)
chebbasisgen(stock, npol, a, b, dorder = NULL)
stock |
An array of Chebyshev polynomial nodes |
npol |
Number of polynomials (n polynomials = (n-1)-th degree) |
a |
The lower bound of inverval [a,b] |
b |
The upper bound of inverval [a,b] |
dorder |
Degree of partial derivative of the basis; Default is NULL; if dorder = 1, returns the first order partial derivative |
Suppose there are numbers of Chebyshev nodes over a bounded interval [a,b]:
for
.
These nodes can be nomralized to the standard Chebyshev nodes over the domain [-1,1]:.
With normalized Chebyshev nodes, the recurrence relations of Chebyshev polynomials of order is defined as:
,
, and
.
The interpolation matrix (Vandermonde matrix) of (n-1)-th Chebyshev polynomials with nodes,
is:
.
The partial derivative of the monomial basis matrix can be found by the relation:.
The technical details of the monomial basis of Chebyshev polynomial can be referred from Amparo et al. (2007)
and Miranda and Fackler (2012).
A matrix (number of nodes () x npol (
)) of (monomial) Chebyshev polynomial basis
Amparo, Gil, Javier Segura, and Nico Temme. (2007) Numerical Methods for Special Functions. Cambridge: Cambridge University Press.
Miranda, Mario J. and Paul L. Fackler. (2002) Applied Computational Economics and Finance. Cambridge: The MIT Press.
## Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) ## An example of Chebyshev polynomial basis chebbasisgen(nodes,20,0.1,1.5) ## The partial derivative of Chebyshev polynomial basis with the same function chebbasisgen(nodes,20,0.1,1.5,1)
## Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) ## An example of Chebyshev polynomial basis chebbasisgen(nodes,20,0.1,1.5) ## The partial derivative of Chebyshev polynomial basis with the same function chebbasisgen(nodes,20,0.1,1.5,1)
This function generates a grid of multi-dimensional Chebyshev nodes.
chebgrids(nnodes, lb, ub, rtype = NULL)
chebgrids(nnodes, lb, ub, rtype = NULL)
nnodes |
An array of numbers of nodes |
lb |
An array of lower bounds |
ub |
An array of upper bounds |
rtype |
A type of results; default is NULL that returns a list class; if rtype = list, returns a list class; if rtype = grid, returns a matrix class. |
For the -th dimension of
, suppose a polynomial approximant
over a bounded interval
is defined by Chebysev nodes. Then, a
-dimensional
Chebyshev grids can be defined as:
.
This is all combinations of . Two types of results are provided. '
rtype = list
' provides a list
of dimensions wherease '
rtype = grids
' creates a matrix.
A list with elements of Chebyshev nodes or a
matrix of Chebyshev grids
## Chebyshev grids with two-dimension chebgrids(c(5,3), c(1,1), c(2,3)) # Returns the same results chebgrids(c(5,3), c(1,1), c(2,3), rtype='list') ## Returns a matrix grids with the same domain chebgrids(c(5,3), c(1,1), c(2,3), rtype='grid') ## Chebyshev grids with one-dimension chebgrids(5,1,2) chebnodegen(5,1,2) ## Chebyshev grids with three stock chebgrids(c(3,4,5),c(1,1,1),c(2,3,4),rtype='grid')
## Chebyshev grids with two-dimension chebgrids(c(5,3), c(1,1), c(2,3)) # Returns the same results chebgrids(c(5,3), c(1,1), c(2,3), rtype='list') ## Returns a matrix grids with the same domain chebgrids(c(5,3), c(1,1), c(2,3), rtype='grid') ## Chebyshev grids with one-dimension chebgrids(5,1,2) chebnodegen(5,1,2) ## Chebyshev grids with three stock chebgrids(c(3,4,5),c(1,1,1),c(2,3,4),rtype='grid')
The function generates uni-dimensional chebyshev nodes.
chebnodegen(n, a, b)
chebnodegen(n, a, b)
n |
A number of nodes |
a |
The lower bound of inverval [a,b] |
b |
The upper bound of interval [a,b] |
A polynomial approximant over a bounded interval [a,b] is constructed by:
for
.
More detail explanation can be refered from Miranda and Fackler (2002, p.119).
An array n Chebyshev nodes
Miranda, Mario J. and Paul L. Fackler. (2002) Applied Computational Economics and Finance. Cambridge: The MIT Press.
## 10 Chebyshev nodes in [-1,1] chebnodegen(10,-1,1) ## 5 Chebyshev nodes in [1,5] chebnodegen(5,1,5)
## 10 Chebyshev nodes in [-1,1] chebnodegen(10,-1,1) ## 5 Chebyshev nodes in [1,5] chebnodegen(5,1,5)
dsdotds
evaluated in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
dsdotds(s,Z)
dsdotds(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
The first derivative of sdot with respect to s
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.
dsdotdss
evaluated in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
dsdotdss(s,Z)
dsdotdss(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
The second derivative of sdot with respect to s
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.
dwds
evaluated in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
dwds(s,Z)
dwds(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
The first derivative of w with respect to s
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.
dwdss
evaluated in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
dwdss(s,Z)
dwdss(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
The second derivative of w with respect to s
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.
The function calulates the catchment effort in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
effort(s,Z)
effort(s,Z)
s |
stock |
Z |
parameter vector |
This effort function is adopted in GOM
dataset.
catchment effort values
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.
The GOM
provides data to replicate the Gulf of Mexico Reef Fish example in Fenichel and Abbott (2014).
This dataset is consisted of parameters and functions.From Fenichel and Abboott(2014),
catch effort: ,
harvest: ,
profit: , and
sdot: .
The parameters in detal are in below.
## Load dataset data("GOM") ## Demonstration of example # demo(GOM, package="capn") ## R-script location # system.file("demo", "GOM.R", package = "capn")
## Load dataset data("GOM") ## Demonstration of example # demo(GOM, package="capn") ## R-script location # system.file("demo", "GOM.R", package = "capn")
param: a data.frame of parameters
r
intrinsic growth rate (=0.3847)
k
carrying capacity (=359016000)
q
catchability coefficient (=0.00031729344157311126)
price
price (=2.70)
cost
cost (=153.0)
alpha
technology parameter (=0.5436459179063678)
gamma
pre-ITQ management parameter (=0.7882)
y
system equivalence parameter (=0.15745573410462155)
delta
discount rate (=0.02)
order
Chebyshev polynomial order (=50)
upperK
upper bound of Chebyshev polynomial nodes (=k)
lowerK
lower bound of Chebyshev polynomial nodes (=5*10^6)
nodes
the number of Chebyshev polynomial nodes (=50)
functions: functions for generate simulation data for each nodes
effort
effort function
catch
catch function
profit
profit function (w in Fenichel and Abbott (2014))
sdot
evaluated
dsdotds
evaluated
dsdotdss
evaluated
dwds
evaluated
dwdss
evaluated
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.
The LV
provides the data and functions to simulate prey-predator (Lotka-Volterra) model. The original code was written by Joshua Abbott in MATLAB and Seong Do Yun adapted it to a package example. The prey-predator model is:
Prey ():
, and
Predator ():
.
The parameters are given as:: intrinsic growth rate for prey,
: carrying capacity for prey,
: predator-related mortality parameter for prey,
: predator/prey uptake parameter for predator,
: natural mortality for predator,
: slope for linear predator harvest control rule, and
: slope for linear prey harvest control rule
The predator with no economic value (unharvested) is designed for the economic program as:.
The paramters are:: price per unit harvest of predator,
: price per unit harvest of prey,
: cost /per unit of prey effort in Schaefer model (really c/q with q=1), and
: cost per unit of predator effort in Schaefer model (really c/q with q=1).
## Load dataset data("lvdata") ## Demonstration of example # demo(LV, package="capn") ## R-script location # system.file("demo", "LV.R", package = "capn")
## Load dataset data("lvdata") ## Demonstration of example # demo(LV, package="capn") ## R-script location # system.file("demo", "LV.R", package = "capn")
lvaproxdata: a data.frame for approximation (evaluated on (20 x 20) Chebyshev nodes)
xs
prey stock
ys
predator stock
xdot
evaluated xdot
ydot
evaluated ydot
wval
profit (W in Fenichel and Abtott (2014))
lvsimdata.time: a data for time simulation (101 ODE solution)
tseq
time sequence from 0 to 100
xs
prey stock
ys
predator stock
The lvaproxdata
provides the data in LV
dataset to simulate prey-predator (Lotka-Volterra) model. The original code was written by Joshua Abbott in MATLAB and Seong Do Yun adapted it to a package example. The prey-predator model is:
Prey ():
, and
Predator ():
.
The parameters are given as:: intrinsic growth rate for prey,
: carrying capacity for prey,
: predator-related mortality parameter for prey,
: predator/prey uptake parameter for predator,
: natural mortality for predator,
: slope for linear predator harvest control rule, and
: slope for linear prey harvest control rule
The predator with no economic value (unharvested) is designed for the economic program as:.
The paramters are:: price per unit harvest of predator,
: price per unit harvest of prey,
: cost /per unit of prey effort in Schaefer model (really c/q with q=1), and
: cost per unit of predator effort in Schaefer model (really c/q with q=1).
## Load dataset data("lvdata")
## Load dataset data("lvdata")
lvaproxdata: a data.frame for approximation (evaluated on (20 x 20) Chebyshev nodes)
xs
prey stock
ys
predator stock
xdot
evaluated xdot
ydot
evaluated ydot
wval
profit (W in Fenichel and Abtott (2014))
The lvsimdata.time
provides the time simulation data in LV
dataset to simulate prey-predator (Lotka-Volterra) model. The original code was written by Joshua Abbott in MATLAB and Seong Do Yun adapted it to a package example. The prey-predator model is:
Prey ():
, and
Predator ():
.
The parameters are given as:: intrinsic growth rate for prey,
: carrying capacity for prey,
: predator-related mortality parameter for prey,
: predator/prey uptake parameter for predator,
: natural mortality for predator,
: slope for linear predator harvest control rule, and
: slope for linear prey harvest control rule
The predator with no economic value (unharvested) is designed for the economic program as:.
The paramters are:: price per unit harvest of predator,
: price per unit harvest of prey,
: cost /per unit of prey effort in Schaefer model (really c/q with q=1), and
: cost per unit of predator effort in Schaefer model (really c/q with q=1).
## Load dataset data("lvdata")
## Load dataset data("lvdata")
lvsimdata.time: a data for time simulation (101 ODE solution)
tseq
time sequence from 0 to 100
xs
prey stock
ys
predator stock
The function provides the P-approximation coefficients of the defined Chebyshev polynomials in aproxdef
.
For now, only unidimensional case is developed.
paprox(aproxspace, stock, sdot, dsdotds, dwds)
paprox(aproxspace, stock, sdot, dsdotds, dwds)
aproxspace |
An approximation space defined by |
stock |
An array of stock, |
sdot |
An array of ds/dt, |
dsdotds |
An array of d(sdot)/ds, |
dwds |
An array of dw/ds, |
The P-approximation is finding the shadow price of a stock, from the relation:
,
where ,
,
, and
is the given discount rate.
Consider approximation ,
is Chebyshev polynomials and
is their coeffcients.
Then,
by the orthogonality of Chebyshev basis.
Adopting the properties above, we can get the unknown coefficient vector
from:
, and thus,
.
In a case of over-determined (more nodes than approaximation degrees),
For more detils see Fenichel et al. (2016).
A list of approximation resuts: deg, lb, ub, delta, and coefficients. Use results$item
(or results[["item"]]
) to import each result item.
degree |
degree of Chebyshev polynomial |
lowerB |
lower bound of Chebyshev nodes |
upperB |
upper bound of Chebyshev nodes |
delta |
discount rate |
coefficient |
Chebyshev polynomial coefficients |
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.
Fenichel, Eli P., Joshua K. Abbott, Jude Bayham, Whitney Boone, Erin M. K. Haacker, and Lisa Pfeiffer. (2016) "Measuring the Value of Groundwater and Other Forms of Natural Capital."
Proceedings of the National Academy of Sciences .113:2382-2387.
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4])
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4])
The GOM
provides data to replicate the Gulf of Mexico Reef Fish example in Fenichel and Abbott (2014).
## Load dataset data("GOM")
## Load dataset data("GOM")
param: a data.frame of parameters
r
intrinsic growth rate (=0.3847)
k
carrying capacity (=359016000)
q
catchability coefficient (=0.00031729344157311126)
price
price (=2.70)
cost
cost (=153.0)
alpha
technology parameter (=0.5436459179063678)
gamma
pre-ITQ management parameter (=0.7882)
y
system equivalence parameter (=0.15745573410462155)
delta
discount rate (=0.02)
order
Chebyshev polynomial order (=50)
upperK
upper bound of Chebyshev polynomial nodes (=k)
lowerK
lower bound of Chebyshev polynomial nodes (=5*10^6)
nodes
the number of Chebyshev polynomial nodes (=50)
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.
The function provides the Pdot-approximation coefficients of the defined Chebyshev polynomials in aproxdef
.
For now, only unidimensional case is developed.
pdotaprox(aproxspace, stock, sdot, dsdotds, dsdotdss, dwds, dwdss)
pdotaprox(aproxspace, stock, sdot, dsdotds, dsdotdss, dwds, dwdss)
aproxspace |
An approximation space defined by |
stock |
An array of stock, |
sdot |
An array of ds/dt, |
dsdotds |
An array of d(sdot)/ds, |
dsdotdss |
An array of d/ds(d(sdot)/ds), |
dwds |
An array of dw/ds, |
dwdss |
An array of d/ds(dw/ds), |
The Pdot-approximation is finding the shadow price of a stock, from the relation:
,
where ,
,
, and
is the given discount rate.
In order to operationalize this approach, we take the time derivative of this expression:
Consider approximation ,
is Chebyshev polynomials and
is their coeffcients.
Then,
by the orthogonality of Chebyshev basis.
Adopting the properties above, we can get the unknown coefficient vector
from:
, and
.
If we suppose and
,
then over-determined case can be calculated:
.
For more detils see Fenichel and Abbott (2014).
A list of approximation results: deg, lb, ub, delta, and coefficients. Use results$item
(or results[["item"]]
) to import each result item.
degree |
degree of Chebyshev polynomial |
lowerB |
lower bound of Chebyshev nodes |
upperB |
upper bound of Chebyshev nodes |
delta |
discount rate |
coefficient |
Chebyshev polynomial coefficients |
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.
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataPdot <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dsdotdss(nodes,param), dwds(nodes,param),dwdss(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pdotC <- pdotaprox(Aspace,simuDataPdot[,1],simuDataPdot[,2], simuDataPdot[,3],simuDataPdot[,4], simuDataPdot[,5],simuDataPdot[,6])
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataPdot <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dsdotdss(nodes,param), dwds(nodes,param),dwdss(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pdotC <- pdotaprox(Aspace,simuDataPdot[,1],simuDataPdot[,2], simuDataPdot[,3],simuDataPdot[,4], simuDataPdot[,5],simuDataPdot[,6])
The function provides the Pdot-approximation simulation.
pdotsim(pdotcoeff, stock, sdot, dsdotds, wval, dwds)
pdotsim(pdotcoeff, stock, sdot, dsdotds, wval, dwds)
pdotcoeff |
An approximation result from |
stock |
An array of stock |
sdot |
An array of ds/dt, |
dsdotds |
An array of d(sdot)/ds, |
wval |
An array of |
dwds |
An array of dw/ds, |
Let be the vector of approximation coefficents from the results of
pdotaprox
function.
The estimated shadow price (accounting) price of stock over the given approximation interval of
,
can be calculated as:
.
The estimated value function is:.
For more detils see Fenichel and Abbott (2014) and Fenichel et al. (2016).
A list of approximation resuts: shadow (accounting) prices, inclusive wealth, and value function, stock, and W values. Use results$item
(or results[["item"]]
) to import each result item.
shadowp |
Shadow price |
vfun |
Value function |
stock |
Stock |
wval |
W-value |
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.
Fenichel, Eli P., Joshua K. Abbott, Jude Bayham, Whitney Boone, Erin M. K. Haacker, and Lisa Pfeiffer. (2016) "Measuring the Value of Groundwater and Other Forms of Natural Capital."
Proceedings of the National Academy of Sciences .113:2382-2387.
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataPdot <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dsdotdss(nodes,param), dwds(nodes,param),dwdss(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pdotC <- pdotaprox(Aspace,simuDataPdot[,1],simuDataPdot[,2], simuDataPdot[,3],simuDataPdot[,4], simuDataPdot[,5],simuDataPdot[,6]) GOMSimPdot <- pdotsim(pdotC,simuDataPdot[,1],simuDataPdot[,2],simuDataPdot[,3], profit(nodes,param),simuDataPdot[,5]) # Shadow Price plotgen(GOMSimPdot, xlabel="Stock size, s", ylabel="Shadow price") # Value function and profit plotgen(GOMSimPdot,ftype="vw", xlabel="Stock size, s", ylabel=c("Value Function","Profit"))
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataPdot <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dsdotdss(nodes,param), dwds(nodes,param),dwdss(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pdotC <- pdotaprox(Aspace,simuDataPdot[,1],simuDataPdot[,2], simuDataPdot[,3],simuDataPdot[,4], simuDataPdot[,5],simuDataPdot[,6]) GOMSimPdot <- pdotsim(pdotC,simuDataPdot[,1],simuDataPdot[,2],simuDataPdot[,3], profit(nodes,param),simuDataPdot[,5]) # Shadow Price plotgen(GOMSimPdot, xlabel="Stock size, s", ylabel="Shadow price") # Value function and profit plotgen(GOMSimPdot,ftype="vw", xlabel="Stock size, s", ylabel=c("Value Function","Profit"))
The function draws shadowp or vfun-w plot from the simulation results of vsim
, psim
, or pdotsim
.
plotgen(simres, ftype = NULL, whichs = NULL, tvar = NULL, xlabel = NULL, ylabel = NULL)
plotgen(simres, ftype = NULL, whichs = NULL, tvar = NULL, xlabel = NULL, ylabel = NULL)
simres |
A simulation results from |
ftype |
Plot type (ftype=NULL (default) or ftype="p" for shadow price; ftype="vw" for vfun-w plot) |
whichs |
A pisitive integer for indicating a specific stock for multi-sotck cases (ftype=NULL (default) or 1<= whichs <= the number of stocks) |
tvar |
An array of time variable if simulation result is a time-base simulation |
xlabel |
A character for x-label of a plot (xlabel=NULL (default); "Stock" or "Time") |
ylabel |
An array of characters for y-label of a plot (ylabel=NULL (default); "Shadow Price", "Value Function" or "W-value") |
This function provides an one-dimensional plot for "shadow price-stock", "shadow price-time", "Value function-stock", "Value function-time", "Value function-stock-W value", or "Value function-time-W value" depending on input arguments.
A plot of approximation resuts: shadow (accounting) prices, inclusive wealth, and Value function
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) # p-approximation pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4]) # Without prividing W-value GOMSimP <- psim(pC,simuDataP[,1]) # With W-value GOMSimP2 <- psim(pC,simuDataP[,1],profit(nodes,param),simuDataP[,2]) # Shadow price-Stock plot plotgen(GOMSimP) plotgen(GOMSimP,ftype="p") plotgen(GOMSimP,xlabel="Stock Size, S", ylabel="Shadow Price (USD/Kg)") # Value-Stock-W plot plotgen(GOMSimP2,ftype="vw") plotgen(GOMSimP2,ftype="vw",xlabel="Stock Size, S", ylabel="Value Function") plotgen(GOMSimP2,ftype="vw",xlabel="Stock Size, S", ylabel="Value Function") ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) lvaproxc <- vaprox(lvspace,lvaproxdata) lvsim <- vsim(lvaproxc,lvsimdata.time[,2:3]) # Shadow price-Stock plot plotgen(lvsim) plotgen(lvsim,ftype="p") plotgen(lvsim,whichs=2,xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)") # Shadow price-time plot plotgen(lvsim,whichs=2,tvar=lvsimdata.time[,1]) # Value Function-Stock plot plotgen(lvsim,ftype="vw") plotgen(lvsim,ftype="vw",whichs=2, xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)") # Value Function-time plot plotgen(lvsim,ftype="vw",tvar=lvsimdata.time[,1]) plotgen(lvsim,ftype="vw",whichs=2,tvar=lvsimdata.time[,1], xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)")
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) # p-approximation pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4]) # Without prividing W-value GOMSimP <- psim(pC,simuDataP[,1]) # With W-value GOMSimP2 <- psim(pC,simuDataP[,1],profit(nodes,param),simuDataP[,2]) # Shadow price-Stock plot plotgen(GOMSimP) plotgen(GOMSimP,ftype="p") plotgen(GOMSimP,xlabel="Stock Size, S", ylabel="Shadow Price (USD/Kg)") # Value-Stock-W plot plotgen(GOMSimP2,ftype="vw") plotgen(GOMSimP2,ftype="vw",xlabel="Stock Size, S", ylabel="Value Function") plotgen(GOMSimP2,ftype="vw",xlabel="Stock Size, S", ylabel="Value Function") ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) lvaproxc <- vaprox(lvspace,lvaproxdata) lvsim <- vsim(lvaproxc,lvsimdata.time[,2:3]) # Shadow price-Stock plot plotgen(lvsim) plotgen(lvsim,ftype="p") plotgen(lvsim,whichs=2,xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)") # Shadow price-time plot plotgen(lvsim,whichs=2,tvar=lvsimdata.time[,1]) # Value Function-Stock plot plotgen(lvsim,ftype="vw") plotgen(lvsim,ftype="vw",whichs=2, xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)") # Value Function-time plot plotgen(lvsim,ftype="vw",tvar=lvsimdata.time[,1]) plotgen(lvsim,ftype="vw",whichs=2,tvar=lvsimdata.time[,1], xlabel="Stock Size, S",ylabel="Shadow Price (USD/Kg)")
profit (w) function in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
profit(s,Z)
profit(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
profit
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.
The function provides the P-approximation simulation.
psim(pcoeff, stock, wval = NULL, sdot = NULL)
psim(pcoeff, stock, wval = NULL, sdot = NULL)
pcoeff |
An approximation result from |
stock |
An array of stock variable |
wval |
(Optional for vfun) An array of |
sdot |
(Optional for vfun) An array of ds/dt, |
Let be the vector of approximation coefficents from the results of
paprox
function.
The estimated shadow price (accounting) price of stock over the given approximation interval of
,
can be calculated as:
.
The estimated value function is:.
For more detils see Fenichel and Abbott (2014) and Fenichel et al. (2016).
A list of approximation resuts: shadow (accounting) prices, inclusive wealth, value function, stock, and W values. Use results$item
(or results[["item"]]
) to import each result item.
shadowp |
Shadow price |
vfun |
Value function |
stock |
Stock |
wval |
W-value if |
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.
Fenichel, Eli P., Joshua K. Abbott, Jude Bayham, Whitney Boone, Erin M. K. Haacker, and Lisa Pfeiffer. (2016) "Measuring the Value of Groundwater and Other Forms of Natural Capital."
Proceedings of the National Academy of Sciences .113:2382-2387.
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4]) GOMSimP <- psim(pC,simuDataP[,1],profit(nodes,param),simuDataP[,2]) # Shadow Price plotgen(GOMSimP, xlabel="Stock size, s", ylabel="Shadow price") # Value function and profit plotgen(GOMSimP,ftype="vw", xlabel="Stock size, s", ylabel=c("Value Function","Profit"))
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataP <- cbind(nodes,sdot(nodes,param), dsdotds(nodes,param),dwds(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) pC <- paprox(Aspace,simuDataP[,1],simuDataP[,2], simuDataP[,3],simuDataP[,4]) GOMSimP <- psim(pC,simuDataP[,1],profit(nodes,param),simuDataP[,2]) # Shadow Price plotgen(GOMSimP, xlabel="Stock size, s", ylabel="Shadow price") # Value function and profit plotgen(GOMSimP,ftype="vw", xlabel="Stock size, s", ylabel=c("Value Function","Profit"))
The function calulates the growth rate in the reef-fishy example of GOM dataset (Fenichel and Abbott, 2014).
sdot(s,Z)
sdot(s,Z)
s |
stock |
Z |
parameter vector |
This function is adopted in GOM
dataset.
growth rate
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.
This function generates a grid of multi-dimensional uniform grids.
unigrids(nnodes, lb, ub, rtype = NULL)
unigrids(nnodes, lb, ub, rtype = NULL)
nnodes |
An array of numbers of nodes |
lb |
An array of lower bounds |
ub |
An array of upper bounds |
rtype |
A type of results; default is NULL that returns a list class; if rtype = list, returns a list class; if rtype = grid, returns a matrix class. |
For the -th dimension of
, suppose a polynomial approximant
over a bounded interval
is defined by evenly gridded nodes. Then, a
-dimensional
uniform grids can be defined as:
.
This is all combinations of . Two types of results are provided. '
rtype = list
' provides a list
of dimensions wherease '
rtype = grids
' creates a matrix.
A list with elements of Chebyshev nodes or a
matrix of uniform grids
## Uniform grids with two-dimension unigrids(c(5,3), c(1,1), c(2,3)) ## Returns the same results unigrids(c(5,3), c(1,1), c(2,3), rtype='list') ## Returns a matrix grids with the same domain unigrids(c(5,3), c(1,1), c(2,3), rtype='grid') ## Uniform grid with one-dimension unigrids(5,1,2) ## Uniform grids with three stock unigrids(c(3,4,5),c(1,1,1),c(2,3,4),rtype='grid')
## Uniform grids with two-dimension unigrids(c(5,3), c(1,1), c(2,3)) ## Returns the same results unigrids(c(5,3), c(1,1), c(2,3), rtype='list') ## Returns a matrix grids with the same domain unigrids(c(5,3), c(1,1), c(2,3), rtype='grid') ## Uniform grid with one-dimension unigrids(5,1,2) ## Uniform grids with three stock unigrids(c(3,4,5),c(1,1,1),c(2,3,4),rtype='grid')
The function provides the V-approximation coefficients of the defined Chebyshev polynomials in aproxdef
.
vaprox(aproxspace, sdata)
vaprox(aproxspace, sdata)
aproxspace |
An approximation space defined by |
sdata |
A data.frame or matrix of [stock,sdot,benefit]=[ |
The V-approximation is finding the shadow price of -th stock,
for
from the relation:
,
where is the given discount rate,
is the intertemporal welfare function,
is a vector of stocks,
is the net benefits accruing to society,
and
is the growth of stock
. By the definition of the shadow price, we know:
.
Consider approximation ,
is Chebyshev polynomials and
is their coeffcients.
Then,
by the orthogonality of Chebyshev basis.
Adopting the properties above, we can get the unknown coefficient vector
from:
, and thus,
.
In a case of over-determined (more nodes than approaximation degrees),
.
For more detils see Fenichel and Abbott (2014), Fenichel et al. (2016), and Yun et al. (2017).
A list of approximation resuts: deg, lb, ub, delta, and coefficients. Use results$item
(or results[["item"]]
) to import each result item.
degree |
degree of Chebyshev polynomial |
lowerB |
lower bound of Chebyshev nodes |
upperB |
upper bound of Chebyshev nodes |
delta |
discount rate |
coefficient |
Chebyshev polynomial coefficients |
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.
Fenichel, Eli P., Joshua K. Abbott, Jude Bayham, Whitney Boone, Erin M. K. Haacker, and Lisa Pfeiffer. (2016) "Measuring the Value of Groundwater and Other Forms of Natural Capital."
Proceedings of the National Academy of Sciences.113:2382-2387.
Yun, Seong Do, Barbara Hutniczak, Joshua K. Abbott, and Eli P. Fenichel. (2017) "Ecosystem Based Management and the Welath of Ecosystems" Proceedings of the National Academy of Sciences. (forthcoming).
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataV <- cbind(nodes,sdot(nodes,param),profit(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) vC <- vaprox(Aspace,simuDataV) ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) vaproxc <- vaprox(lvspace,lvaproxdata)
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataV <- cbind(nodes,sdot(nodes,param),profit(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) vC <- vaprox(Aspace,simuDataV) ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) vaproxc <- vaprox(lvspace,lvaproxdata)
The function provides the V-approximation simulation by adopting the results of vaprox
. Available for multiple stock problems.
vsim(vcoeff, adata, wval = NULL)
vsim(vcoeff, adata, wval = NULL)
vcoeff |
An approximation result from |
adata |
A data.frame or matrix of [stock]=[ |
wval |
(Optional for |
Let be the approximation coefficent from the results of
vaprox
function.
The estimated shadow (accounting) price of -th stock over the given approximation intervals of
,
can be calcuated as:
where
Chebyshev polynomial basis.
The value function is:.
For more detils see Fenichel and Abbott (2014), Fenichel et al. (2016a), Fenichel et al. (2016b), and Yun et al. (2017).
A list of simulation resuts: shadow (accounting) prices, inclusive wealth, Value function,
stock, and W values. Use results$item
(or results[["item"]]
) to import each result item.
shadowp |
Shadow price |
iweach |
Inclusive wealth for each stock for multi-stock case |
vfun |
Value function |
stock |
Stock |
wval |
W-value if |
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.
Fenichel, Eli P., Joshua K. Abbott, Jude Bayham, Whitney Boone, Erin M. K. Haacker, and Lisa Pfeiffer. (2016a) "Measuring the Value of Groundwater and Other Forms of Natural Capital."
Proceedings of the National Academy of Sciences.113:2382-2387.
Fenichel, Eli P., Simon A. Levin, Bonnie McCay, Kevin St. Martin, Joshua K. Abbott, and Malin L. Pinsky. (2016b) "Wealth Reallocation and Sustainability under Climate Change."
Nature Climate change.6:237-244.
Yun, Seong Do, Barbara Hutniczak, Joshua K. Abbott, and Eli P. Fenichel. (2017) "Ecosystem Based Management and the Welath of Ecosystems" Proceedings of the National Academy of Sciences. (forthcoming).
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataV <- cbind(nodes,sdot(nodes,param),profit(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) vC <- vaprox(Aspace,simuDataV) # Note vcol function requries a data.frame or matrix! GOMSimV <- vsim(vC,as.matrix(simuDataV[,1],ncol=1),profit(nodes,param)) # plot shadow (accounting) price: Figure 4 in Fenichel and Abbott (2014) plotgen(GOMSimV, xlabel="Stock size, s", ylabel="Shadow price") ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) lvaproxc <- vaprox(lvspace,lvaproxdata) lvsim <- vsim(lvaproxc,lvsimdata.time[,2:3]) # plot Biomass plot(lvsimdata.time[,1], lvsimdata.time[,2], type='l', lwd=2, col="blue", xlab="Time", ylab="Biomass") lines(lvsimdata.time[,1], lvsimdata.time[,3], lwd=2, col="red") legend("topright", c("Prey", "Predator"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n") # plot shadow (accounting) prices plot(lvsimdata.time[,1],lvsim[["shadowp"]][,1],type='l', lwd=2, col="blue", ylim = c(-5,7), xlab="Time", ylab="Shadow price") lines(lvsimdata.time[,1],lvsim[["shadowp"]][,2], lwd=2, col="red") legend("topright", c("Prey", "Predator"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n") # plot inclusive weath and value function plot(lvsimdata.time[,1],lvsim[["iw"]],type='l', lwd=2, col="blue", ylim = c(-0.5,1.2), xlab="Time", ylab="Inclusive Wealth / Value Function ($)") lines(lvsimdata.time[,1],lvsim[["vfun"]], lwd=2, col="red") legend("topright", c("Inclusive Wealth", "Value Function"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n")
## 1-D Reef-fish example: see Fenichel and Abbott (2014) data("GOM") nodes <- chebnodegen(param$nodes,param$lowerK,param$upperK) simuDataV <- cbind(nodes,sdot(nodes,param),profit(nodes,param)) Aspace <- aproxdef(param$order,param$lowerK,param$upperK,param$delta) vC <- vaprox(Aspace,simuDataV) # Note vcol function requries a data.frame or matrix! GOMSimV <- vsim(vC,as.matrix(simuDataV[,1],ncol=1),profit(nodes,param)) # plot shadow (accounting) price: Figure 4 in Fenichel and Abbott (2014) plotgen(GOMSimV, xlabel="Stock size, s", ylabel="Shadow price") ## 2-D Prey-Predator example data("lvdata") aproxdeg <- c(20,20) lower <- c(0.1,0.1) upper <- c(1.5,1.5) delta <- 0.03 lvspace <- aproxdef(aproxdeg,lower,upper,delta) lvaproxc <- vaprox(lvspace,lvaproxdata) lvsim <- vsim(lvaproxc,lvsimdata.time[,2:3]) # plot Biomass plot(lvsimdata.time[,1], lvsimdata.time[,2], type='l', lwd=2, col="blue", xlab="Time", ylab="Biomass") lines(lvsimdata.time[,1], lvsimdata.time[,3], lwd=2, col="red") legend("topright", c("Prey", "Predator"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n") # plot shadow (accounting) prices plot(lvsimdata.time[,1],lvsim[["shadowp"]][,1],type='l', lwd=2, col="blue", ylim = c(-5,7), xlab="Time", ylab="Shadow price") lines(lvsimdata.time[,1],lvsim[["shadowp"]][,2], lwd=2, col="red") legend("topright", c("Prey", "Predator"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n") # plot inclusive weath and value function plot(lvsimdata.time[,1],lvsim[["iw"]],type='l', lwd=2, col="blue", ylim = c(-0.5,1.2), xlab="Time", ylab="Inclusive Wealth / Value Function ($)") lines(lvsimdata.time[,1],lvsim[["vfun"]], lwd=2, col="red") legend("topright", c("Inclusive Wealth", "Value Function"), col=c("blue", "red"), lty=c(1,1), lwd=c(2,2), bty="n")