View source: R/InternalTrajeR.R
| trajeR.ZIP | R Documentation |
Internal function to fit ZIP Model
trajeR.ZIP(
Y,
A,
X,
TCOV,
ng,
nx,
n,
nbeta,
nw,
ntheta,
period,
degre,
degre.nu,
theta,
beta,
nu,
delta,
pi,
Method,
hessian,
itermax,
paraminit,
EMIRLS,
refgr,
control
)
Y |
Matrix, Formula, or a list of Formulas. A matrix containing the response variables, a single formula (e.g., |
A |
Matrix. A matrix containing the time variable data. Can be omitted if specified in the RHS of the |
X |
Matrix. The matrix of covariates modifying group membership probability. Includes an intercept. |
TCOV |
Matrix or Formula. An optional matrix (or one-sided formula) containing time-dependent covariates that influence the trajectories. |
ng |
Integer. The number of groups. Required if using a single formula or if 'degre' is not provided. |
nx |
Integer. The number of covariates. |
n |
Integer. Number of individuals. |
nbeta |
Vector of integers. Number of beta parameters for each group. |
nw |
Integer. Number of time-dependent covariates. |
ntheta |
Integer. Number of theta parameters for each group. |
period |
Integer. Number of measurement time points. |
degre |
Vector of integers. The degree of each polynomial function. The code adds 1 to these values internally. |
degre.nu |
Vector of integers. The degree of the polynomial for the zero-inflation part of a ZIP model. |
theta |
Vector of real. Initial parameters for group membership probability. |
beta |
List of vectors. Initial beta parameters for each group's trajectory. |
nu |
List of vectors. Initial nu parameters for the zero-inflation part. |
delta |
List of vectors. Initial delta parameters for time-dependent covariates. |
pi |
Vector of real. Initial group membership probabilities. |
Method |
String. The estimation method. "L" for Likelihood, "EM" for Expectation-Maximization. |
hessian |
Logical. If TRUE, the Hessian matrix is computed. Default is TRUE. |
itermax |
Integer. The maximum number of iterations for the optimization algorithm (like 'optim' or the EM loop). Default is 100. |
paraminit |
Vector. The vector of initial parameters. |
EMIRLS |
Logical. If TRUE, use the EM-IRLS method for estimation. |
refgr |
Integer. The reference group number. Default is 1. |
control |
A list of control parameters for the 'ucminf' optimization algorithm.
|
Returns an object of class 'Trajectory.ZIP'.
'beta': Vector of final beta parameters (Poisson part).
'nu': Vector of final nu parameters (zero-inflation part).
'delta': Vector of final delta parameters (if 'nw > 0').
'theta': Vector of final theta parameters for group membership.
'sd': Vector of standard deviations of the parameters.
'tab': A data frame with parameter estimates and statistics.
'Model': The string "ZIP".
'groups': The number of groups.
'Names': The names of the parameters.
'Method': The estimation method used.
'Size': The number of individuals.
'Likelihood': The final log-likelihood value.
'Time': A vector with min and max time values.
'degre': Polynomial degrees for the Poisson part.
'degre.nu': Polynomial degrees for the zero-inflation part.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.