plot.mmc | R Documentation |
mmc
ObjectThe plot()
method for objects of the
class mmc
gives a plot of the best and current p-value found during the iterations of mmc
.
## S3 method for class 'mmc'
plot(x, ...)
x |
An object of class |
... |
Arguments to be passed to methods, such as graphical parameters (see |
The mmc
object is returned invisibly.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.