Last data update: 2014.03.03

R: Quick Plots for DiffusionRgqd Objects
GQD.plotR Documentation

Quick Plots for DiffusionRgqd Objects

Description

GQD.plot() recognizes output objects calculated using routines from the DiffusionRgqd package and subsequently constructs an appropriate plot, for example a perspective plot of a transition density.

Usage

GQD.plot(x, thin = 1, burns, h = FALSE)

Arguments

x

Generic GQD-objects, i.e. res = GQD.density().

thin

Thinning interval for .mcmc objects.

burns

Number of parameter draws to discard for .mcmc objects.

h

if TRUE a histogram is drawn i.s.o. a trace plot.

Value

Varies in accordance with input type.

Author(s)

Etienne A.D. Pienaar: etiannead@gmail.com

References

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

See Also

GQD.mcmc, GQD.mle, GQD.density, BiGQD.density etc.

Examples

  
  # Remove any existing coefficients
  GQD.remove()         
  
  # Define drift Coefficients. Note that the limiting mean is sinusoidal.
  G0 <- function(t){2*(10+sin(2*pi*(t-0.5)))}    
  G1 <- function(t){-2}
  
  # Define sinusoidal diffusion coefficient with `faster' oscillation.
  Q1 <- function(t){0.25*(1+0.75*(sin(4*pi*t)))}
  
  states     <-  seq(5,15,1/10) # State values
  initial    <-  8              # Starting value of the process
  Tmax       <-  5              # Time horizon
  Tstart     <-  1              # Time starts at 1
  increment  <-  1/100          # Incremental time steps
  
  # Generate the transitional density
  M <- GQD.density(Xs=initial,Xt=states,s=Tstart,t=Tmax,delt=increment)
  
  GQD.plot(M)
  

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiffusionRgqd)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiffusionRgqd/GQD.plot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GQD.plot
> ### Title: Quick Plots for DiffusionRgqd Objects
> ### Aliases: GQD.plot
> ### Keywords: plot
> 
> ### ** Examples
> 
>   ## No test: 
>   # Remove any existing coefficients
>   GQD.remove()         
[1] "Removed :  NA "
>   
>   # Define drift Coefficients. Note that the limiting mean is sinusoidal.
>   G0 <- function(t){2*(10+sin(2*pi*(t-0.5)))}    
>   G1 <- function(t){-2}
>   
>   # Define sinusoidal diffusion coefficient with `faster' oscillation.
>   Q1 <- function(t){0.25*(1+0.75*(sin(4*pi*t)))}
>   
>   states     <-  seq(5,15,1/10) # State values
>   initial    <-  8              # Starting value of the process
>   Tmax       <-  5              # Time horizon
>   Tstart     <-  1              # Time starts at 1
>   increment  <-  1/100          # Incremental time steps
>   
>   # Generate the transitional density
>   M <- GQD.density(Xs=initial,Xt=states,s=Tstart,t=Tmax,delt=increment)
                                                                 
 ================================================================
                  Generalized Quadratic Diffusion (GQD)          
 ================================================================
 _____________________ Drift Coefficients _______________________
 G0 : 2*(10+sin(2*pi*(t-0.5)))                                   
 G1 : -2                                                         
 G2                                                              
 ___________________ Diffusion Coefficients _____________________
 Q0                                                              
 Q1 : 0.25*(1+0.75*(sin(4*pi*t)))                                
 Q2                                                              
 __________________ Distribution Approximant ____________________
 Density approx. : Saddlepoint                                   
 P               :                                               
 alpha           :                                               
 Trunc. Order    : 4                                             
 Dens.  Order    : 4                                             
=================================================================
>   
>   GQD.plot(M)
>   
> ## End(No test)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>