File: iid.R

package info (click to toggle)
r-cran-lava 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,816 kB
  • sloc: sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
##' Extract i.i.d. decomposition from model object
##'
##' This function extracts
##' @param x Model object
##' @param ... Additional arguments (see the man-page of the IC method)
##' @export
iid <- function(x, ...) UseMethod("iid")

##' @export
iid.default <- function(x, ...) {
  res <- IC(x, ...)
  if (!is.null(attr(res, "bread"))) {
    attr(res, "bread") <- attr(res, "bread")/NROW(res)
  }
  return(res/NROW(res))
}