phi_ind: Reconstructed values of index constrained curvature measures

Description Usage Format Details See also Source Examples

Description

A list of reconstructed values of index constrained curvature measures; the constraints being of the form r<=ind(x)<=r+s.

Usage

1

Format

A list of lists of vectors containing the reconstructed weights; the element names of the outer list are of the form "beta=_,n=", while the the element names of the inner lists are of the form "r=_,s=", the "_" of course replaced by corresponding values.

Details

The values have been found by the following steps:

See also

constr_eigval, constr_eigval_to_bcbsq, estim_em_cm

Package: symconivol

Source

The values have been computed using the HMC sampler stan and functions from the symconivol package. 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## Not run: 
library(tidyverse)
library(rstan)

warmup <- 1e3
N <- 1e5
filename_model <- "tmp.stan"

nmin <- 3
nmax <- 10
phi_ind <- list()
for (beta in c(1,2,4)) {
    for (n in nmin:nmax) {
        pat <- pat_bnd(beta,n)
        index_out <- str_c("beta=",beta,",n=",n)
        weights <- list()
        for (r in floor((n+1)/2):(n-1)) {
            for (s in 0:(n-1-r)) {
                index_in <- str_c("r=",r,",s=",s)
                np <- r
                nf <- s
                nn <- n-r-s
                M <- constr_eigval(pos=(np>0), free=(nf>0), neg=(nn>0),
                              filename=filename_model, overwrite=TRUE)
                stan_samp <- stan( file = filename_model, data = M$data,
                                   chains = 1, warmup = warmup, iter = N+warmup,
                                   cores = 2, refresh = 1e4 )
                samp <- list()
                if (np>0) samp$ep <- rstan::extract(stan_samp)$ep
                if (nf>0) samp$ef <- rstan::extract(stan_samp)$ef
                if (nn>0) samp$en <- rstan::extract(stan_samp)$en

                m_samp <- constr_eigval_to_bcbsq(pos=(np>0), free=(nf>0), neg=(nn>0),
                                                 samp=samp)

                em <- estim_em_cm(d=pat$d, low=pat$k_low(r), upp=pat$k_upp(r+s),
                                  m_samp=m_samp, N=100)
                weights[[index_in]] <- em[101,]
            }
        }
        phi_ind[[index_out]] <- weights
    }
}
file.remove(filename_model)

## End(Not run)

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