Learn R Programming

MaxMC (version 0.1.2)

plot.mmc: Plot a mmc Object

Description

The plot() method for objects of the class mmc gives a plot of the best and current p-value found during the iterations of mmc.

Usage

# S3 method for mmc
plot(x, ...)

Value

The mmc object is returned invisibly.

Arguments

x

An object of class mmc.

...

Arguments to be passed to methods, such as graphical parameters (see par).

Examples

Run this code
## Example
library(fUnitRoots)
# Set seed
set.seed(123)

# Generate an AR(2) process with phi = (-1.5,0.5), and n = 25
y <- filter(rnorm(25), c(-1.5, 0.5), method = "recursive")

# Set bounds for the nuisance parameter v
lower <- -1
upper <- 1

# Set the function to generate an AR(2) integrated process
dgp <- function(y, v) {
    ran.y <- filter(rnorm(length(y)), c(1-v,v), method = "recursive")
}

# Set the Augmented-Dicky Fuller statistic
statistic <- function(y){
    out <- suppressWarnings(adfTest(y, lags = 2, type = "nc"))
    return(out@test$statistic)
}

# Apply the mmc procedure
est <- mmc(y, statistic = statistic , dgp = dgp, lower = lower,
           upper = upper, N = 99, type = "leq", method = "GenSA",
           control = list(max.time = 2))

# Plot result of object of class 'mmc'
plot(est)

Run the code above in your browser using DataLab