R/fn.computeexpw.R

## Function which computes the weigths (exponential)
## __input__
## lnk : [Nx1 vector] of log kernel values
## lnd : [Nx1 vector] of log mixture values
## __output__
## [Nx1 vector] of weights
## __20080429__
'fn.computeexpw' <- function(lnk, lnd)
  {
    r <- lnk-lnd
    r <- r-max(r) ## robustify
    r <- exp(r)
    r[is.na(r) | is.nan(r)] <- 0
    as.vector(r)
  }

Try the AdMit package in your browser

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

AdMit documentation built on Feb. 8, 2022, 1:07 a.m.