fitgrouped2: Estimating parameters of the three-parameter...

View source: R/ForestFit.R

fitgrouped2R Documentation

Estimating parameters of the three-parameter Birnbaum-saunders (BS), generalized exponential (GE), and Weibull distributions fitted to grouped data

Description

Suppose a sample of n independent observations each follows a three-parameter BS, GE, or Weibull distributions have been divided into m separate groups of the form (r_{i-1},r_i], for i=1,…,m. So, the likelihood function is given by

L(Θ)=\frac{n!}{f_{1}!f_{2}!… f_{m}!}∏_{i=1}^{m}\Bigl[F\bigl(r_{i}\big|Θ\bigr)-F\bigl(r_{i-1}\big|Θ\bigr)\Bigr]^{f_i},

where the r_0 is the lower bound of the first group, r_m is the upper bound of the last group, and f_i is the frequency of observations within i-th group provided that n=∑_{i=1}^{m}f_{i}.

Usage

fitgrouped2(r, f, param, start, cdf, pdf, method = "Nelder-Mead", lb = 0, ub = Inf
            , level = 0.05)

Arguments

r

A numeric vector of length m+1. The first element of r is lower bound of the first group and other m elements are upper bound of the m groups. We note that upper bound of the (i-1)-th group is the lower bound of the i-th group, for i=2,…,m. The lower bound of the first group and upper bound of the m-th group are chosen arbitrarily.

f

A numeric vector of length m containing the group's frequency.

param

Vector of the of the family parameter's names.

start

Vector of the initial values.

cdf

Expression of the cumulative distribution function.

pdf

Expression of the probability density function.

method

The method for the numerically optimization that includes one of CG, Nelder-Mead, BFGS, L-BFGS-B, SANN.

lb

Lower bound of the family's support. That is zero by default.

ub

Upper bound of the family's support. That is Inf by default.

level

Significance level for constructing asymptotic confidence interval That is 0.05 by default for constructing a 95% confidence interval.

Value

A two-part list of objects given by the following:

  1. Maximum likelihood (ML) estimator for the parameters of the fitted family to the gropued data, asymptotic standard error of the ML estimator, lower bound of the asymptotic confidence interval, and upper bound of the asymptotic confidence interval at the given level.

  2. A sequence of goodness-of-fit measures consist of Anderson-Darling (AD), Cram\'eer-von Misses (CVM), and Kolmogorov-Smirnov (KS) statistics.

Author(s)

Mahdi Teimouri

Examples

    r <- c(2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5)
    f <- c(33, 111, 168, 147, 96,  45, 18, 4, 0)
param <- c("alpha", "beta", "mu")
  pdf <- quote( alpha/beta*((x-mu)/beta)^(alpha-1)*exp( -((x-mu)/beta)^alpha ) )
  cdf <- quote( 1-exp( -((x-mu)/beta)^alpha ) );
   lb <- 2
   ub <- Inf
start <-c(2, 3, 2)
level <- 0.05
fitgrouped2(r, f, param, start, cdf, pdf, method = "Nelder-Mead", lb = lb, ub = ub, level = 0.05)

ForestFit documentation built on March 7, 2023, 8:27 p.m.