How does the "gamfit" function calculate the confidence interval?

I am trying to do data analysis in MATLAB, and am using "gamfit" to calculate the confidence intervals. To verify that I am getting the value that I am expecting, I would like to know how "gamfit" does the confidence interval calculation.

 Accepted Answer

For a function like "gamfit", it is possible to investigate the function directly by calling the below command in the MATLAB Command Window:
edit gamfit
In the opened file, one can see how the confidence interval is calculated.
For a more detailed explanation, the confidence interval is calculated throughthe following steps:
  1. The covariance matrix of the parameter estimates is computed using the "gamlike" function.
  2. The standard errors of the log-transformed parameter estimates are calculated by extracting the diagonal elements of the covariance matrix, taking their square roots, and normalizing by the parameter estimates.
  3. Confidence intervals are computed on the log scale using the inverse normal Cumulative Distribution Function (CDF), and then exponentiated to obtain the confidence intervals on the original scale of the parameters. The significance level "alpha" is used to determine the lower (alpha/2) and upper (1-alpha/2) percentiles for the confidence intervals.
You can find more information on the gamlike function using the below link:

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!