Description Usage Arguments Details Value Author(s) References Examples

`extract.gb.density`

extracts the generalized beta density from market options.

1 2 3 |

`initial.values` |
initial values for the optimization |

`r` |
risk free rate |

`te` |
time to expiration |

`y` |
dividend yield |

`s0` |
current asset value |

`market.calls` |
market calls (most expensive to cheapest) |

`call.strikes` |
strikes for the calls (smallest to largest) |

`call.weights` |
weights to be used for calls |

`market.puts` |
market calls (cheapest to most expensive) |

`put.strikes` |
strikes for the puts (smallest to largest) |

`put.weights` |
weights to be used for puts |

`lambda` |
Penalty parameter to enforce the martingale condition |

`hessian.flag` |
if F, no hessian is produced |

`cl` |
list of parameter values to be passed to the optimization function |

This function extracts the generalized beta density implied by the options.

`a` |
extracted power parameter |

`b` |
extracted scale paramter |

`v` |
extracted first beta paramter |

`w` |
extracted second beta parameter |

`converge.result ` |
Did the result converge? |

`hessian` |
Hessian matrix |

Kam Hamidieh

R.M. Bookstaber and J.B. McDonald (1987)
A general distribution for describing security price returns.
*Journal of Business*, 60, 401-424

X. Liu and M.B. Shackleton and S.J. Taylor and X. Xu (2007)
Closed-form transformations from risk-neutral to real-world distributions
*Journal of Business*, 60, 401-424

E. Jondeau and S. Poon and M. Rockinger (2007):
*Financial Modeling Under Non-Gaussian Distributions*
Springer-Verlag, London

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ```
#
# create some GB based calls and puts
#
r = 0.03
te = 50/365
k = seq(from = 800, to = 1200, by = 10)
a = 10
b = 1000
v = 2.85
w = 2.85
y = 0.01
s0 = exp((y-r)*te) * b * beta(v + 1/a, w - 1/a)/beta(v,w)
s0
call.strikes = seq(from = 800, to = 1200, by = 10)
market.calls = price.gb.option(r = r, te = te, y = y, s0 = s0,
k = call.strikes, a = a, b = s0, v = v, w = w)$call
put.strikes = seq(from = 805, to = 1200, by = 10)
market.puts = price.gb.option(r = r, te = te, y = y, s0 = s0,
k = put.strikes, a = a, b = s0, v = v, w = w)$put
#
# Extraction...should match the a,b,v,w above. You will also get warning messages.
# Weigths are automatically set to 1.
#
extract.gb.density(r=r, te=te, y = y, s0=s0, market.calls = market.calls,
call.strikes = call.strikes, market.puts = market.puts,
put.strikes = put.strikes, lambda = 1, hessian.flag = FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.