Learn R Programming

costat (version 1.1-1)

plotBS: Compute p-value for parametric Monte Carlo test and optionally plot test statistic values

Description

Computes and returns a p-value for the result of a parametric Monte Carlo test. Optionally, plots a histogram of the test statistics (on the original data, and using test statistics resulting from simulations from the null hypothesis distribution).

Usage

plotBS(BS, alpha = 0.05, plot = TRUE, verbose = TRUE, main = "Bootstrap Histogram", xlab = "Test Statistic Values", ylab = "Frequency")

Arguments

BS
The results from a Monte Carlo test. This should be a vector of arbitrary length. The first value must be the value of the test statistic computed on the data. The remaining values are the test statistics computed on simulations constructed under the
alpha
A nominal size for the test. This only effects the reporting. If the computed p-value is less than alpha then the function prints out that the series is not stationary.
plot
If TRUE then a histogram of all the test statistics is produced, with a vertical line showing the position of the test statistic computed on the actual data. If the vertical line is much larger than all the histogram values then this is in
verbose
If TRUE then the p-value is printed and a sentence declaring "stationary" or "not stationary" is printed (relative to the nominal p-value)
main
A main label for the plot, if produced
xlab
An xlab x axis label for the plot, if produced
ylab
An ylab y axis label for the plot, if produced

Value

  • The p-value computed from the Monte Carlo test results is returned

References

`Costationarity and stationarity tests for stock index returns' by Cardinali and Nason.

See Also

myTOS

Examples

Run this code
#
# See example in \code{\link{myTOS}}.
#

Run the code above in your browser using DataLab