Using gamfit Function & LR Hypothesis Test in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter joinlia
  • Start date Start date
  • Tags Tags
    Function Matlab Test
Click For Summary

SUMMARY

The discussion focuses on using the

gamfit

function in

MATLAB

to fit data to a gamma distribution and the subsequent calculation of standard errors from confidence intervals. The user provides an example where the maximum likelihood estimates (MLEs) are

a = 2

and

b = 4

, with confidence intervals calculated as

ci = [1.6840, 2.8298; 2.7141, 4.6554]

. Additionally, the user seeks guidance on performing a likelihood ratio hypothesis test using the

lratiotest

function, specifically on how to obtain the

NullLLF

and

BaseLLF

values. The standard error is derived from the confidence interval using the formula

standard error = (upper limit – lower limit) / 3.92

.

PREREQUISITES

  • Familiarity with

    MATLAB

    programming environment
  • Understanding of

    gamma distribution

    and its parameters
  • Knowledge of

    maximum likelihood estimation (MLE)

  • Basic concepts of

    likelihood ratio tests

NEXT STEPS

  • Research how to compute

    standard errors

    from confidence intervals in statistical analysis
  • Learn about

    maximum likelihood estimation

    in depth, particularly in

    MATLAB

  • Explore the

    lratiotest

    function in

    MATLAB

    for hypothesis testing
  • Study the implications of

    confidence intervals

    and their interpretation in statistical modeling

USEFUL FOR

This discussion is beneficial for data analysts, statisticians, and researchers using

MATLAB

for statistical modeling, particularly those interested in gamma distributions and hypothesis testing methodologies.

joinlia
Messages
1
Reaction score
0
Hello,
I fit my data to gamma distribution using the gamfit function of MATLAB.
The gamfit function returns MLEs and 95% percent confidence intervals as follows:
• a = 2; b = 4;data = gamrnd(a,b,100,1);
• [p,ci] = gamfit(data)
• p =
• 2.1990 3.7426
• ci =
• 1.6840 2.8298
• 2.7141 4.6554
I am interested in finding the standard error of the coefficients rather than the confidence interval.
I want to know how to compute the standard errors based on the confidence interval??

Moreover, likelihood ratio hypothesis test were used to test hypotheses such as p(1)=0.5, but I don’t know how to obtaine and input the NullLLF and BaseLLF values

Syntax likelihood ratio hypothesis test
[H,pValue,Ratio,CriticalValue]=lratiotest(BaseLLF,NullLLF,DoF,Alpha)
 
Physics news on Phys.org
From a quick google search, you can find that the standard error = (upper limit – lower limit) / 3.92.
 
Last edited:

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
10K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
6K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K