LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D normal distribution fit

I want to perform a 2D normal fit to extraxt Correlation between X and Y. Somehow i  am not able to find any vi for the same. any help will be appreciated. I have an m*n array where row no. define x value and column define y value and Z is defined as (m,n) value

0 Kudos
Message 1 of 12
(1,642 Views)

Can you give an data example and a link to the theory you want to apply. What is the final output? A single scalar?

 

0 Kudos
Message 2 of 12
(1,625 Views)

Maybe something as discussed in this thread?

2DRotatedGaussianFit.png

0 Kudos
Message 3 of 12
(1,623 Views)

Not exactly this. I need to calculate the correlation between X and Y by bivariant fit..below attached is the theory and data(intensity graph).

IMG_20230613_204937.jpg

IMG_20230613_204523.jpg


@altenbach wrote:

Maybe something as discussed in this thread?

 


0 Kudos
Message 4 of 12
(1,610 Views)

@Arman0712 wrote:

Not exactly this. I need to calculate the correlation between X and Y by bivariant fit..below attached is the theory and data(intensity graph). 


Bivariate, not bivariant, right? Just plug the data into the formula, shouldn't be too hard....

 

You still have not attached any typical data.

 

 

0 Kudos
Message 5 of 12
(1,600 Views)

Your X and Y are just the array indices. It seems the advanced signal processing toolkit has some tools.

 

There are also some earlier discussions, so search the forum. (example)

0 Kudos
Message 6 of 12
(1,594 Views)

Yess bivariate. her i am attaching the data

0 Kudos
Message 7 of 12
(1,554 Views)

The formulas you show in you picture are just for a symmetric 2D normal distribution (correlation=0) and a simplified version of my code (where there is only one global sigma) already does that. It won't be appropriate for your problem where you try to look at correlations, i.e. where the distribution has an elliptical cross-section that would be a circle for 0% correlation and collapse to a single line for 100% correlation.

 

You seem to be looking for this. All you probably need is use my 2D fit and look at the two axes of the ellipse. If they are equal there is no correlation and if one is zero, there is 100% correlation.

 

To just get the correlation coefficient, here's what you could also do. I am sure there are millions of other ways, but please verify.

 

altenbach_1-1686757167353.png

 

 

 

Message 8 of 12
(1,533 Views)

If i change the correlation the distribution will change accordingly , i am attaching a picture generated in python for the same.

fig.png

I cant use the the method you have shown as it will include all the outliners as well. i need to exclude those by normal ditribution fit. which will give me correlation between x and y.

0 Kudos
Message 9 of 12
(1,467 Views)

@Arman0712 wrote:

I cant use the the method you have shown as it will include all the outliners as well. i need to exclude those by normal ditribution fit. which will give me correlation between x and y.


Well, first you need to define what an "outlier" is.

0 Kudos
Message 10 of 12
(1,430 Views)