semimrBin | R Documentation |
‘semimrBin’ is used for semiparametric estimation of a mixture of binomial distributions with one degenerate component, with time-varying proportions and time-varying success probability (Cao and Yao, 2012).
semimrBin(t, x, N, tg = NULL, tune = 1, tol = 1e-02)
t |
a vector of time variable along which |
x |
a vector of observed number of successes. The length of |
N |
a scalar, specifying the number of trials for the Binomial distribution. |
tg |
grid points of time used in the kernel regression for the estimation of |
tune |
a scalar related to the bandwidth selection and local estimation. Default is 1. If greater than 0.2, the bandwidth is found based on the method in Cao and Yao (2012). If smaller than or equal to 0.2, this value is used as the percentage of data included in local estimation. |
tol |
stopping criteria for the algorithm. |
The semiparametric mixture of binomial regression model is as follows:
w(t) \times B(N,p(t))+(1-w(t))\times B(N,0),
where B(N,p)
is the probability mass function of a binomial distribution
with the number of trials N
and the success probability p
.
Here, the second component is a degenerate distribution with mass 1 on 0.
The time-varying proportion w(t)
and success probability p(t)
for the binomial components
are estimated by the kernel regression with some bandwidth.
A list containing the following elements:
pt |
estimated time-varying success probabilities for the first component. |
wt |
estimated time-varying proportions for the first component. |
h |
bandwidth for the kernel regression. The bandwidth calculation can be found in Section 4 of Cao and Yao (2012). |
Cao, J. and Yao, W. (2012). Semiparametric mixture of binomial regression with a degenerate component. Statistica Sinica, 27-46.
semimrBinOne
, semimrBinFull
n = 100
tg = seq(from = 0, to = 1, length.out = 50)
t = seq(from = 0, to = 1, length.out = n)
pt = 0.5 * (1 - cos(2 * pi * t))
b = rbinom(n, 1, 0.2)
y = apply(X = matrix(pt), 1, rbinom, n = 1, size = 7)
y = ifelse(b == 1, 0, y)
ft = semimrBin(t = t, x = y, N = 7, tg = tg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.