Description Usage Arguments Details Value Source References See Also Examples
fit.nb.inar1
fits data using the maximum likelihood of a reparametrized NB-INAR(1) model.
1 2 3 4 5 6 7 |
x |
a matrix or data frame containing count data which is to be fitted. Columns correspond to time points, rows to observations. |
lower |
vector of lower bounds for estimated parameters |
upper |
vector of upper bounds for estimated parameters |
method |
algorithm used for minimization of the likelihood, see |
start |
vector of starting values for estimated parameters |
the function fit.nb.inar1
fits a reparametrization of the NB-INAR(1) model as found in McKenzie (1986). The reparametrized model
assumes equal means and dispersion parameter between time points with an autoregressive correlation structure. The function is especially useful
for estimating parameters for an initial sample size calculation using n.nb.inar1
. The fitting function allows for incomplete follow up,
but not for intermittent missingness.
fit.nb.inar1
return estimates of the mean mu
, dispersion parameter size
and correlation coefficient rho
.
fit.nb.inar1
uses code contributed by Thomas Asendorf.
McKenzie Ed (1986), Autoregressive Moving-Average Processes with Negative-Binomial and Geometric Marginal Distributions. Advances in Applied Probability Vol. 18, No. 3, pp. 679-705.
rnbinom.inar1
for information on the NB-INAR(1) model, n.nb.inar1
for calculating
initial sample size required when performing inference, bssr.nb.inar1
for blinded
sample size reestimation within a running trial, optim
for more information on the used minimization algorithms.
1 2 3 4 5 6 | #Generate data from the NB-INAR(1) model
set.seed(8)
random<-rnbinom.inar1(n=1000, size=1.5, mu=2, rho=0.6, tp=7)
estimate<-fit.nb.inar1(random)
estimate
|
Loading required package: mvtnorm
Loading required package: multcomp
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS
Attaching package: 'TH.data'
The following object is masked from 'package:MASS':
geyser
Loading required package: Rcpp
Loading required package: geepack
mu size rho
1.9814528 1.5001866 0.6065152
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.