ind_prob: Ratios of index probabilities

Description Usage Format Details See also Source Examples

Description

A list of sample counts of a Bernoulli variable with (unnormalized) success and failure probabilities given by Prob{ind=r} and Prob{ind=r+1}.

Usage

1

Format

A list of two-element integer vectors.

Details

The values of the parameters beta, n, r are specified in the names of the list elements, which are of the form beta=_,n=_,r=_ with _ replaced by values. The list contains all combinations of beta=1,2,4, n=4,5,...,10, and r between floor((n+1)/2) and n-2. The remaining values can be found through the relation Prob{ind=r}=Prob{ind=n-r}.

See also

constr_eigval

Package: symconivol

Source

The samples have been found with the HMC sampler Stan with a model that simulates the eigenvalues of a Gaussian orthogonal/unitary/symplectic ensemble with index constrained to {r,r+1}. The code below shows how this data can be generated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
library(rstan)

ind_prob <- list()
nmin <- 4
nmax <- 10
filename <- "tmp.stan"
N <- 1e6
warmup <- 1e3
for (n in nmin:nmax) {
    for (beta in c(1,2,4)) {
        for (r in floor((n+1)/2):(n-2)) {
            index <- str_c("beta=",beta,",n=",n,",r=",r)
            M <- constr_eigval(beta, n, r, r+1, filename=filename)
            stan_samp <- stan( file = filename, data = M$data,
                               chains = 1, warmup = warmup,
                               iter = N+warmup, cores = 2, refresh = 1e4 )
            ef <- rstan::extract(stan_samp)$ef
            indprob[[index]] <- c(length(which(ef<0)),length(which(ef>0)))
        }
    }
}
file.remove(filename)

## End(Not run)

damelunx/symconivol documentation built on May 17, 2019, 7:01 p.m.