Learn R Programming

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

ecd (version 0.9.1)

Elliptic Lambda Distribution and Option Pricing Model

Description

Elliptic lambda distribution and lambda option pricing model have been evolved into a framework of stable-law inspired distributions, such as the extended stable lambda distribution for asset return, stable count distribution for volatility, and Lihn-Laplace process as a leptokurtic extension of Wiener process. This package contains functions for the computation of density, probability, quantile, random variable, fitting procedures, option prices, volatility smile. It also comes with sample financial data, and plotting routines.

Copy Link

Version

Install

install.packages('ecd')

Monthly Downloads

57

Version

0.9.1

License

Artistic-2.0

Maintainer

Stephen Lihn

Last Published

October 3rd, 2017

Functions in ecd (0.9.1)

bootstrap.ecdb

Bootstrap data for the Elliptic DB (ECDB)
dec

The Elliptic Distribution
discr.ecd

Discriminant of the elliptic curve \(y(x)\)
dstablecnt

Stable Count distribution
ecd

Constructor of ecd class
ecd.adj_gamma

Discriminant-adjusted gamma
ecd.asymp_stats

Compute asymptotic statistics of an ecd object
ecd.ccdf

Complementary CDF of ecd
ecd-class

The ecd class
ecd-package

ecd: A package for the elliptic distribution.
ecd.diff

Utility to diff a vector of numeric or mpfr to get first derivative
ecd.erfq

Quartic scaled error function
ecd.fit_ts_conf

Timeseries fitting utility
ecd.has_quantile

Whether the ecd object has quantile data or not
ecd.rational

Utility to convert a numeric to a rational
ecd.read_csv_by_symbol

Read csv file of sample data
ecd.cusp_std_moment

The moments, characteristic function (CF), and moment generating function (MGF) of standard cusp distribution.
ecd.data

Read sample data
ecd.lag

Utility to shift a vector of numeric or mpfr
ecd.manage_hist_tails

Manage histogram tails
ecd.setup_const

Integration preprocessor for an ecd object
ecd.solve_cusp_asym

Trigonometric solution for asymmetric cusp distribution
ecld-class

An S4 class to represent the lambda distribution
ecd.data_stats

Statistics and histogram on log returns
ecd.df2ts

Utility to standardize timeseries from data.frame to xts
ecd.max_kurtosis

Utility to calculate where the maximum kurtosis is on the positive j=0 line
ecd.mp2f

Wrapper to convert mpfr to numeric
ecld

Constructor of ecld class
ecld.imgf

Incomplete moment generating function (IMGF) of ecld
ecld.imnt

Incomplete moment (imnt) of ecld
ecd.cdf

CDF of ecd
ecd.cubic

Generate or solve the cubic polynomial for ecd
ecd.estimate_const

Estimate the normalization constant for an ecd object
ecd.fit_data

Sample data fit
ecd.pdf

Calculate the PDF of an ecd object
ecd.mpnum

Wrappers for ecd to maintain consistent type between mpfr and numeric
ecd.ogf

Option generating function of ecd
ecd.y0_isomorphic

The analytic solution of \(y(0)\) via isomorphic mapping.
ecdattr-class

An S4 class to represent the ecdattr row in the Elliptic Database (ECDB)
ecdb.dbSendQuery

Send query to the elliptic database
ecdb.protectiveCommit

Protective commit
ecld.ivol_ogf_star

Calculate implied volatility using star OGF and small sigma formula
ecld.mgf_term

The term structure of ecld symmetric MGF
ecld.ogf_star

Star OGF of ecld
ecld.op_Q

The Q operator in option pricing model
ecd.cusp

Cusp constructor of ecd class
ecd.cusp_a2r

Conversion between alpha and gamma for cusp distribution
ecd.imgf

Incomplete MGF of ecd
ecd.integrate

Wrapper to integrate numeric and mpfr
ecd.polar

Polar constructor of ecd class
ecd.ts_lag_stats

Lag statistics on timeseries of log returns
ecd.uniroot

Uniroot wrapper
ecdq-class

setClass for ecdq class
ecd.read_symbol_conf

Read conf for sample data
ecd.sd

Standard deviation, variance, mean, skewness, and kurtosis of ecd
ecdattr

Constructor of ecdattr class for the Elliptic Database (ECDB)
ecdattr.enrich

Enrich a basic ecdattr object
ecdattr.pairs

Create a list of basic ecdattr objects
ecdattr.pairs_polar

Create a list of basic ecdattr objects in polar coordinate
ecld.moment

The moments and MGF of ecld
ecld.mpnum

