|
I see.
I thought there was a general formula to test for "difference".
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
It depends on what your goal is.
|
|
|
|
|
how about the binary correlation. sum of results where bits equal gives 1 and not equal gives -1 total divided by # bits in file should be useful.
|
|
|
|
|
As I said, it depends what your goal is. If this metric is useful for you, go for it.
|
|
|
|
|
I want to implement FDIST function in c#. Can any one tell me what is the formula to calculate FDIST. its arguments are :-
FDIST(x,degrees_freedom1,degrees_freedom2)
X is the value at which to evaluate the function.
Degrees_freedom1 is the numerator degrees of freedom.
Degrees_freedom2 is the denominator degrees of freedom.
thanks in advance
|
|
|
|
|
Where have you searched so far? Did you look in the excel documentation where it tells you that it implements the F-Distribution? Have you googled F-Distribution?
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
|
hi
I have solved FDIST in C#. now I have to find FINV
Which Returns the inverse of the F probability distribution. If p = FDIST(x,...), then FINV(p,...) = x.
Any idea about this. how to find inverse of the F probability distribution
Syntax
FINV(probability,degrees_freedom1,degrees_freedom2)
Probability is a probability associated with the F cumulative distribution.
Degrees_freedom1 is the numerator degrees of freedom.
Degrees_freedom2 is the denominator degrees of freedom.
thanks in advance
|
|
|
|
|
Hi sumit7034,
I have trying to develop FDIST and FINV function in C# just like what you did. However I don't have any idea how to start with it until I found your post in code project after several days of searching in google. Could you share with me or guide me on this based on your experience?
Do you manage to develop the FINV function?
I read your post mentioning that you manage to resolved the FDIST where the value is as close as what we get from Excel FDIST. Could you share on that?
Thanks. Hope to hear from you soon.
|
|
|
|
|
You might want to look at: http://mathworld.wolfram.com/[^] since you ask for math formulas a lot.
What have you coded so far with the FDIST function? Show what you've done so people don't get the impression you are just throwing a question out there and waiting for someone to do it for you.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
using formula in this link:
http://mathworld.wolfram.com/F-Distribution.html[^]
i have written a program in c#
public static double FDIST(double x, double m, double n)
{
double result = gamma((n + m) / 2.0) * Math.Pow(n, n / 2) * Math.Pow(m, m / 2) * Math.Pow(x, n / 2-1);
result = result / (gamma(n / 2) * gamma(m / 2)* Math.Pow(m+n*x,(n+m)/2));
return result;
}
private static double gamma(double data) {
if (data == 0.0) return 0;
double p0 = 1.000000000190015;
double []p ={76.18009172947146,
-86.50532032941677,
24.01409824083091,
-1.231739572450155,
1.208650973866179e-3,
-5.395239384953e-6
};
double y=data ; double x = data;
double tmp = x + 5.5;
tmp -= (x + 0.5) * Math.Log(tmp);
double summer = p0;
for (int j=0;j<6;++j) {
summer += (p[j] / ++y);
}
return Math.Exp(0 - tmp +Math.Log(2.5066282746310005 * summer / x));
}
But still i m not getting accurate answer as in ms excel.
please help
|
|
|
|
|
sumit7034 wrote: not getting accurate answer as in ms excel
How high of a precision do you need? For most folks, 7 or 8 decimal digits ought to be more than sufficient.
Tried your code, and based on some test values at http://www.bettersolutions.com/excel/EDH113/QI547610521.htm[^], your code is not outputting those results.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
For your project, are you allowed to use Office Interop Libraries?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I cant use this library as i have to implement all by logic.
i m building a web application
|
|
|
|
|
Ahhh, that's too bad. I was going to say, that if you could use the Office Interop Library ( me thinks with a web app, you might be able to, not sure how that stands on the MS Office EULA though ), it would be a total slam dunk. How is it coming along, btw?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have solved FDIST in C#. now I have to find FINV
Which Returns the inverse of the F probability distribution. If p = FDIST(x,...), then FINV(p,...) = x.
Any idea about this.
thanks in advance
|
|
|
|
|
How to find the values of x and y in a 90 degree sector when a value is provided which you have to place in the sector;
example:
if a value given is in the range of 0 to 100
1) 29
2) 50
3) 100
i need to place them in a 90 degree sector by finding appropriate x and y values
if the value is 100 it should reach to the corner
IS THERE ANY equation exists for it.
|
|
|_____
90 DEG
|
|
|
|
|
I can only speak for myself but I have not understood what you're trying to ask. Please try to explain the question clearly.
|
|
|
|
|
I don't understand what you're asking. Can you explain more clearly?
Steve
|
|
|
|
|
I will have a values from 0 to 100.
I will get the data ramdomly ranging from 0 to 100
Which i need to place them in a 90deg ARC. 1/4th of circle
means i need to draw a point in that 90deg arc wrt the value i received.
To draw that i should know the x and y coordinates.
Ex
if the value is zero it should draw in the Center of the circle( means in the corner of the 90 deg ARC)
if the value is 50 it should draw in the middle of the ARC
if the value is 100 it shold draw of the circumference of the circle/ ARC
|
|
|
|
|
There's a lack of requirements: system has two degrees of freedom ({x,y} with constraints, though) and your requirements provide only one value.
For instance, you may choose to put all of the points at fixed angle, say 45°, using the following formula:
x(n)= y(n) = (100.0 - n) / (100 * pow(2,.5));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for ur quick responce. here is the clarificatio of the question
I will have a values from 0 to 100.
I will get the data ramdomly ranging from 0 to 100
Which i need to place them in a 90deg ARC. 1/4th of circle
means i need to draw a point in that 90deg arc wrt the value i received.
To draw that i should know the x and y coordinates.
Ex
if the value is zero it should draw in the Center of the circle( means in the corner of the 90 deg ARC)
if the value is 50 it should draw in the middle of the ARC
if the value is 100 it shold draw of the circumference of the circle/ ARC
|
|
|
|
|
pallaka wrote: if the value is zero it should draw in the Center of the circle( means in the corner of the 90 deg ARC)
if the value is 50 it should draw in the middle of the ARC
if the value is 100 it shold draw of the circumference of the circle/ ARC
This is the opposite of the previous post (wherein you stated 100 should be at the circle center). Anyway it is not difficult to place the point onto the ray
(assuming ray=1 )
x(n) = (n * cos(angle)) / 100;
y(n) = (n * sin(angle)) / 100;
But what to do with angle (since you left this degree of freedom free...)?
You may pick a random value or do you want to choose a fixed one (you put only the constraint 0° <= angle <= 90° )?
BTW: If you need to populate randomly (and uniformly) a circular sector, well, that's a completely different matter!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks a lot it resolved my problem
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|