Defines functions create_y_hat

#' Multiply weighted adjacency matrix by control variables and resampled residuals
#' @param beta Point estimates.
#' @param X Matrix of control variables.
#' @param par_dep_mat Weighted adjacency matrix.
#' @param sample_res Resampled residuals.
#' @return New dependent variable.
#' @keywords internal
#' @importFrom MASS ginv
#' @noRd
create_y_hat <- function(beta, X, par_dep_mat, sample_res){
  bX <- X %*% beta
  y_hat <- ginv(par_dep_mat) %*% (bX + sample_res)

Try the econet package in your browser

Any scripts or data that you put into this service are public.

econet documentation built on May 24, 2021, 5:09 p.m.