Learn R Programming

NNS (version 10.0)

NNS.MC: NNS Monte Carlo Sampling

Description

Monte Carlo sampling from the maximum entropy bootstrap routine NNS.meboot, ensuring the replicates are sampled from the full [-1,1] correlation space.

Usage

NNS.MC(
  x,
  reps = 30,
  rho = c(-1, 1),
  step = 0.01,
  exp = 1,
  type = "spearman",
  drift = TRUE,
  xmin = NULL,
  xmax = NULL,
  ...
)

Value

  • ensemble average observation over all replicates as a vector.

  • replicates maximum entropy bootstrap replicates as a list for each rho.

Arguments

x

vector of data.

reps

numeric; number of replicates to generate, 30 default.

rho

vector c(-1,1); The default setting assumes that the user wants to sample from the full correlation spectrum [-1,1].

step

numeric; .01 default will set the by argument in seq(-1, 1, step).

exp

numeric; 1 default will exponentially weight maximum rho value if exp > 1.

type

options("spearman", "pearson", "NNScor", "NNSdep"); type = "spearman"(default) dependence metric desired.

drift

logical; TRUE default preserves the drift of the original series.

xmin

numeric; the lower limit for the left tail.

xmax

numeric; the upper limit for the right tail.

...

possible additional arguments to be passed to NNS.meboot.

References

Vinod, H.D. and Viole, F. (2020) Arbitrary Spearman's Rank Correlations in Maximum Entropy Bootstrap and Improved Monte Carlo Simulations https://www.ssrn.com/abstract=3621614

Examples

Run this code
if (FALSE) {
# To generate a set of MC sampled time-series to AirPassengers
MC_samples <- NNS.MC(AirPassengers, xmin = 0)
}

Run the code above in your browser using DataLab