Wrappers for ecld to maintain consistent type between mpfr and numeric
ecld.quartic_SN0_atm_ki

The ATM RNO related constants and calculations in quartic model
ecld.sd

Compute statistics analytically for an ecld object
ecop.bs_option_price

Calculate option price from implied volatility in Black-Sholes model
ecop.find_fixed_point_lambda_by_atm_skew

Utility to find the fixed point lambda that matches ATM skew
ecop.get_ld_triple

Get triple list of ecld objects by stdev
ecop.opt-class

An S4 class to represent the option data and model calculation
lamp

Constructor of lamp class
ecdq

Constructor of ecdq class
ecld.fixed_point_SN0_atm_ki

The ATM RNO related constants and calculations in fixed point model
ecld.gamma

Incomplete gamma function and asymptotic expansion
ecld.op_V

The O, V, U operators in option pricing model
ecld.pdf

Calculate the PDF of an ecld object
ecld.y_slope

Analytic solution for the slope of \(y(x)\) in lambda distribution
ecldOrEcd-class

The ecldOrEcd class
ellipticity.ecd

Ellipticity of ecd object
history.ecdb

List of history in the Elliptic DB
ecd.mpfr

Wrapper to convert numeric to mpfr
ecd.mpfr_qagi

Utility to integrate mpfr with infinity via qagi
ecd.stats

Compute statistics of an ecd object
lamp.plot_sim4

Plot the simulation result in standard layout
lamp.qsl_fit_config

Read QSLD fit config
plot_2x2.ecd

Standard 2x2 plot for sample data
quantilize.ecd

Add the quantile data to the ecd object
solve.ecd

Solve the elliptic curve \(y(x)\)
solve_sym.ecd

Analytic solution for a symmetric elliptic curve
ecd.toString

String representation of ecd
ecdb-class

setClass for ecdb class
ecdb

Constructor of ecdb class for the elliptic database
ecld.cdf

CDF and CCDF of ecld
ecop-class

An S4 class to represent the top-level option model
ecop.bs_implied_volatility

Implied volatility of Black-Sholes model
ecop.term_plot_3x3

Produce 3x3 plot of volatility smiles for a date
ecop.vix_plot_3x3

Produce 3x3 plot of VIX volatility smiles for a date
lamp.qsl_fit_plot

Plot the fit to asset returns using quartic stable lambda distribution
lamp.sd_factor

Calculate sd adjustment factor
moment.ecd

Compute the moment of ecd via integration
read.ecdb

Read API for the ecdb
ecld.const

Analytic solution of the normalization constant for lambda distribution
ecld.mu_D

mu_D of ecld
ecld.ogf

Option generating function (OGF) of ecld
ecop.find_fixed_point_sd_by_lambda

Utility to find the fixed point stdev when lambda is given
ecop.from_symbol_conf

Constructor of ecop class by read conf for option sample data
numericMpfr-class

The numericMpfr class
rlaplace0

Laplace distribution
lamp.generate_tau

Generate tau from stable distribution
levy.domain_coloring

Domain coloring of Laplace kernel of lambda distribution
levy.dskewed

Skewed Levy distribution in Levy statistics
solve_trig.ecd

Trigonometric solution for a elliptic curve
summary.ecdb

Summary for the Elliptic DB (ECDB)
ecop.plot_option

Plot option chain charts using conf from option sample data
ecop.polyfit_option

Poly fit on option prices
k2mnt

Conversion between cumulants and moments
lamp-class

An S4 class to represent the lambda process
lamp.simulate1

Simulate one sequence of lambda process from stable distribution
lamp.simulate_iter

Simulate lambda process from stable distribution iteratively
ecld.quartic_Qp

The ATM volatility and skew of \(Q_p\) in quartic model
ecld.quartic_Qp_atm_attr

Calculate ATM attributes from key quartic parameters
ecld.sged_const

The integral solutions of SGED
ecld.solve

Analytic solution for \(y(x)\) in lambda distribution
ecop.read_csv_by_symbol

Read option data csv
ecop.term_master_calculator

Master calculator for all the analytics of volatility smiles required for a date
integrate_pdf.ecd

Integrate a function with PDF of the distribution
rlihnlap

Lihn-Laplace process and distribution
rqsl

Stable lambda distribution
jinv.ecd

J-invariant of the elliptic curve \(y(x)\)
lamp.stable_rnd_walk

Calculate the stable random walk
levy.dlambda

Standard Lambda distribution
write.ecdb

Write API for the ecdb for a list of basic ecdattr objects
y_slope.ecd

Slope of \(y(x)\)