MGF_evaluator: Moment and Cumulant Generating Function Evaluator.

Description Usage Arguments Value Examples

View source: R/Funksies.R

Description

This function evaluates the nth order derivative of each mgf and cgf for the selected probability distribution. It provdes both the formula as well as the value for each.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
MGF_evaluator(
  distribution,
  t = 0,
  order_of_moment = 1,
  mu = 0,
  sigma = 1,
  n = 10,
  p = 0.5,
  r = 5,
  lambda = 5,
  alpha = 1,
  k = 2
)

Arguments

distribution

One of the following distributions as a string: "Bernoulli", "Binomial", "Geometric", "Negative Binomial", "Poisson", "Exponential", "Gamma", "Normal", "Chi-Square".

t

The value of t at which the derivatives are evaluated, default value is 0.

order_of_moment

The order of the moments and centralized moments of the distribution that you are interested in, default = 1.

mu

The mean of the Normal Distribution, default = 0.

sigma

The Standard Deviation of the Normal Distribution default = 1.

n

The number of trials for a Binomial Distribution, default = 10

p

The success probabiltiy for a Bernoulli, Geometric, Negative Binomial and Binomial Distribution, default = 0.5.

r

The number of successes for the Negative Binomial Distribution, default = 5.

lambda

Rate parameter for the Poisson, Exponential and Gamma Distributions, default = 5.

alpha

Shape parameter for the Gamma Distribution, default = 1.

k

Degrees of freedom for the Chi-Square Distribution, default = 2.

Value

Returns the MGF, The formula of the nth order derivatives of the MGF and CGF and their values for the specified distribution and parameters.

Examples

1
2
3
4
MGF_evaluator(distribution = "Binomial",order_of_moment = 2,n = 20)
MGF_evaluator(distribution = "Normal",t = 0,order_of_moment = 4)
MGF_evaluator(distribution = "Poisson",t = 0,order_of_moment = 2)
MGF_evaluator(distribution = "Exponential",t = 0,order_of_moment = 2)

alexandernel14/MGF documentation built on Aug. 30, 2020, 2:11 a.m.