File: calculate_mu.R

package info (click to toggle)
r-bioc-glmgampoi 1.2.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 704 kB
  • sloc: cpp: 523; ansic: 114; sh: 13; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14



calculate_mu <- function(Beta, model_matrix, offset_matrix){
  make_offset_hdf5_mat <- is(offset_matrix, "DelayedMatrix") && is(DelayedArray::seed(offset_matrix), "HDF5ArraySeed")
  if(! make_offset_hdf5_mat){
    exp(Beta %*% t(model_matrix) + offset_matrix)
  }else{
    mu <- exp(delayed_matrix_multiply(DelayedArray::DelayedArray(Beta),
                                      DelayedArray::DelayedArray(t(model_matrix))) + offset_matrix)
    mu <- HDF5Array::writeHDF5Array(mu)
    mu
  }
}