# Non central Chi square distribution and approximations Matlab

#### bidou8601

##### New Member
Hello!

I have a problem with the computation of a chi squared distribution in Matlab. I have a quadratic form : y' Px y, this form has a non central chi squared distribution with r degrees of freedom and a parameter of non centrality lambda.

My question is : How could I turn this noncentral distribution into central distribution ? I have tried the Patnaik approximation, but I think I have a problem in Matlab. I use chi2pdf(x,r') where r' is the new dof (Patnaik), and I multiply this pdf by c' (which is the Patnaik coefficient). But the result doesn't fit with the result of the noncentral pdf (ncx2pdf(x,r,lambda)).

If anyone has a beginning of an answer, it' fantastic !

Thanks

#### Dason

What do you mean by "how could I turn this noncentral distribution into central distribution"?

#### bidou8601

##### New Member
I mean, how can I approximate the non-central chi2 distribution in central chi2 distribution ?

I use the Patnaik approximation but I don't succeed with Matlab.
I use the functions chi2pdf and ncx2pdf

#### Dragan

##### Super Moderator
I mean, how can I approximate the non-central chi2 distribution in central chi2 distribution ?

I use the Patnaik approximation but I don't succeed with Matlab.
I use the functions chi2pdf and ncx2pdf

My guess is that you should use the function ncx2cdf(X,v,delta), where X is the specified value, v is the degrees of freedom, and delta is the non-centrality parameter.

So, for example, if you enter ncx2cdf(5.99,2, 0), you will obtain a cumulative probability of 0.950 (which is a central chi-square distribution with 2 degrees of freedom).

If you enter ncx2cdf(5.99,2, 1), you will obtain a cumulative probability of 0.8672 (which is a chi-square distribution with 2 degrees of freedom that has a non-centrality parameter of 1).