ecd: Elliptic Distribution and Lambda Option Pricing Model

An implementation of the univariate elliptic distribution, and lambda option pricing model. It provides detailed functionality and data sets for the distribution and modelling. Especially, it contains functions for the computation of density, probability, quantile, fitting procedures, option prices, volatility smile. It also comes with sample financial data, and plotting routines.

Install the latest version of this package by entering the following in R:
AuthorStephen H-T. Lihn [aut, cre]
Date of publication2017-01-06 23:30:45
MaintainerStephen H-T. Lihn <>

View on CRAN

Man pages

bootstrap.ecdb: Bootstrap data for the Elliptic DB (ECDB)

dec: The Elliptic Distribution

discr.ecd: Discriminant of the elliptic curve y(x)

ecd: Constructor of ecd class

ecd.adj_gamma: Discriminant-adjusted gamma

ecd.asymp_stats: Compute asymptotic statistics of an ecd object

ecdattr: Constructor of 'ecdattr' class for the Elliptic Database...

ecdattr-class: An S4 class to represent the 'ecdattr' row in the Elliptic...

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

ecdb: Constructor of ecdb class for the elliptic database

ecdb-class: setClass for ecdb class

ecdb.dbSendQuery: Send query to the elliptic database

ecdb.protectiveCommit: Protective commit

ecd.ccdf: Complementary CDF of ecd

ecd.cdf: CDF of ecd

ecd-class: The ecd class

ecd.cubic: Generate or solve the cubic polynomial for ecd

ecd.cusp: Cusp constructor of ecd class

ecd.cusp_a2r: Conversion between alpha and gamma for cusp distribution

ecd.cusp_std_moment: The moments, characteristic function (CF), and moment... Read sample data

ecd.data_stats: Statistics and histogram on log returns

ecd.df2ts: Utility to standardize timeseries from data.frame to xts

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

ecd.erfq: Quartic scaled error function

ecd.estimate_const: Estimate the normalization constant for an ecd object

ecd.fit_data: Sample data fit

ecd.fit_ts_conf: Timeseries fitting utility

ecd.has_quantile: Whether the ecd object has quantile data or not

ecd.imgf: Incomplete MGF of ecd

ecd.integrate: Wrapper to integrate numeric and mpfr

ecd.lag: Utility to shift a vector of numeric or mpfr

ecd.manage_hist_tails: Manage histogram tails

ecd.max_kurtosis: Utility to calculate where the maximum kurtosis is on the...

ecd.mp2f: Wrapper to convert mpfr to numeric

ecd.mpfr: Wrapper to convert numeric to mpfr

ecd.mpfr_qagi: Utility to integrate mpfr with infinity via qagi

ecd.mpnum: Wrappers for ecd to maintain consistent type between mpfr and...

ecd.ogf: Option generating function of ecd

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

ecd.pdf: Calculate the PDF of an ecd object

ecd.polar: Polar constructor of ecd class

ecdq: Constructor of ecdq class

ecdq-class: setClass for ecdq class

ecd.rational: Utility to convert a numeric to a rational

ecd.read_csv_by_symbol: Read csv file of sample data

ecd.read_symbol_conf: Read conf for sample data Standard deviation, variance, mean, skewness, and kurtosis of...

ecd.setup_const: Integration preprocessor for an ecd object

ecd.solve_cusp_asym: Trigonometric solution for asymmetric cusp distribution

ecd.stats: Compute statistics of an ecd object

ecd.toString: String representation of ecd

ecd.ts_lag_stats: Lag statistics on timeseries of log returns

ecd.uniroot: Uniroot wrapper

ecd.y0_isomorphic: The analytic solution of y(0) via isomorphic mapping.

ecld: Constructor of ecld class

ecld.cdf: CDF and CCDF of ecld

ecld-class: An S4 class to represent the lambda distribution

ecld.const: Analytic solution of the normalization constant for lambda...

ecld.fixed_point_SN0_atm_ki: The ATM RNO related constants and calculations in fixed point...

