MCdof | R Documentation |
Estimate the distribution of the proportion of spatial locations that contain significant correlations with randomly generated data along the lines of Livezey and Chen (1983).
MCdof(x, ntrials = 5000, field.sig = 0.05, zfun = "rnorm", zfun.args = NULL,
which.test = c("t", "Z", "cor.test"), verbose = FALSE, ...)
sig.cor.t(r, len = 40, ...)
sig.cor.Z(r, len = 40, H0 = 0)
fisherz(r)
x |
n by m numeric matrix whose rows represent temporal points, and whose columns are spatial locations. |
ntrials |
numeric/integer giving the number of times to generate random samples of size n, and correlate them with the columns of |
field.sig |
numeric between 0 and 1 giving the desired fields significance level. |
zfun |
character naming a random number generator that takes |
zfun.args |
list object giving the values for additional arguments to the function named by |
which.test |
character naming which type of test to do (default, “t”, is a t-test, calls |
r |
numeric giving the correlation value(s). |
len |
numeric giving the size of the data for the test. |
H0 |
numeric giving the null hypothesis value (not used by |
verbose |
logical, should progress information (including total run time) be printed to the screen? |
... |
optional arguments to |
This function does the Livezey and Chen (1983) Monte Carlo step 2 (a) from Elmore et al. (2006). It generates a random sample of size n, and finds the p-values of a correlation test with this random sample and each column of x
. From this, it estimates the proportion of spatial locations that could contain significant bias purely by chance.
MCdof returns a list object with components:
MCprops |
numeric vector of length ntrials giving the proportion of locations with significant bias found by chance for each repition of the experiment. |
minsigcov |
single numeric giving the 1 - field.sig quantile of the resulting proportions given by MCprops. |
sig.cor.t and sig.cor.Z return umeric vectors of p-values, and fisherz returns a numeric vector of test statistics.
Kimberly L. Elmore, Kim.Elmore “at” noaa.gov, and Eric Gilleland
Elmore, K. L., Baldwin, M. E. and Schultz, D. M. (2006) Field significance revisited: Spatial bias errors in forecasts as applied to the Eta model. Mon. Wea. Rev., 134, 519–531.
Livezey, R. E. and Chen, W. Y. (1983) Statistical field significance and its determination by Monte Carlo techniques. Mon. Wea. Rev., 111, 46–59.
spatbiasFS
, LocSig
, cor.test
, rnorm
, runif
, rexp
, rgamma
data( "GFSNAMfcstEx" )
data( "GFSNAMobsEx" )
data( "GFSNAMlocEx" )
id <- GFSNAMlocEx[,"Lon"] >=-90 & GFSNAMlocEx[,"Lon"] <= -75 & GFSNAMlocEx[,"Lat"] <= 40
look <- MCdof(GFSNAMfcstEx[,id] - GFSNAMobsEx[,id], ntrials=500)
stats(look$MCprops)
look$minsigcov
fisherz( abs(cor(rnorm(10),rexp(10), use="pairwise.complete.obs")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.