Learn R Programming

AssetPricing (version 0.0-10)

xsolve.cont: Solve for an optimal continuous pricing policy

Description

Solves the system of coupled differential equations for the optimal prices of a number q of (perishable) assets, with q running from 1 to qmax in the case of continuous prices. Treats the system in a vectorized form and uses the method of Runge-Kutta.

Usage

xsolve.cont(type, tmax, nstep, qmax, lambda, S, alpha, gprob,
               salval = 0, verb = FALSE, n.out = max(500, round(nstep/200)))

Arguments

type
Scalar character string taking one of the two values sip (singly indexed prices) and dip (doubly indexed prices). In the dip case the price of the asset which is quoted to the arriving group is allowed to depen
tmax
The maximum residual time; think of this as being the initial time at which the assets go on sale (with time decreasing to zero, at which point the value of each asset drops to the salvage value (salval), usual
nstep
The number of (equal) sub-intervals into which the interval [0,tmax] is divided in the process of solving the system of differential equations numerically.
qmax
The maximum number of assets available for sale, i.e. the number of assets available at the starting (residual) time tmax.
lambda
A function (of t) specifying the intensity of the inhomogeneous Poisson process of arrival times of groups of potential customers.
S
An expression or a list of expressions specifying the price sensitivity functions S_j(x,t). If S is a single expression then S_j(x,t) is taken to be this expression raised to the power j. If
alpha
A numeric scalar between 0 and 1 specifying the probability that an arriving group of size j > q (where q is the number of assets remaining for sale) will consider purchasing (all of) these remaining assets.
gprob
A function (to calculate probabilities) or a numeric vector of of probabilities determining the distribution of the size of an arriving group of customers.
salval
A (non-negative) numeric scalar specifying the salvage value of an asset --- i.e. the quantity to which the value of an asset drops at residual time t=0. Usually salval is equal to 0.
verb
Logical scalar; if TRUE then a progress report (actually consisting solely of the step number) is printed out every 50 steps of the Runge-Kutta procedure.
n.out
The number of points at which to evaluate a spline fitted to the numerical results; these points are those on which the spline functions which form the entries of the output lists are based.

Value

  • A list with components
  • xThe optimal pricing policy, chosen to maximize the expected value of the remaining assets at any given time; an object of class funlist. It has the form of a list of (spline) functions x_i(t), with i running from 1 to qmax if type=="sip" or x_ij(t), with i running from 1 to qmax and j running from 1 to the maximum group size if type=="dip". Note that x has (must have) an attribute qmax specifying the maximum number of assets available for sale, i.e. the number of assets available at the starting (residual) time tmax. Note that if type == "dip" then the entry x[[i]] is equal to the function x_qj(t) where i = (j-1)*(qmax - j/2) + q.
  • vAn object of class funlist whose entries are (spline) functions v_q(t) specifying the (optimal) expected value of q assets at time t corresponding to the (optimal) pricing policy x.
  • vdotAn object of class funlist whose entries are the derivatives (with respect to t) of the functions v_q(t) described above. The values of these derivatives are determined sequentially in the process of solving the system of differential equations for the optimal pricing policy.

Details

No idea what the use of the n.out argument is, or why I wrote the code to depend on it. I think I will probably get rid of it.

References

Baneree, P. K. and Turner, T. R. A flexible model for the pricing of perishable assets. Omega, vol. 40, number 5, 2012, pages 533 -- 540, doi: 10.1016/j.omega.2011.10.001.

See Also

vsolve(), plot.funlist()

Examples

Run this code
S <- expression(exp(-kappa*x/(1+gamma*exp(-beta*t))))
attr(S,"parlist") <- c(kappa=10/1.5,gamma=9,beta=1)

# Optimal pricing policy assuming customers arrive singly:
lambda1 <- function(tt){
	if(tt<0 | tt> 1) stop("Time out of range.
")
	84*(1-tt)
}
X1 <- xsolve.cont(type="sip",tmax=1,nstep=1000,qmax=5,lambda=lambda1,
                 S=S,alpha=0.5, gprob=1,verb=TRUE)
# Optimal pricing policy assuming customers arrive in groups of
# size up to 5, with group size probabilities 1/3, 4/15, 1/5, 2/15,
# and 1/15 respectively.
lambda2 <- function(tt){
	if(tt<0 | tt> 1) stop("Time out of range.
")
	84*(1-tt)
}
X2 <- xsolve.cont(type="sip",tmax=1,nstep=1000,qmax=5,lambda=lambda2,
                 S=S,alpha=0.5, gprob=(5:1)/15,verb=TRUE)

# Note that the intensity functions lambda1() and lambda2() are
# such that the expected total number of customers is 42 in each case.

Run the code above in your browser using DataLab