next up previous contents
Next: Statistical Inference Up: Non-central Distributions Previous: POWER: an example of   Contents

S-Plus commands

df(x,df1,df2) density of a central $F$ distribution
qf(p,df1,df2) quantile corresponding to probability p for a central -$F$
pf(q,df1,df2,ncp) probability for a $F$ distributionwith non-centrality parameter
ncpdf(q,df1,df2,ncp) density of non-central $F$, see below

 ncpdf_function(x, df1, df2, ncp){
# written by Bob Murison at UNE based on paper by
# O'Neill and Thomson (1998), Aust J exp Agric, 38 617-22.
###############################################
Beta <- function(v1, v2){(gamma(v1) * gamma(v2))/gamma(v1 + v2)}
r <- 0:100
gF <- x * 0
for(i in seq(along = x)) {
   gF[i] <- sum((((exp(-0.5 * ncp) * (ncp/2)^r)/gamma(r + 1) * (
   df1/df2)^(df1/2 + r))/Beta((df1/2 + r), (df2/2)) * 
   x[i]^(df1/2 + r - 1))/((1 + (df1/df2) *x[i])^((df1 + df2)/2 + r)))
                           }
        gF
}


Bob Murison 2000-10-31