esgcortest: Correlation tests for the shocks

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/tests.R

Description

This function performs correlation tests for the shocks generated by simshocks.

Usage

1
2
3
4
5
6
esgcortest(
  x,
  alternative = c("two.sided", "less", "greater"),
  method = c("pearson", "kendall", "spearman"),
  conf.level = 0.95
)

Arguments

x

gaussian (bivariate) shocks, with correlation, generated by simshocks.

alternative

indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less".

method

which correlation coefficient is to be used for the test : "pearson", "kendall", or "spearman".

conf.level

confidence level.

Value

a list with 2 components : estimated correlation coefficients, and confidence intervals for the estimated correlations.

Author(s)

Thierry Moudiki + stats package

References

D. J. Best & D. E. Roberts (1975), Algorithm AS 89: The Upper Tail Probabilities of Spearman's rho. Applied Statistics, 24, 377-379.

Myles Hollander & Douglas A. Wolfe (1973), Nonparametric Statistical Methods. New York: John Wiley & Sons. Pages 185-194 (Kendall and Spearman tests).

See Also

esgplotbands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
nb <- 500

s0.par1 <- simshocks(n = nb, horizon = 3, frequency = "semi",
family = 1, par = 0.2)

s0.par2 <- simshocks(n = nb, horizon = 3, frequency = "semi", 
family = 1, par = 0.8)

(test1 <- esgcortest(s0.par1))
(test2 <- esgcortest(s0.par2))
par(mfrow=c(2, 1))
esgplotbands(test1)
esgplotbands(test2)

ESGtoolkit documentation built on July 1, 2020, 11:24 p.m.