Internal function to fit Non Linear Model
trajeR.NL(
Y,
A,
X,
TCOV,
ng,
nx,
n,
nbeta,
nw,
ntheta,
period,
degre,
theta,
beta,
sigma,
pi,
Method,
ssigma,
hessian,
itermax,
paraminit,
EMIRLS,
refgr,
fct,
diffct,
nls.lmiter
)
Matrix. A matrix containing the variables in the model.
Matrix. A matrix containing the time variable data.
Matrix. An optional matrix that modify the probability of belong to group. By default its value is a matrix with one column with value 1.
Matrix. An optional matrix containing the time covariate that influence the trajectory themselves. By default its value is NULL.
Integer. The number of groups.
Integer. The number of covariates.
Integer. Number of individuals.
Vector of integers. Number of beta parameters for each group.
Integer. Number of time dependent covariate.
Vector of integers. Number of theta parameters for each group.
Integer.
Vector of integer. The degree of every polynomial function.
Vector of real. The parameter for calculated the group membership probability.
Vector of real. The beta parameter.
Vector of real. The sigma parameter.
Vector of real. The group membership probability.
String. Determine the method used for find the parameters of the model. The value are L for the Maximum Likelihood Estimation, EM for Expectation Maximization method with quasi newton method inside, EMIWRLS for Expectation Maximization method with Iterative Weighted Least Square.
Logical. By default its value is FALSE. For the CNORM model, indicate if we want the same sigma for all normal density function.
Logical. Indicate if we want calculate the hessian matrix. Default is FALSE.
If the method use is Likelihood, the hessian is calculated by inverting the Information's Fisher Matrix.
To avoid numerically singular matrix we find the pseudo inverse matrix by using the ginv
function int he package MASS.
If the method is EM or EMIWRLS, the hessian is calculated by using Louis method.
Integer. Indicate the maximal number of iteration for optim
function or for the EM algorithm.
Vector. The vector of initial parameters. By default trajeR
calculate the initial value
based of the range or the standard deviation.
Boolean. True if we use EMIRLS method.
Integer. The number of reference group. By default is 1.
Function. The definition of the function f in the definition in nonlinear model.
Function. The differential of the function f in the nonlinear model.
Integer. In the case of non linear model, the maximum number of iterations allowed.
return a object of class Trajectory.NL
beta - vector of the parameter beta.
sigma - vector of the parameters sigma.
delta - vector of the parameter delta. Only if we use time covariate.
theta - vector with the parameter theta if there exist a coavriate X that modify the probability or the probability of group membership.
sd - vector of the standard deviation of the parameters.
tab - a matrix with all the parameters and standard deviation.
Model - a string with the model used.
groups - a integer with the number of group.
Names - strings with the name of the parameters.
Method - a string with the method used.
Size - a integer with the number of individuals.
Likelihood - a real with the Likelihood obtained by the parameters.
Time - a vector with the first row of time values.
degre - a vector with the degree of the polynomial shape.
fct - the defintion of the function used int this model.