find.scheme: Search for the global optimal grouping scheme of grouped...

Description Usage Arguments Details Value Author(s) References Examples

Description

Given the prior distribution (or values) of parameters, and the total/maximum number of groups (N) allowed for grouping schemes, this function finds the global optimal grouping scheme that makes the sampling process most informative.

Usage

1
2
3
4
5
find.scheme(N,
  densityFUN, lambda.lwr, lambda.upr, p.lwr, p.upr,
  probs, lambdas, ps,
  is.0.isolated = TRUE, model = c("Poisson", "ZIP"),
  matSc = c("A", "D", "E"), M = "auto")

Arguments

N

(maximum) number of groups allowed for all grouping schemes. A non-integral value will be coerced to an integer.

densityFUN, lambda.lwr, lambda.upr, p.lwr, p.upr

prior information of parameters in a continuous form. These parameters denote the prior probability density function (optional), the lower bound of λ (for Poisson models), the higher bound of λ (for Poisson models), the lower bound of p (optional for ZIP models), the higher bound of p (optional for ZIP models), respectively.

probs, lambdas, ps

prior information of the parameters in a discrete form. These parameters are vectors denoting the mass probabilities, the corresponding values of λ and p (optional), respectively.

is.0.isolated

a logical value indicating whether zero is contained and only contained in a single group.

model

underlying Poisson models to be used for optimal designs: Poisson or ZIP. The default value is Poisson.

matSc

A character indicating types of optimality functions of the Fisher information (matrix). It must be one from the three letters: A, D, and E. In particular, if J is the 2-by-2 Fisher information matrix, then

"A" or A-optimality maximizes 1/\mathrm{tr}(J^{-1});

"D" or D-optimality maximizes \mathrm{det}(J);

"E" or E-optimality maximizes the minimum eigenvalue of J.

M

a sufficiently large integer needed to facilitate the search, or a character "auto". Theoretically, it could be the lowest integer contained in the last right-censored group of the global optimal grouping scheme. A non-integral value will be coerced to an integer. If M is set to be "auto", the algorithm takes longer time to converge because it will automatically determine M and return the global optimal grouping scheme; The default value of M is "auto".

Details

This function tries to find the N-group scheme maximizing Fisher information (matrix). If model is specified as Poisson, p.lwr or p.upr will be ignored. When the prior distribution is discrete, lambdas specify discrete values that λ may take, and probs specify probabilities associated with p. In the ZIP model, lambdas and ps specify discrete values that λ and p may take, respectively. probs denotes joint mass probabilities associated with (λ, p). The values of (p.lwr, p.upr) cannot be (0, 1) as the algorithm will not converge. Instead, approximate values, such as (0.000001, 0.999999), can be used.

A sufficiently large integer M should be provided by the user so that infinitely many grouping schemes could be handled by the search algorithm. M is in theory the lowest integer to be contained in the last right-censored group of the global optimal grouping scheme. In practice, the choice of M should be slightly higher than its theoretical value because the search algorithem is designed in a way that it prevents any acceptance of a false optimal solution at the cost of tolerating false rejection of the correct optimal grouping scheme. This idea is implemented by a logical indicator succeed in the output. Its value will be TRUE if the real optimal grouping scheme is identified. Otherwise, a FALSE output means that M is not large enough to gurantee that the grouping scheme yielded by the search algorithm is the global optimal grouping scheme. Researchers then need to select a larger M and repeat this process until the logical indicator succeed becomes TRUE. Alternatively, users may use the "auto" option so that this iterative process will be automatically implemented.

Value

The returned value is a list with components.

best.scheme.compact, best.scheme.loose, best.scheme.innerCode

the same optimal grouping scheme is printed in various forms.

succeed

see Details. This is a logical variable. The global optimal grouping scheme is obtained if it is TRUE; a larger M needs to be selected for a successful search if it is FALSE.

Author(s)

Xin Guo <x.guo@polyu.edu.hk>, Qiang Fu <qiang.fu@ubc.ca>

References

