dist.Inverse.ChiSquare: (Scaled) Inverse Chi-Squared Distribution

Description Usage Arguments Details Value See Also Examples

Description

This is the density function and random generation for the (scaled) inverse chi-squared distribution.

Usage

1
2

Arguments

x

This is a vector of quantiles.

n

This is the number of observations. If length(n) > 1, then the length is taken to be the number required.

df

This is the degrees of freedom parameter, usually represented as nu.

scale

This is the scale parameter, usually represented as lambda.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Details

The inverse chi-squared distribution, also called the inverted chi-square distribution, is the multiplicate inverse of the chi-squared distribution. If x has the chi-squared distribution with nu degrees of freedom, then 1 / x has the inverse chi-squared distribution with nu degrees of freedom, and nu / x has the inverse chi-squared distribution with nu degrees of freedom.

These functions are similar to those in the GeoR package.

Value

dinvchisq gives the density and rinvchisq generates random deviates.

See Also

dchisq

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(LaplacesDemon)
x <- dinvchisq(1,1,1)
x <- rinvchisq(10,1)

#Plot Probability Functions
x <- seq(from=0.1, to=5, by=0.01)
plot(x, dinvchisq(x,0.5,1), ylim=c(0,1), type="l", main="Probability Function",
     ylab="density", col="red")
lines(x, dinvchisq(x,1,1), type="l", col="green")
lines(x, dinvchisq(x,5,1), type="l", col="blue")
legend(3, 0.9, expression(paste(nu==0.5, ", ", lambda==1),
     paste(nu==1, ", ", lambda==1), paste(nu==5, ", ", lambda==1)),
     lty=c(1,1,1), col=c("red","green","blue"))

Example output



LaplacesDemon documentation built on July 9, 2021, 5:07 p.m.