ecld.gamma: Incomplete gamma function and asymptotic expansion

ecld.imgf: Incomplete moment generating function (IMGF) of ecld

ecld.imnt: Incomplete moment (imnt) of ecld

ecld.ivol_ogf_star: Calculate implied volatility using star OGF and small sigma...

ecld.mgf_term: The term structure of ecld symmetric MGF

ecld.moment: The moments and MGF of ecld

ecld.mpnum: Wrappers for ecld to maintain consistent type between mpfr...

ecld.mu_D: mu_D of ecld

ecld.ogf: Option generating function (OGF) of ecld

ecld.ogf_star: Star OGF of ecld

ecld.op_Q: The Q operator in option pricing model

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

ecldOrEcd-class: The ecldOrEcd class

ecld.pdf: Calculate the PDF of an ecld object

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.quartic_SN0_atm_ki: The ATM RNO related constants and calculations in quartic... Compute statistics analytically for an ecld object

ecld.sged_const: The integral solutions of SGED

ecld.solve: Analytic solution for y(x) in lambda distribution

ecld.y_slope: Analytic solution for the slope of y(x) in lambda...

ecop.bs_implied_volatility: Implied volatility of Black-Sholes model

ecop.bs_option_price: Calculate option price from implied volatility in...

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

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

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

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...

ecop.plot_option: Plot option chain charts using conf from option sample data

ecop.polyfit_option: Poly fit on option prices

ecop.read_csv_by_symbol: Read option data csv

ecop.term_master_calculator: Master calculator for all the analytics of volatility smiles...

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

ellipticity.ecd: Ellipticity of ecd object

history.ecdb: List of history in the Elliptic DB

integrate_pdf.ecd: Integrate a function with PDF of the distribution

jinv.ecd: J-invariant of the elliptic curve y(x)

moment.ecd: Compute the moment of ecd via integration

numericMpfr-class: The numericMpfr class

plot_2x2.ecd: Standard 2x2 plot for sample data

quantilize.ecd: Add the quantile data to the ecd object

read.ecdb: Read API for the ecdb

solve.ecd: Solve the elliptic curve y(x)

solve_sym.ecd: Analytic solution for a symmetric elliptic curve

solve_trig.ecd: Trigonometric solution for a elliptic curve

summary.ecdb: Summary for the Elliptic DB (ECDB)

write.ecdb: Write API for the ecdb for a list of basic ecdattr objects

y_slope.ecd: Slope of y(x)


