init_grid: Define starting points in parameter space.

Description Usage Arguments Value Examples

Description

This function is exported from the blackbox package. It samples the space of estimated parameters. Also handles other fixed arguments that need to be passed to the function simulating the summary statistics (sample size is likely to be one such argument). The current sampling strategy is crude but achieves three desirable effects: It tries to sample the space uniformly, avoiding large gaps; it is not exactly a regular grid; and it includes replicates of some parameter points, required for good smoothing of the likelihood surface.

Usage

1
2
3
4
init_grid(lower=c(par=0), upper=c(par=1), steps=NULL, 
          nUnique=NULL, nRepl=min(10L,nUnique),
          jitterFac=0.5
         )

Arguments

lower

A vector of lower bounds for the parameters, as well as fixed arguments to be passed to the function simulating the summary statistics. Elements must be named. Fixed parameters character strings.

upper

A vector of upper bounds for the parameters, as well as fixed parameters. Elements must be named and match those of lower.

steps

Number of steps of the grid, in each dimension of estimated parameters. If NULL, a default value is defined from the other arguments. If a single value is given, it is applied to all dimensions. Otherwise, this must have the same length as lower and upper and named in the same way as the variable parameters in these arguments.

nUnique

Number of distinct values of parameter vectors in output. Default is an heuristic guess for good start from not too many points, computed as floor(50^((v/3)^(1/3))) where v is the number of variable parameters.

nRepl

Number of replicates of distinct values of parameter vectors in output.

jitterFac

Controls the amount of jitter of the points around regular grid nodes. The default value 0.5 means that a mode can move by up to half a grid step (independently in each dimension), so that two adjacent nodes moved toward each other can (almost) meet each other.

Value

A data frame. Each row defines a list of arguments of vector of the function simulating the summary statistics.

Examples

1
2
3
4
5
set.seed(123)
init_grid()
init_grid(lower=c(mu=2.8,s2=0.5,sample.size=20),
          upper=c(mu=5.2,s2=4.5,sample.size=20),
          steps=c(mu=7,s2=9),nUnique=63)

Example output

Infusion (version 1.3.0) is loaded.
Type 'help(Infusion)' for a short introduction,
and see http://kimura.univ-montp2.fr/~rousset/Infusion.htm
for more documentation.
           par
1   0.01917183
2   0.11922034
3   0.16059846
4   0.25886783
5   0.32936449
6   0.33637043
7   0.43520703
8   0.52616127
9   0.57009567
10  0.63044098
11  0.73045556
12  0.76355561
13  0.84517138
14  0.90484223
15  0.94019498
141 0.90484223
41  0.25886783
16  0.01917183
151 0.94019498
111 0.73045556
91  0.57009567
71  0.43520703
61  0.33637043
101 0.63044098
121 0.76355561
          mu        s2 sample.size
1   3.042925 0.8939862          20
2   3.329394 0.5778012          20
3   3.689420 0.5580870          20
4   3.927712 0.7902675          20
5   4.221868 0.6526740          20
6   4.844465 0.7918925          20
7   5.166503 0.6423881          20
8   3.036813 1.0278627          20
9   3.415589 1.2921308          20
10  3.494153 0.9860422          20
11  3.992387 1.1519018          20
12  4.431472 1.1717802          20
13  4.588483 1.2111062          20
14  4.966233 1.0923660          20
15  2.879415 1.6060502          20
16  3.191817 1.8130995          20
17  3.627844 1.6035122          20
18  3.970420 1.7846001          20
19  4.297890 1.7953059          20
20  4.566552 1.6594378          20
21  4.904734 1.5714177          20
22  2.879897 1.8987088          20
23  3.302616 2.2490221          20
24  3.576905 1.9672128          20
25  4.122684 1.8603203          20
26  4.187142 2.2545453          20
27  4.665897 2.1535983          20
28  5.131060 1.8965752          20
29  2.841794 2.5219043          20
30  3.335182 2.7018183          20
31  3.556525 2.5379926          20
32  3.872297 2.4575601          20
33  4.429706 2.5657304          20
34  4.821158 2.4199203          20
35  4.985530 2.4145422          20
36  3.028039 2.8198967          20
37  3.175374 2.8864395          20
38  3.617361 3.1596530          20
39  3.922646 2.7907566          20
40  4.450734 2.7626862          20
41  4.668063 2.7852920          20
42  5.134879 3.0288920          20
43  3.078534 3.4418918          20
44  3.415203 3.5628418          20
45  3.636514 3.4657774          20
46  4.087249 3.4942568          20
47  4.387162 3.3982825          20
48  4.757777 3.4599282          20
49  4.857357 3.5319135          20
50  2.962966 3.9605696          20
51  3.218326 4.0465875          20
52  3.615937 3.8064140          20
53  4.038664 3.7496454          20
54  4.292045 3.7931000          20
55  4.552389 3.6157632          20
56  4.940670 3.6928220          20
57  3.029048 4.4301019          20
58  3.286050 4.1582941          20
59  3.755953 4.1618222          20
60  3.863839 4.0896405          20
61  4.320535 4.1647661          20
62  4.851985 4.3809490          20
63  5.163332 4.4322014          20
321 3.872297 2.4575601          20
251 4.122684 1.8603203          20
161 3.191817 1.8130995          20
71  5.166503 0.6423881          20
241 3.576905 1.9672128          20
341 4.821158 2.4199203          20
131 4.588483 1.2111062          20
621 4.851985 4.3809490          20
121 4.431472 1.1717802          20
281 5.131060 1.8965752          20

Infusion documentation built on Feb. 22, 2021, 9:08 a.m.

Related to init_grid in Infusion...