At the moment, the normal inverse Gaussian distribution is not included in the statistics toolbox. This collection of m-files supplements this toolbox with the most important functionalities for the NIG distribution: random numbers, moments, cdf, pdf and parameters by moment fit.
hi i will like join this program
Anders, I got the problem you came accross. I checked the matlab files, the main reason (see the file niginv.m) is that the lower or upper bounds will increase to double whenever f_u or f_l is less then the tolerance. So when you set up the Xgrid and Ygrid, there will be big chance that the cdf (or Xgrid) will have the same value because Matlab rounds off all of the numbers to keep just four digits. The suggestion is you can add a few lines in the program to recheck the Xgrid to make sure they are different numbers.
The function niginv returns an error ( Error using ==> interp1 The values of X should be distinct) for some combinations of parameter values. For example the values 0.05 11.385 -0.25766 0.08342 3.5225 return the mentioned error. These values are very close to parameters for which the function works fine so I don't see why this is happening.
Create scripts with code, output, and formatted text in a single executable document.