Define likelihoods using different different distribution families

likelihood(family, ...)

Arguments

family

the likelihood distribution (see details)

...

see details

Value

an object of class likelihood

Details

Available distribution families

The following distribution families can be used for the likelihood

  • normal a normal distribution

  • student_t a scaled and shifted t-distribution

  • noncentral_t a noncentral t (for t statistic)

  • noncentral_d a noncentral t (for one sample d)

  • noncentral_d2 a noncentral t (for independent samples d)

  • binomial a binomial distribution

The parameters that need to be specified will be dependent on the family

normal distribution

When family is set to normal then the following parameters must be set

  • mean mean of the normal likelihood

  • sd standard deviation of the normal likelihood

student_t distribution

When family is set to student_t then the following parameters may be set

  • mean mean of the scaled and shifted t likelihood

  • sd standard deviation of the scaled and shifted t likelihood

  • df degrees of freedom

noncentral_t distribution

When family is set to noncentral_t then the following parameters may be set

  • t the t value of the data

  • df degrees of freedom

noncentral_d distribution

When family is set to noncentral_d then the following parameters may be set

  • d the d (mean / sd) value of the data

  • n the sample size

noncentral_d2 distribution

When family is set to noncentral_d2 then the following parameters may be set

  • d the d (mean / s_pooled) value of the data

  • n1 the sample size of group 1

  • n2 the sample size of group 2

\(s_{\mathrm{pooled}}\) is set as below: $$s_{\mathrm{pooled}} = \sqrt{\frac{(n_1 - 1)s^2_1 + (n_2 - 1)s^2_2 } {n_1 + n_2 - 2}}$$

binomial distribution

When the family is set to binomial then the following parameters may be set

  • successes the number of successes

  • trials the number of trials

Examples

# specify a normal likelihood
likelihood(family = "normal", mean = 5.5, sd = 32.35)
#> Likelihood
#>   Family
#>     normal
#>   Parameters
#>     mean: 5.5
#>     sd: 32.35
#>  

# specify a scaled and shifted t likelihood
likelihood(family = "student_t", mean = 5.5, sd = 32.35, df = 10)
#> Likelihood
#>   Family
#>     student_t
#>   Parameters
#>     mean: 5.5
#>     sd: 32.35
#>     df: 10
#>  

# specify non-central t likelihood (t scaled)
likelihood(family = "noncentral_t", t = 10, df = 10)
#> Likelihood
#>   Family
#>     noncentral_t
#>   Parameters
#>     t: 10
#>     df: 10
#>  

# specify non-central t likelihood (d scaled)
likelihood(family = "noncentral_d", d = 10, n = 10)
#> Likelihood
#>   Family
#>     noncentral_d
#>   Parameters
#>     d: 10
#>     n: 10
#>  

# specify non-central t likelihood (independent samples d scaled)
likelihood(family = "noncentral_d2", d = 10, n1 = 10, n2 = 12)
#> Likelihood
#>   Family
#>     noncentral_d2
#>   Parameters
#>     d: 10
#>     n1: 10
#>     n2: 12
#>  

# specify a binomial likelihood
likelihood(family = "binomial", successes = 2, trials = 10)
#> Likelihood
#>   Family
#>     binomial
#>   Parameters
#>     successes: 2
#>     trials: 10
#>