Hadprod function

Hadamard product of a matrix with a vector

Hadamard product of a matrix with a vector

Return the Hadamard product between the given matrix and vector: this operation corresponds to multiply every row of the matrix by the corresponding element of the vector, and it is equivalent to the standard matrix multiplication to the right with the diagonal matrix whose diagonal is the given vector. It is possible only if the length of the vector equals the number of rows of the matrix, otherwise it prints an error message.

Hadprod(Amat, xvett)

Arguments

  • Amat: A generic matrix
  • xvett: A generic vector

Returns

A matrix of the same dimensions as Amat

Details

It is an auxiliary function needed for computing the variance-covariance matrix of the estimated model with covariates.

  • Maintainer: Rosaria Simone
  • License: GPL-2 | GPL-3
  • Last published: 2024-02-23

Useful links