plot.mmc: Plot a 'mmc' Object

Description Usage Arguments Value Examples

View source: R/plot.R

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

1
2
## S3 method for class 'mmc'
plot(x, ...)

Arguments

x

An object of class mmc.

...

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

Value

The mmc object is returned invisibly.

Examples

 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
## 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)

MaxMC documentation built on May 1, 2019, 10:16 p.m.