Learn R Programming

⚠️There's a newer version (2.10-0) of this package.Take me there.

Numerical Methods and Optimisation in Finance

Functions, examples and data from the first and the second edition of "Numerical Methods and Optimization in Finance" by M. Gilli, D. Maringer and E. Schumann (2019, ISBN:978-0128150658). The package provides implementations of optimisation heuristics (Differential Evolution, Genetic Algorithms, Particle Swarm Optimisation, Simulated Annealing and Threshold Accepting), and other optimisation tools, such as grid search and greedy search. There are also functions for the valuation of financial instruments, such as bonds and options, and functions that help with stochastic simulations.

Installing the package

The latest build of the package is always available from http://enricoschumann.net/R/packages/NMOF/. A stable version is available from CRAN.

To install the package from within an R session, type:

install.packages('NMOF')  ## CRAN version
install.packages('NMOF',  ## development version
                 repos = c('http://enricoschumann.net/R',
                           getOption('repos')))

News, feedback and discussion

New package releases and other news related to the book or the package are announced on the NMOF-news mailing list.

An RSS feed of the package NEWS file is also available.

Applications, as long as they are finance-related, should be discussed on the R-SIG-Finance mailing list.

Please send bug reports or suggestions directly to the package maintainer, for instance by using =bug.report=.

library("utils")
bug.report("[NMOF] Unexpected behaviour in function XXX",
           maintainer("NMOF"), package = "NMOF")

References

Manfred Gilli, Dietmar Maringer and Enrico Schumann. Numerical Methods and Optimization in Finance. Academic Press, 2019.

Copy Link

Version

Install

install.packages('NMOF')

Monthly Downloads

1,249

Version

2.7-1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Enrico Schumann

Last Published

October 20th, 2022

Functions in NMOF (2.7-1)

French

Download Datasets from Kenneth French's Data Library
CPPI

Constant-Proportion Portfolio Insurance
NMOF-package

Numerical Methods and Optimization in Finance
LS.info

Local-Search Information
DEopt

Optimisation with Differential Evolution
LSopt

Stochastic Local Search
MA

Simple Moving Average
EuropeanCall

Computing Prices of European Calls with a Binomial Tree
NMOF-internal

Internal NMOF functions
GAopt

Optimisation with a Genetic Algorithm
Shiller

Download Robert Shiller's Data
NS

Zero Rates for Nelson--Siegel--Svensson Model
NSf

Factor Loadings for Nelson--Siegel and Nelson--Siegel--Svensson
SAopt

Optimisation with Simulated Annealing
SA.info

Simulated-Annealing Information
TA.info

Threshold-Accepting Information
Ritter

Download Jay Ritter's IPO Data
PSopt

Particle Swarm Optimisation
vanillaBond

Pricing Plain-Vanilla Bonds
TAopt

Optimisation with Threshold Accepting
drawdown

Drawdown
callMerton

Price of a European Call under Merton's Jump--Diffusion Model
bundFuture

Theoretical Valuation of Euro Bund Future
callHestoncf

Price of a European Call under the Heston Model
bracketing

Zero-Bracketing
colSubset

Full-rank Column Subset
fundData

Mutual Fund Returns
bundData

German Government Bond Data
divRatio

Diversification Ratio
callCF

Price a Plain-Vanilla Call with the Characteristic Function
mvFrontier

Computing Mean--Variance Efficient Portfolios
minvar

Minimum-Variance Portfolios
vanillaOptionEuropean

Pricing Plain-Vanilla (European and American) and Barrier Options (European)
maxSharpe

Maximum-Sharpe-Ratio/Tangency Portfolio
optionData

Option Data
greedySearch

Greedy Search
minCVaR

Minimum Conditional-Value-at-Risk (CVaR) Portfolios
gridSearch

Grid Search
pm

Partial Moments
mc

Option Pricing via Monte-Carlo Simulation
trackingPortfolio

Compute a Tracking Portfolio
qTable

Prepare LaTeX Table with Quartile Plots
xtContractValue

Contract Value of Australian Government Bond Future
putCallParity

Put-Call Parity
restartOpt

Restart an Optimisation Algorithm
randomReturns

Create a Random Returns
repairMatrix

Repair an Indefinite Correlation Matrix
testFunctions

Classical Test Functions for Unconstrained Optimisation
showExample

Display Code Examples
xwGauss

Integration of Gauss-type
resampleC

Resample with Specified Rank Correlation