Description Usage Arguments Details Author(s) Examples
View source: R/distributions.r
Functions for computing density and producing random samples from a non-standardized Student's t distribution.
| 1 2 | 
| x | Values to compute densities of | 
| nu | Degrees of freedom (tail shape) | 
| mu | Location of distribution (mean) | 
| sigma | Scale of distribution | 
| log | If  | 
| n | Number of random observations to sample | 
These functions provide density and random number calculations for Student's t distribution, translated and scaled by mean mu and scale sigma. Note that sigma is not the distribution's standard deviation, unless nu is very large.
Richard McElreath
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run: 
library(rethinking)
data(WaffleDivorce)
d <- WaffleDivorce
d$A <- scale( d$MedianAgeMarriage )
d$D <- scale( d$Divorce )
d$M <- scale( d$Marriage )
m5.3b <- quap(
    alist(
        D ~ dstudent( 2 , mu , sigma ) ,
        mu <- a + bM*M + bA*A ,
        a ~ dnorm( 0 , 0.2 ) ,
        bM ~ dnorm( 0 , 0.5 ) ,
        bA ~ dnorm( 0 , 0.5 ) ,
        sigma ~ dexp( 1 )
    ) , data = d )
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.