BiJGQD.mcmc()
uses parametrised coefficients (provided by the user as R-functions) to construct a C++ program in real time that allows the user to perform Bayesian inference on the resulting diffusion model. Given a set of starting parameters and other input parameters, a MCMC chain is returned for further analysis. The user may specify any model within the JGQD framework by defining parametrised functions giving the form of the coefficients of the model.
That is, BiJGQD.density generates approximate transitional densities for a class of bivariate jump diffusion processes with SDE:BivJumpDiff1.png
where
BivJumpDiff4.png
BivJumpDiff3.png
and
BivJumpDiff2.png
describes a bivariate Poisson process with jump matrix:
BivJumpDiff5.png
and intensity vector
BivJumpDiff6.png
BiJGQD.mcmc(X, time, mesh = 10, theta, sds, updates = 10, burns = min(round(updates/2),25000), exclude = NULL, plot.chain = TRUE, RK.order = 4, wrt = FALSE, Tag = NA, Dtype = "Saddlepoint", Jdist = "MVNormal", Jtype ='Add', adapt = 0, print.output = TRUE, decode = TRUE, palette = 'mono')
time
gives the time signature for both dimensions).
sds
[i]^2).
NULL
.Tag
can be used to name (tag) an MCMC run e.g. Tag='Run_1'
"Saddlepoint"
(default), "Edgeworth"
or "Normal"
.TRUE
a .cpp file will be written to the current directory. For bug report diagnostics.TRUE
information about the model and algorithm is printed to the console. TRUE
. palette = 'mono'
, otherwise a qualitative palette will be used.theta
. For example: a00 <- function(t){theta[1]*(theta[2]+sin(2*pi*(t-theta[3])))}
. Synt. [2]: Due to syntactical differences between R and C++ special functions have to be used when terms that depend on t
. When the function cannot be separated in to terms that contain a single t
, the prod(a,b)
function must be used. For example: a00 <- function(t){0.1*(10+0.2*sin(2*pi*t)+0.3*prod(sqrt(t),1+cos(3*pi*t)))}
. Here sqrt(t)*cos(3*pi*t) constitutes the product of two terms that cannot be written i.t.o. a single t
. To circumvent this isue, one may use the prod(a,b)
function. Synt. [3]: Similarly, the ^ - operator is not overloaded in C++. Instead the pow(x,p)
function may be used to calculate x^p. For example sin(2*pi*t)^3 in: a00 <- function(t){0.1*(10+0.2*pow(sin(2*pi*t),3))}
.mesh
is used to discretize the transition horizons between successive observations. It is thus important to ensure that mesh
is not too small when large time differences are present in time
. Check output for max(dt) and divide by mesh
. Daniels, H.E. 1954 Saddlepoint approximations in statistics. Ann. Math. Stat., 25:631--650.
Eddelbuettel, D. and Romain, F. 2011 Rcpp: Seamless R and C++ integration. Journal of Statistical Software, 40(8):1--18,. URL http://www.jstatsoft.org/v40/i08/.
Eddelbuettel, D. 2013 Seamless R and C++ Integration with Rcpp. New York: Springer. ISBN 978-1-4614-6867-7.
Eddelbuettel, D. and Sanderson, C. 2014 Rcpparmadillo: Accelerating R with high-performance C++ linear algebra. Computational Statistics and Data Analysis, 71:1054--1063. URL http://dx.doi.org/10.1016/j.csda.2013.02.005.
Feagin, T. 2007 A tenth-order Runge-Kutta method with error estimate. In Proceedings of the IAENG Conf. on Scientifc Computing.
Varughese, M.M. 2013 Parameter estimation for multivariate diffusion systems. Comput. Stat. Data An., 57:417--428.
JGQD.remove
and JGQD.mcmc
.
#===============================================================================
# For detailed notes and examples on how to use the BiJGQD.mcmc() function, see
# the following vignette:
RShowDoc('Part_4_Likelihood_Inference',type='html','DiffusionRjgqd')
#===============================================================================
Run the code above in your browser using DataLab