R/rinvchisq.r

rinvchisq <- function (n, df, scale = 1/df) 
{
    if ((length(scale) != 1) & (length(scale) != n)) 
        stop("scale should have the same length as n")
    if (df <= 0) 
        stop("df must be greater than zero")
    if (any(scale <= 0)) 
        stop("scale must be greater than zero")
    (df * scale)/rchisq(n, df = df)
}

Try the asbio package in your browser

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

asbio documentation built on Aug. 20, 2023, 9:07 a.m.