Learn R Programming

fastLogisticRegressionWrap (version 1.2.0)

eigen_Xt_times_diag_w_times_X: A fast Xt [times] diag(w) [times] X function

Description

Via the eigen package

Usage

eigen_Xt_times_diag_w_times_X(X, w, num_cores = 1)

Value

The resulting matrix

Arguments

X

A numeric matrix of size n x p

w

A numeric vector of length p

num_cores

The number of cores to use. Unless p is large, keep to the default of 1.

Examples

Run this code
  n = 100
  p = 10
  X = matrix(rnorm(n * p), nrow = n, ncol = p)
  w = rnorm(p)
  eigen_Xt_times_diag_w_times_X(t(X), w)

Run the code above in your browser using DataLab