Using gamfit Function & LR Hypothesis Test in MATLAB

In summary, the gamfit function in MATLAB can be used to fit data to a gamma distribution and returns maximum likelihood estimates (MLEs) and 95% confidence intervals. The standard errors of the coefficients can be calculated using the upper and lower limits of the confidence intervals. Likelihood ratio hypothesis tests can also be performed using the lratiotest function, with additional input values required such as NullLLF and BaseLLF.
  • #1
joinlia
1
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
  • #2
From a quick google search, you can find that the standard error = (upper limit – lower limit) / 3.92.
 
Last edited:

1. What is the gamfit function in MATLAB?

The gamfit function in MATLAB is a statistical function that fits a gamma distribution to a dataset, allowing you to analyze and make predictions about the underlying data.

2. How do I use the gamfit function in MATLAB?

To use the gamfit function in MATLAB, you first need to import your dataset into the program. Then, you can use the function by specifying the dataset as the input and assigning the output to a variable. This will give you the parameters of the gamma distribution that best fits your data.

3. What is the purpose of the LR Hypothesis Test in MATLAB?

The LR (likelihood ratio) Hypothesis Test in MATLAB is a statistical test used to compare two models and determine which one better fits the data. It calculates the likelihood of the observed data under each model and compares them to determine if one is significantly better than the other.

4. How do I perform an LR Hypothesis Test in MATLAB?

To perform an LR Hypothesis Test in MATLAB, you first need to specify your two models as functions and import your dataset. Then, you can use the "lrtest" function, specifying the two models and the dataset as inputs. The output will be a p-value, which you can use to determine the significance of the difference between the two models.

5. Can I use the gamfit function and LR Hypothesis Test together in MATLAB?

Yes, you can use both the gamfit function and LR Hypothesis Test together in MATLAB. You can use the gamfit function to fit a gamma distribution to your data, and then use the LR Hypothesis Test to compare it to another model (such as a normal or exponential distribution) to see if it is a significantly better fit.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
457
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
Back
Top