I am using data which I suspect is distributed according to the Normal Inverse Gaussian distribution (NIG). The literature says that the 4 parameters of the NIG distribution can be estimated from the sample mean, variance, kurtosis, and skewness. I would like to test the fit of NIG with the calculated parameters and the data. Now, my function is written as:
NIG2[x_, {α_, β_, μ_, δ_}] :=
(α/(δ π)) Exp[Sqrt[α^2 - β^2] - (β μ)/δ] (K1[α*Sqrt[1 + ((x - μ)/δ)^2]]
Sqrt[1 + ((x - μ)/δ)^2]) Exp[β/δ x];
Edit:
The K1 function is the Bessel function of the third kind which is:
K1[w_] = Integrate[ Exp[ -w (t + t^(-1)) / 2 ] , {t, 0, Infinity}]
(* = ConditionalExpression[2 BesselK[1, w], Re[w] > 0] *)
The four parameters are
{α, β, μ, δ}
and their values are (respectively):
{0.635655, - 0.00143495 I, 6.87671, 1.56309}
I saw Mr Alpha's answer to a similar query where data followed an AR(4) process. I tried using the residualAnalysis module presented, but Mathematica claims that NIG2 is not a valid process. Yet the 4 plots do appear to be quite correct as the residuals seem distributed normally.
How should I test data against a NIG distribution function?
K1? (15) – george2079 Dec 23 '15 at 15:44K1(at a glance I don't see a "third kind" Bessel function directly available..) – george2079 Dec 23 '15 at 18:59Chop. This is likely the source of your error. Is it supposed to be real? Do you just want to take the real part? Another thing, you might setK1[w_] = 2 BesselK[1, w]and verify the conditional is satisfied after you get your fit. – george2079 Dec 24 '15 at 15:21NIG2is proportional toPDF[HyperbolicDistribution[3/2, α/δ, β/δ, δ, μ], x](as a function ofx). – Michael E2 Dec 24 '15 at 20:12PDF[HyperbolicDistribution[3/2, α/δ, β/δ, δ, μ], x]/NIG2[x, {α, β, μ, δ}] // FullSimplify[#, δ > 0]&simplifies to a "constant" depending only onαandβ. Since I've no data to test and I'm not that familiar with your problem, I can't really say much more. I thought the built-in distribution might be used more easily than a user-constructed one. One thing I don't understand is that the linked question deals with time-series data & processes, but I don't see the connection with your problem, at least in the details presented. (I'm only vaguely familiar with time series.) – Michael E2 Dec 25 '15 at 15:49NIG2is not a PDF, except for values of parameters that make the constant equal to 1; since you don't claim it is a PDF, maybe that's unimportant. – Michael E2 Dec 25 '15 at 15:56DistributionFitTest,EstimatedDistribution,FindDistributionParameters; maybeFindDistribution. I can't think of anything else. Maybe someone with a better statistics will come along. Things can get a little slow on SE this time of the year. – Michael E2 Dec 25 '15 at 20:28