bootstrap Man page
bootstrap.ecdb Man page
bootstrap,ecdb-method Man page
dec Man page
discr Man page
discr.ecd Man page
discr,ecd-method Man page
ecd Man page
ecd.adj2gamma Man page
ecd.adj_gamma Man page
ecd.asymp_kurtosis Man page
ecd.asymp_stats Man page
ecdattr Man page
ecdattr-class Man page
ecdattr.enrich Man page
ecdattr.pairs Man page
ecdattr.pairs_polar Man page
ecdb Man page
ecdb-class Man page
ecdb.dbSendQuery Man page
ecdb.protectiveCommit Man page
ecd.ccdf Man page
ecd.cdf Man page
ecd-class Man page
ecd.cubic Man page
ecd.cusp Man page
ecd.cusp_a2r Man page
ecd.cusp_r2a Man page
ecd.cusp_std_cf Man page
ecd.cusp_std_mgf Man page
ecd.cusp_std_moment Man page Man page
ecd.data_stats Man page
ecd.dawson Man page
ecd.devel Man page
ecd.df2ts Man page
ecd.diff Man page
ecd.erf Man page
ecd.erfc Man page
ecd.erfcx Man page
ecd.erfi Man page
ecd.erfq Man page
ecd.erfq_sum Man page
ecd.estimate_const Man page
ecd.fit_data Man page
ecd.fit_ts_conf Man page
ecd.gamma Man page
ecd.has_quantile Man page
ecd.ifelse Man page
ecd.imgf Man page
ecd.integrate Man page
ecd.kurt Man page
ecd.kurtosis Man page
ecd.lag Man page
ecd.manage_hist_tails Man page
ecd.max_kurtosis Man page
ecd.mean Man page
ecd.mp1 Man page
ecd.mp2f Man page
ecd.mpfr Man page
ecd.mpfr_qagi Man page
ecd.mpnum Man page
ecd.mppi Man page
ecd.mu_D Man page
ecd.ogf Man page
ecd-package Man page
ecd.pdf Man page
ecd.polar Man page
ecdq Man page
ecdq-class Man page
ecd.rational Man page
ecd.read_csv_by_symbol Man page
ecd.read_symbol_conf Man page
ecd.sapply Man page Man page
ecd.setup_const Man page
ecd.skewness Man page
ecd.solve_cusp_asym Man page
ecd.stats Man page
ecd.toString Man page
ecd.ts_lag_stats Man page
ecd.uniroot Man page
ecd.var Man page
ecd.y0_isomorphic Man page
ecld Man page
ecld.ccdf Man page
ecld.cdf Man page
ecld.cdf_gamma Man page
ecld.cdf_integrate Man page
ecld-class Man page
ecld.const Man page
ecld.fixed_point_atm_ki Man page
ecld.fixed_point_atm_Q_left Man page
ecld.fixed_point_atm_Q_right Man page
ecld.fixed_point_shift Man page
ecld.fixed_point_SN0_atm_ki Man page
ecld.fixed_point_SN0_atm_ki_sd Man page
ecld.fixed_point_SN0_lambda_skew_ratio Man page
ecld.fixed_point_SN0_rho_sd Man page
ecld.fixed_point_SN0_skew Man page
ecld.from Man page
ecld.from_sd Man page
ecld.gamma Man page
ecld.gamma_2F0 Man page
ecld.gamma_hgeo Man page
ecld.ifelse Man page
ecld.imgf Man page
ecld.imgf_gamma Man page
ecld.imgf_integrate Man page
ecld.imgf_quartic Man page
ecld.imnt Man page
ecld.imnt_integrate Man page
ecld.imnt_sum Man page
ecld.ivol_ogf_star Man page
ecld.kurt Man page
ecld.kurtosis Man page
ecld.laplace_B Man page
ecld.mclapply Man page
ecld.mean Man page
ecld.mgf Man page
ecld.mgf_by_sum Man page
ecld.mgf_diterm Man page
ecld.mgf_quartic Man page
ecld.mgf_term Man page
ecld.mgf_term_original Man page
ecld.mgf_trunc Man page
ecld.mgf_trunc_max_sigma Man page
ecld.moment Man page
ecld.mpnum Man page
ecld.mu_D Man page
ecld.mu_D_by_sum Man page
ecld.mu_D_integrate Man page
ecld.mu_D_quartic Man page
ecld.ogf Man page
ecld.ogf_gamma Man page
ecld.ogf_imnt_sum Man page
ecld.ogf_integrate Man page
ecld.ogf_log_slope Man page
ecld.ogf_quartic Man page
ecld.ogf_star Man page
ecld.ogf_star_analytic Man page
ecld.ogf_star_exp Man page
ecld.ogf_star_gamma_star Man page
ecld.ogf_star_hgeo Man page
ecld.op_O Man page
ecld.op_Q Man page
ecld.op_Q_skew Man page
ecld.op_Q_skew_by_k_lm Man page
ecld.op_U_lag Man page
ecld.op_V Man page
ecld.op_VL_quartic Man page
ecldOrEcd-class Man page
ecld.pdf Man page
ecld.quartic Man page
ecld.quartic_model_sample Man page
ecld.quartic_model_sample_attr Man page
ecld.quartic_Q Man page
ecld.quartic_Qp Man page
ecld.quartic_Qp_atm_attr Man page
ecld.quartic_Qp_atm_ki Man page
ecld.quartic_Qp_atm_skew Man page
ecld.quartic_Qp_rho Man page
ecld.quartic_Qp_skew Man page
ecld.quartic_SN0_atm_ki Man page
ecld.quartic_SN0_max_RNV Man page
ecld.quartic_SN0_rho_stdev Man page
ecld.quartic_SN0_skew Man page
ecld.sapply Man page Man page
ecld.sged_cdf Man page
ecld.sged_const Man page
ecld.sged_imgf Man page
ecld.sged_mgf Man page
ecld.sged_moment Man page
ecld.sged_ogf Man page
ecld.skewness Man page
ecld.solve Man page
ecld.solve_by_poly Man page
ecld.solve_isomorphic Man page
ecld.solve_quartic Man page
ecld.validate Man page
ecld.var Man page
ecld.y_slope Man page
ecld.y_slope_trunc Man page
ecop.bs_call_price Man page
ecop.bs_implied_volatility Man page
ecop.bs_option_price Man page
ecop.bs_put_price Man page
ecop.build_opt Man page
ecop-class Man page
ecop.enrich_option_df Man page
ecop.find_fixed_point_lambda_by_atm_skew Man page
ecop.find_fixed_point_sd_by_lambda Man page
ecop.from_symbol_conf Man page
ecop.get_ld_triple Man page
ecop.opt-class Man page
ecop.plot_option Man page
ecop.polyfit_option Man page
ecop.read_csv_by_symbol Man page
ecop.read_symbol_conf Man page
ecop.smile_data_calculator Man page
ecop.term_atm Man page
ecop.term_idx_range Man page
ecop.term_master_calculator Man page
ecop.term_plot_3x3 Man page
ecop.term_realized_days Man page
ecop.term_target_days_default Man page
ecop.vix_plot_3x3 Man page
ellipticity Man page
ellipticity.ecd Man page
ellipticity,ecd-method Man page
history Man page
history.ecdb Man page
history,ecdb-method Man page
integrate_pdf Man page
integrate_pdf.ecd Man page
integrate_pdf,ecd-method Man page
jinv Man page
jinv.ecd Man page
jinv,ecd-method Man page
moment Man page
moment.ecd Man page
moment,ecd-method Man page
numericMpfr-class Man page
pec Man page
plot_2x2 Man page
plot_2x2.ecd Man page
plot_2x2,ecd-method Man page
qec Man page
quantilize Man page
quantilize.ecd Man page
quantilize,ecd-method Man page
read Man page
read.ecdb Man page
read,ecdb-method Man page
rec Man page
solve.ecd Man page
solve,ecd-method Man page
solve_sym Man page
solve_sym.ecd Man page
solve_sym,ecd-method Man page
solve_trig Man page
solve_trig.ecd Man page
solve_trig,ecd-method Man page
summary Man page
summary.ecdb Man page
summary,ecdb-method Man page
write Man page
write.ecdb Man page
write,list,ecdb-method Man page
y_slope Man page
y_slope.ecd Man page
y_slope,ecd-method Man page


