nodeSpacer: Non-Uniform Finite Difference Node Spacer

Description Usage Arguments Details Value Author(s) References Examples

View source: R/nodeSpacer.R


nodeSpacer implements the spatial discretization scheme from Hout and Foulon (2010) with arbitrary left and right bounds. The function additionally includes logic for mesh shifting.


nodeSpacer(K, leftBound, rightBound, nodes, density, kShift)



scalar; option strike.


scalar; near spatial boundary of the underlying domain.


scalar; far spatial boundary of the underlying domain.


integer; number of nodes used in the spatial discretization.


scalar; impacts the concentration of nodes around the option strike. At 0, nodes are uniformly distributed between the leftBound and rightBound. Increasing the parameter increases the node concentration around the strike.


case; if 0, no mesh shifting, if 1, adjusts the node spacing such that the strike falls exactly between two nodes, if 2, adjusts the node spacing such that the strike falls exactly on a node. See Tavella and Randall (2000).


Mesh shifting is accomplished by multiplying the vector of gridpoints by a scalar. For multi-asset options, this nodeSpacer is called iteratively to discretize each underlying's spatial domain.


nodeSpacer returns a vector of gridpoints used in spatial discretization in the finite difference method. The nodes input determines the length of the output vector.


Michael Eichenberger and Carlo Rosa


Hout, K. J., Foulon, S., 2010. ADI finite difference schemes for option pricing in the Heston model with correlation. International Journal of Numerical Analysis and Modeling, 7 (2), 303–320.

Pooley, D. M., Vetzal, K. R., Forsyth, P. A., 2002. Convergence remedies for non-smooth payoffs in option pricing.

Tavella, D., Randall, C., 2000. Pricing Financial Instruments: The Finite Difference Method. John Wiley & Sons, Inc., New York.


# sample mesh spacing
plot(nodeSpacer(100, 0, 500, 26, 5, 1), rep(0, times=26), main='Non-Uniform Mesh Spacing', 
  xlab='Underlying Price (Strike = 100)', ylab='', yaxt='n', type='p', cex=0.5, pch=16)

multiAssetOptions documentation built on May 19, 2017, 6:48 a.m.

Search within the multiAssetOptions package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.