Learn R Programming

trajeR (version 0.9.0.5)

trajeR.BETA: Internal function to fit Beta regression

Description

Internal function to fit Beta regression

Usage

trajeR.BETA(
  Y,
  A,
  X,
  TCOV,
  ng,
  nx,
  n,
  nbeta,
  nphi,
  nw,
  ntheta,
  period,
  degre,
  theta,
  beta,
  phi,
  delta,
  pi,
  Method,
  hessian,
  itermax,
  paraminit,
  EMIRLS,
  refgr
)

Arguments

Y

Matrix. A matrix containing the variables in the model.

A

Matrix. A matrix containing the time variable data.

X

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.

TCOV

Matrix. An optional matrix containing the time covariate that influence the trajectory themselves. By default its value is NULL.

ng

Integer. The number of groups.

nx

Integer. The number of covariates.

n

Integer. Number of individuals.

nbeta

Vector of integers. Number of beta parameters for each group.

nphi

Vector of integers. Number of phi parameters for each group.

nw

Integer. Number of time dependent covariate.

ntheta

Vector of integers. Number of theta parameters for each group.

period

Integer.

degre

Vector of integer. The degree of every polynomial function.

theta

Vector of real. The parameter for calculated the group membership probability.

beta

Vector of real. The beta parameter.

phi

Vector of real. The phi parameter.

delta

Vector of real. The delta parameter.

pi

Vector of real. The group membership probability.

Method

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.

hessian

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.

itermax

Integer. Indicate the maximal number of iteration for optim function or for the EM algorithm.

paraminit

Vector. The vector of initial parameters. By default trajeR calculate the initial value based of the range or the standard deviation.

EMIRLS

Boolean. True if we use EMIRLS method.

refgr

Integer. The number of reference group. By default is 1.

Value

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.