tests/testthat/test-data-ecd.R tests/testthat/test-isomorphic-ecd.R tests/testthat/test-std-cusp-ecd.R tests/testthat/test-option-ecop.R tests/testthat/test-lambda-est-ecd.R tests/testthat/test-lambda-gamma-ecd.R tests/testthat/test-lambda-imnt-ecd.R tests/testthat/test-lambda-normal-ecd.R tests/testthat/test-cusp-ecd.R tests/testthat/test-pdf-solve-ecd.R tests/testthat/test-internal-ecdb-ecd.R
R/ecd-jinv-generic.R R/ecop-constructor.R R/ecd-ccdf-method.R R/ecop-opt-class.R R/ecd-solve-cusp-asym-method.R R/ecd-fit-ts-conf-method.R R/ecd-diff-method.R R/ecld-constructor.R R/ecd-plot-2x2-generic.R R/ecop-find-fixed-point-lambda-by-atm-skew-method.R R/ecd-data-stats-method.R R/ecop-polyfit-option-method.R R/ecd-is-numericMpfr-internal.R R/ecld.quartic_Qp_atm_attr.R R/ecdb-read-generic.R R/ecd-ogf-method.R R/ecdb-write-generic.R R/ecd-read-csv-by-symbol-method.R R/ecd-adj-gamma-method.R R/ecd-y0-isomorphic-method.R R/ecd-cusp-constructor.R R/ecld-imnt-method.R R/ecd-moment-generic.R R/ecd-cdf-method.R R/ecd-integrate-pdf-generic.R R/ecop-term-master-calculator-method.R R/ecld-fixed-point-RN0-method.R R/ecld-mu-D-method.R R/ecop-bs-implied-volatility-method.R R/ecdq-class.R R/ecdb-ecdattr-generic.R R/ecdb-constructor.R R/ecd-sd-method.R R/ecd-imgf-method.R R/ecd-integrate-method.R R/ecld-solve-method.R R/ecd-toString-method.R R/ecop-term-plot-3x3-method.R R/ecdq-constructor.R R/ecdattr-pairs-method.R R/ecd-ts-lag-stats-method.R R/ecd-ecldOrEcd-class.R R/ecd-estimate-const-method.R R/ecop-find-fixed-point-sd-by-lambda-method.R R/ecld-imgf-method.R R/ecdattr-pairs-polar-method.R R/ecld-sd-method.R R/ecd-cusp-std-moment-method.R R/ecd-read-symbol-conf-method.R R/ecd-cusp-a2r-method.R R/ecld-ivol-ogf-star-method.R R/ecop-read-csv-by-symbol.R R/ecd-mpfr-qagi-method.R R/ecdattr-constructor.R R/ecdb-helpers-internal.R R/ecld-op-Q-method.R R/ecld-quartic-RN0-method.R R/ecdb-summary-generic.R R/ecd-ellipticity-generic.R R/ecd-asymp-stats-method.R R/ecd-lag-method.R R/ecd-solve-generic.R R/ecd-cubic-method.R R/ecd-stats-method.R R/ecdb-dbSendQuery-method.R R/ecd-quantilize-generic.R R/ecld-gamma-method.R R/ecdattr-class.R R/ecd-df2ts-method.R R/ecld-mpnum-method.R R/ecld-ogf-star-method.R R/ecd-rational-method.R R/ecd-distribution-method.R R/ecop-get-ld-triple-method.R R/ecd-mpnum-method.R R/ecld-class.R R/ecld-y-slope-method.R R/ecd-solve-sym-generic.R R/ecd-mpfr-method.R R/ecld-mgf-term-method.R R/ecld-const-method.R R/ecld-pdf-method.R R/ecd-solve-trig-generic.R R/ecd-data-config-internal.R R/ecdb-protectiveCommit-method.R R/ecd-erfq-method.R R/ecd-discr-generic.R R/ecdattr-enrich-method.R R/ecd-data-method.R R/ecld-cdf-method.R R/ecd-pdf-method.R R/ecld.quartic-Qp-method.R R/ecd-model-internal.R R/ecld-op-V-method.R R/ecd-manage-hist-tails-method.R R/ecop-class.R R/ecd-polar-constructor.R R/ecd-numericMpfr-class.R R/ecd-y-slope-generic.R R/ecop-vix-plot-3x3-method.R R/ecop-plot-option-method.R R/ecd-standardfit-method.R R/ecld-moment-method.R R/ecdb-history-generic.R R/ecd-package.R R/ecd-class.R R/ecd-has-quantile-method.R R/ecd-uniroot-method.R R/ecd-constructor.R R/ecd-fit-data-method.R R/ecd-setup-const-method.R R/ecd-max-kurtosis-method.R R/ecop-bs-option-price-method.R R/ecdb-bootstrap-generic.R R/ecdb-class.R R/ecd-mp2f-method.R R/ecld-ogf-method.R R/ecld-sged-method.R
man/solve.ecd.Rd man/ecd.mpfr.Rd man/ecd.mp2f.Rd man/ecd.cusp_a2r.Rd man/ecd.stats.Rd man/ecld.Rd man/ecop.polyfit_option.Rd man/ecld.op_V.Rd man/ man/ecd-class.Rd man/ecld.op_Q.Rd man/discr.ecd.Rd man/ecld-class.Rd man/ecd.rational.Rd man/ecdq.Rd man/ecop.find_fixed_point_lambda_by_atm_skew.Rd man/ecdattr-class.Rd man/ecd.estimate_const.Rd man/ecop.read_csv_by_symbol.Rd man/dec.Rd man/ecd.read_csv_by_symbol.Rd man/ecdb-class.Rd man/numericMpfr-class.Rd man/ecld.cdf.Rd man/ecd.imgf.Rd man/ecd.cubic.Rd man/solve_sym.ecd.Rd man/ecd.cdf.Rd man/ecdattr.enrich.Rd man/ecd.read_symbol_conf.Rd man/ecop.term_plot_3x3.Rd man/ecd.integrate.Rd man/ecd.adj_gamma.Rd man/ecd.cusp_std_moment.Rd man/bootstrap.ecdb.Rd man/integrate_pdf.ecd.Rd man/ecldOrEcd-class.Rd man/ecd.fit_data.Rd man/ecd.ogf.Rd man/ecd.diff.Rd man/plot_2x2.ecd.Rd man/ecld.mgf_term.Rd man/ecd.ccdf.Rd man/ecop.bs_implied_volatility.Rd man/ecld.pdf.Rd man/quantilize.ecd.Rd man/ecld.quartic_SN0_atm_ki.Rd man/ecd.mpfr_qagi.Rd man/ecop-class.Rd man/ecd.max_kurtosis.Rd man/summary.ecdb.Rd man/ellipticity.ecd.Rd man/ecop.from_symbol_conf.Rd man/ecd-package.Rd man/ecd.has_quantile.Rd man/ecld.ogf_star.Rd man/ecd.mpnum.Rd man/jinv.ecd.Rd man/ecld.imgf.Rd man/ecd.y0_isomorphic.Rd man/ecld.ivol_ogf_star.Rd man/ecld.solve.Rd man/ecld.imnt.Rd man/ecd.Rd man/write.ecdb.Rd man/ecld.y_slope.Rd man/ecd.df2ts.Rd man/ecop.bs_option_price.Rd man/ man/ecld.const.Rd man/ecdattr.pairs_polar.Rd man/ecd.setup_const.Rd man/ man/ecld.fixed_point_SN0_atm_ki.Rd man/ecld.moment.Rd man/ecd.solve_cusp_asym.Rd man/ecop.vix_plot_3x3.Rd man/ecd.polar.Rd man/ecd.lag.Rd man/ecdattr.Rd man/ecd.erfq.Rd man/ecop.opt-class.Rd man/ecop.term_master_calculator.Rd man/ecdb.dbSendQuery.Rd man/ecd.toString.Rd man/ecld.quartic_Qp_atm_attr.Rd man/ecdattr.pairs.Rd man/ecop.plot_option.Rd man/ecdb.protectiveCommit.Rd man/ecld.mpnum.Rd man/ecdq-class.Rd man/ecd.manage_hist_tails.Rd man/ecd.pdf.Rd man/history.ecdb.Rd man/read.ecdb.Rd man/ecld.gamma.Rd man/ecd.cusp.Rd man/ecd.fit_ts_conf.Rd man/ecld.ogf.Rd man/ecld.mu_D.Rd man/y_slope.ecd.Rd man/ecld.quartic_Qp.Rd man/ecd.asymp_stats.Rd man/ecdb.Rd man/ecd.data_stats.Rd man/ecop.find_fixed_point_sd_by_lambda.Rd man/ecop.get_ld_triple.Rd man/ecd.ts_lag_stats.Rd man/solve_trig.ecd.Rd man/moment.ecd.Rd man/ecd.uniroot.Rd man/ecld.sged_const.Rd

Questions? Problems? Suggestions? or email at

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

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