Description Usage Arguments Value Examples
View source: R/optimal_hessian.R
This function compute the hessian matrix of the log-likelihood function given the data and the covariates
1 | optimal_hessian(par, data, lista_phi, lista_d, fnscale = 1)
|
par |
The point in which the hessian matrix has to be computed |
data |
The matrix of the observed data |
lista_phi |
The list containing all the matrices of covariates to model each |
lista_d |
The list containing all the matrices of covariates to model each |
fnscale |
Scale coefficient: default value equal to |
Hessian matrix of the log-likelihood function
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_hessian(par,data,lista_phi,lista_d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.