likelihood: Specify a likelihood

View source: R/likelihoods.R

likelihoodR Documentation

Specify a likelihood

Description

Define likelihoods using different different distribution families #nolint

Usage

likelihood(family, ...)

Arguments

family

the likelihood distribution (see details)

...

see details

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_pooled is set as below:

√(((n1 - 1) * s1^2 + (n2 - 1)*s2^2)/(n1 + n2 - 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

Value

an object of class likelihood

Examples

# specify a normal likelihood
likelihood(family = "normal", 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)

# specify non-central t likelihood (t scaled)
likelihood(family = "noncentral_t", t = 10, df = 10)

# specify non-central t likelihood (d scaled)
likelihood(family = "noncentral_d", d = 10, n = 10)

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

# specify a binomial likelihood
likelihood(family = "binomial", successes = 2, trials = 10)

ljcolling/bayesplay documentation built on March 21, 2022, 3:15 a.m.