optimal_grad: Log-likelihood Gradient

Description Usage Arguments Value Examples

View source: R/optimal_grad.R

Description

This function compute the gradient of the log-likelihood function given the data and the covariates

Usage

1
optimal_grad(par, data, lista_phi, lista_d, fnscale = 1)

Arguments

par

The point in which the gradient has to be computed

data

The matrix of the observed data

lista_phi

The list containing all the matrices of covariates to model each phi element

lista_d

The list containing all the matrices of covariates to model each d element

fnscale

Scale coefficient: default value equal to 1

Value

Gradient vector of the log-likelihood function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data <- matrix(rnorm(300), ncol=3)
lista_d <- list()
lista_phi <- list()
lista_d[[1]] <- matrix(c(rep(1,100),rnorm(100)), byrow = FALSE, ncol=2)
lista_d[[2]] <- matrix(c(rep(1,100),rnorm(200)), byrow = FALSE, ncol=3)
lista_d[[3]] <- matrix(rep(1,100), byrow = FALSE, ncol=1)
lista_phi[[1]] <- matrix(c(rep(1,100),rnorm(200)),byrow = FALSE, ncol=3)
lista_phi[[2]] <- matrix(rep(1,100),ncol=1)
lista_phi[[3]] <- matrix(c(rep(1,100),rnorm(100)),byrow = FALSE, ncol=2)
par <- rnorm(12)
optimal_grad(par,data,lista_phi,lista_d)

PeppeSaccardi/acmvup documentation built on Dec. 31, 2020, 3:28 p.m.