Learn R Programming

DiffusionRgqd (version 0.1.3)

GQD.aic: Summarize MLE Selection Output for a List of GQD.mle or BiGQD.mle objects.

Description

GQD.aic() summarizes the MCMC output from a list of GQD.mle() objects. This may be used to neatly summarize the MCMC output of various models fitted to a given dataset.

Usage

GQD.aic(model.list, type = "col")

Arguments

model.list
A list of GQD.mle() objects.
type
Shoould output be of row ('row') or column ('col') format.

Value

Details

GQD.aic() summarizes the output from various models fitted via GQD.mle(). By ranking them according to DIC. [=] indicates which model has the minimal DIC.
Convergence p min.likelihood AIC BIC
N Model 1 0 5 171.5576 [=] 353.1152
[=] 369.6317 201 Model 2 0 5 185.7518
381.5036 398.0201 201 Convergence p

References

Updates available on GitHub at https://github.com/eta21.

See Also

GQD.mle

Examples

Run this code

#===============================================================================
# Simulate a time inhomogeneous diffusion.
#-------------------------------------------------------------------------------

  data(SDEsim1)
  attach(SDEsim1)
  par(mfrow=c(1,1))
  expr1=expression(dX[t]==2*(5+3*sin(0.5*pi*t)-X[t])*dt+0.5*sqrt(X[t])*dW[t])
  plot(Xt~time,type='l',col='blue',xlab='Time (t)',ylab=expression(X[t]),main=expr1)

 #------------------------------------------------------------------------------
 # Define coefficients of the process.
 #------------------------------------------------------------------------------

  GQD.remove()
  G0 <- function(t){theta[1]*(theta[2]+theta[3]*sin(0.25*pi*t))}
  G1 <- function(t){-theta[1]}
  Q0 <- function(t){theta[4]*theta[4]}

  theta.start  <- c(1,1,1,1)                      # Starting values for the chain
  mesh.points  <- 10                              # Number of mesh points

  m1 <- GQD.mle(Xt,time,mesh=mesh.points,theta=theta.start)

  GQD.remove()

  G1 <- function(t){theta[1]*(theta[2]+theta[3]*sin(0.25*pi*t))}
  G2 <- function(t){-theta[1]}
  Q2 <- function(t){theta[4]*theta[4]}

  theta.start  <- c(1,1,1,1)                      # Starting values for the chain
  mesh.points  <- 10                              # Number of mesh points

  m2 <- GQD.mle(Xt,time,mesh=mesh.points,theta=theta.start)

  # Check estimates:
  GQD.estimates(m1)
  GQD.estimates(m2)

  # Compare models:
  GQD.aic(list(m1,m2))

#===============================================================================

Run the code above in your browser using DataLab