Description Usage Arguments Value Author(s) References See Also Examples
GQD.estimates()
calculates parameter estimates from .mle()
or .mcmc()
model objects.
1 2 | GQD.estimates(x, thin = 100, burns, CI = c(0.05, 0.95), corrmat =
FALSE, acf.plot = TRUE, palette = 'mono')
|
x |
List object of type 'GQD.mcmc' or 'GQD.mle'. That is, when |
thin |
Thinnging level for parameter chain. |
burns |
Number of MCMC updates to discard before calculating estimates. |
CI |
Credibility interval quantiles (for MCMC chains). |
corrmat |
If TRUE, an estimated correlation matrix is returned in addition to the estimate vector. |
acf.plot |
If TRUE, an acf plot is drawn for each element of the parameter chain. |
palette |
Colour palette for drawing trace plots. Default |
Data frame with parameter estimates and appropriate interval statistics.
Etienne A.D. Pienaar: etiannead@gmail.com
Updates available on GitHub at https://github.com/eta21.
GQD.mcmc
, GQD.mle
, BiGQD.mcmc
and BiGQD.mle
.
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 33 34 35 36 37 38 39 40 41 42 | #===============================================================================
# This example simulates a time inhomogeneous diffusion and shows how to conduct
# inference using GQD.mcmc
#-------------------------------------------------------------------------------
library(DiffusionRgqd)
data(SDEsim1)
par(mfrow=c(1,1))
x <- SDEsim1
plot(x$Xt~x$time,type='l',col='blue')
#------------------------------------------------------------------------------
# Define parameterized coefficients of the process, and set up starting
# parameters.
# True model: dX_t = 2(5+3sin(0.25 pi t)-X_t)dt+0.5sqrt(X_t)dW_t
#------------------------------------------------------------------------------
# Remove any existing coeffients. If none are pressent NAs will be returned, but
# this is a safeguard against overlapping.
GQD.remove()
# Define time dependant coefficients. Note that all functions have a single argument.
# This argument has to be `t' in order for the dependancy to be recognized.
# theta does not have to be defined as an argument.
G0 <- function(t){theta[1]*(theta[2]+theta[3]*sin(0.25*pi*t))}
G1 <- function(t){-theta[1]}
Q1 <- function(t){theta[4]*theta[4]}
theta.start <- c(1,1,1,1) # Starting values for the chain
proposal.sds <- c(0.4,0.3,0.2,0.1)*1/2 # Std devs for proposal distributions
mesh.points <- 10 # Number of mesh points
updates <- 50000 # Perform 50000 updates
#------------------------------------------------------------------------------
# Run the MCMC procedure for the model defined above
#------------------------------------------------------------------------------
m1 <- GQD.mcmc(x$Xt,x$time,mesh=mesh.points,theta=theta.start,sds=proposal.sds,
updates=updates)
# Calculate estimates:
GQD.estimates(m1,thin=200)
#===============================================================================
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.