Qiang Fu, Xin Guo and Kenneth C. Land. Conditionally accepted. "Optimizing Count Responses in Surveys: A Machine-Learning Approach." Sociological Methods & Research.

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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Example 1 ####################################
# M=7, N=3, 0 is not required to be contained
# in a separate group of grouping schemes.
# Poisson model, lambda takes 4 and 5 and each value has a probability of 0.5.
find.scheme(probs = c(0.5, 0.5), lambdas = c(4,5),
  M = 7, N = 3, is.0.isolated = FALSE, model = "Poisson")

# Example 2 ####################################
# N=3, 0 is required to be contained in a separate group of grouping schemes.
# Poisson model, lambda takes 4 and 5 and each value has a probability of 0.5.
# M is not given, so it will be selected automatically.
find.scheme(probs = c(0.5, 0.5), lambdas = c(4,5),
  N = 3, is.0.isolated = TRUE, model = "Poisson")

# Example 3 ####################################
# M=7, N=3, 0 is not required to be contained in a separate group.
# ZIP model, (lambda, p) take (4, 0.3) and (5, 0.4)
# with their probabilities denoted by c(0.5, 0.5)

find.scheme(probs = c(0.5, 0.5), lambdas = c(4,5), ps = c(0.3, 0.5),
  M = 7, N = 3, is.0.isolated = FALSE, model = "ZIP")


# Example 4 ####################################
# N=3, 0 is not required to be contained in a separate group.
# Poisson model, lambda takes a normal distribution truncated to [1, 10]
# M is not given, so it will be selected automatically.

find.scheme(densityFUN = function(lambda)
  dnorm(lambda, mean = 3, sd = 1),
  lambda.lwr = 1, lambda.upr = 10,
  N = 3, is.0.isolated = FALSE, model = "Poisson")


# Example 5 ####################################
# M=7, N=3, 0 is required to be contained in a separate group.
# Poisson model, lambda takes a normal distribution truncated to [1, 10]

find.scheme(densityFUN = function(lambda)
  dnorm(lambda, mean = 3, sd = 1),
  lambda.lwr = 1, lambda.upr = 10,
  M = 7, N = 3, is.0.isolated = TRUE, model = "Poisson")


# Example 6 ####################################
# N=3, 0 is required to be contained in a separate group.
# Poisson model, lambda takes an uniform distribution on [1, 10]
# M is not given, so it will be selected automatically.
find.scheme(densityFUN = function(lambda)
  dunif(lambda, min = 1, max = 10),
  lambda.lwr = 1, lambda.upr = 10,
  N = 3, is.0.isolated = TRUE, model = "Poisson")

# Example 7 #################################
# M=7, N=3, 0 is required to be contained in a separate group.
# ZIP model, (lambda, p) has an uniform distribution with
# lambda on [1,10] and p on [0.1, 0.9]

find.scheme(densityFUN = function(...) 1,
  lambda.lwr = 1, lambda.upr = 10, p.lwr = 0.0001, p.upr = 0.9999,
  M = 7, N = 3, is.0.isolated = TRUE, model = "ZIP")


# Example 8 ####################################
# M=7, N=3, 0 is required to be contained in a separate group.
# ZIP model, (lambda, p) has a normal distribution centered
# at (5.5, 0.5) with a covariance matrix showing their correlation
#    /                 \
#    |  11/3      3    |
#    |    3     11/3   |
#    \                 /.
# This normal distribution is also truncated to
# [1, 10] X [0.1, 0.9]
# Note: this example may take several minutes to converge,
# depending on your computer configuration.

dsty <- function(lambda, p){
  vec <- c(lambda - 5.5, p - 0.5)
  mat <- matrix(c(11/3,3,3,11/3), nrow = 2, ncol = 2)
  pw <- -0.5 * sum(vec * solve(mat, vec))
  return(exp(pw))
}
find.scheme(densityFUN = dsty,
  lambda.lwr = 1, lambda.upr = 10, p.lwr = 0.1, p.upr = 0.9,
  M = 7, N = 3, is.0.isolated = TRUE, model = "ZIP")

GRCdata documentation built on May 2, 2019, 9:24 a.m.