Learn R Programming

NBtsVarSel (version 1.0)

NR_gamma: Newton-Raphson method for estimation of gamma

Description

This function estimates gamma with Newton-Raphson method

Usage

NR_gamma(Y, X, beta, gamma, alpha, n.iter)

Value

gamma

Estimated gamma vector

Arguments

Y

Observation matrix

X

Design matrix

beta

Initial beta vector

gamma

Initial gamma vector

alpha

Initial overdispertion parameter

n.iter

Number of iterations of the algorithm. Default=100

Author

Marina Gomtsyan

Maintainer: Marina Gomtsyan <mgomtsian@gmail.com>

References

M. Gomtsyan "Variable selection in a specific regression time series of counts.", arXiv:2307.00929

Examples

Run this code
n = 50
p = 30
X = matrix(NA,(p+1),n)
f = 1/0.7
for(t in 1:n){X[,t] = c(1,cos(2*pi*(1:(p/2))*t*f/n),sin(2*pi*(1:(p/2))*t*f/n))}
gamma0 = c(0)
data(Y)
glm_nb = glm.nb(Y~t(X)[,2:(p+1)])
beta0 = as.numeric(glm_nb$coefficients)
alpha0 = glm_nb$theta
gamma_est = NR_gamma(Y, X, beta0, gamma0, alpha0, n.iter=100)

Run the code above in your browser using DataLab