| sns.fghEval.numaug | R Documentation |
Augmenting a log-density with numerical gradient and Hessian, so it can be used by sns or sns.run. This augmentation will also be done inside the function, if the value of numderiv parameter passed to sns and sns.run is 1 or 2. The advantage of using sns.fghEval.numaug outside these functions is efficiency, since the agumentation code will not have to be executed in every function call. Users must set numderiv to 0 when calling sns or sns.run if calling sns.fghEval.numaug first. See example.
sns.fghEval.numaug(fghEval, numderiv = 0
, numderiv.method = c("Richardson", "simple")
, numderiv.args = list())
fghEval |
Log-density to be sampled from. A valid log-density can have one of 3 forms: 1) return log-density, but no gradient or Hessian, 2) return a list of |
numderiv |
This must be matched with |
numderiv.method |
Method used for numeric differentiation. This is passed to the |
numderiv.args |
Arguments to the numeric differentiation method chosen in |
A function, accepting same arguments as fghEval, but guaranteed to return the original log-density, plus gradient and Hessian (both of which could possibly by numerically calculated). If numderiv=0, fghEval is returned without change. The function will return log-density, gradient and Hessian as elements f, g and h of a list.
See package vignette for more details on SNS theory, software, examples, and performance.
Alireza S. Mahani, Asad Hasan, Marshall Jiang, Mansour T.A. Sharabiani
Mahani A.S., Hasan A., Jiang M. & Sharabiani M.T.A. (2016). Stochastic Newton Sampler: The R Package sns. Journal of Statistical Software, Code Snippets, 74(2), 1-33. doi:10.18637/jss.v074.c02
sns, sns.run
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.