approximation

Can I break down a large-scale correlation matrix?

点点圈 提交于 2019-12-07 21:50:53
问题 the correlation matrix is so large (50000by50000) that it is not efficient in calculating what I want. What I want to do is to break it down to groups and treat each as separate correlation matrices. However, how do I deal with the dependence between those smaller correlation matrices? I have been researching online all day but nothing comes up. There should be some algorithm out there that is related to the approximation of large correlation matrices like this, right? 回答1: Even a 4 x 4

Difference among approximatelyEqual and essentiallyEqual in The art of computer programming

人走茶凉 提交于 2019-12-06 19:27:20
问题 I get this code snippet from some where else. According to the webmaster, the code is picked from The art of computer programming by Knuth Since I do not have a copy of that book, may I know what is the difference among the two functions? bool approximatelyEqual(float a, float b, float epsilon) { return fabs(a - b) <= ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon); } bool essentiallyEqual(float a, float b, float epsilon) { return fabs(a - b) <= ( (fabs(a) > fabs(b) ? fabs(b) : fabs(a))

Finding 3 dimentional B-spline controll points from given array of points from spline solution?

被刻印的时光 ゝ 提交于 2019-12-06 10:32:52
问题 Wa are talking about Non-uniform rational B-spline. We have some simple 3 dimentional array like {1,1,1} {1,2,3} {1,3,3} {2,4,5} {2,5,6} {4,4,4} Which are points from a plane created by some B-spline How to find controll points of spline that created that plane? (I know its a hard task because of weights that need to be calculated but I really hope it is solvable) For thouse who did not got idea of question - sory my writting is wwbad - we have points that are part of plane rendered here and

How to write PI calculation program in Java using multi-thread?

余生长醉 提交于 2019-12-06 09:57:07
问题 I need to create a program that can calculate approximation to the constant PI, using Java multi-thread. I'm intent to use Gregory-Leibniz Series to calculate the result for PI / 4, and then multiply by 4 to get the PI approximation. But I have some concern about the program: How can I seperate the calculation process so that I can implement a multi-thread processing for the program? Because the formula is for the total sum, I don't know how to split them into parts and then in the end I will

Simple approximation of Inverse Incomplete gamma function

半腔热情 提交于 2019-12-05 18:45:21
How could one approximate Inverse Incomplete gamma function Г(s,x) by some simple analytical function f(s,Г)? That means write something like x = f(s,Г) = 12*log(123.45*Г) + Г + 123.4^s . (I need at least ideas or references.) You can look at the code in Boost: http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma.html and see what they're using. EDIT: They also have inverses: http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma_inv.html I've found out that x = f(s,Г) with given s can be

How to measure complexity of a string?

拜拜、爱过 提交于 2019-12-05 02:37:41
I have a few long strings (~ 1.000.000 chars). Each string only contains symbols from the defined alphabet, for example A = {1,2,3} Sample strings string S1 = "1111111111 ..."; //[meta complexity] = 0 string S2 = "1111222333 ..."; //[meta complexity] = 10 string S3 = "1213323133 ..."; //[meta complexity] = 100 Q What kind of measures can I use to quantify the complexity of these strings? I can see that S1 is less complex than S3, but how can I do that programmatically from .NET? Any algorithm or point to the tool/literature would be greatly appreciated. Edit I tried Shannon entropy, but it

Difference among approximatelyEqual and essentiallyEqual in The art of computer programming

爷,独闯天下 提交于 2019-12-05 01:17:18
I get this code snippet from some where else. According to the webmaster, the code is picked from The art of computer programming by Knuth Since I do not have a copy of that book, may I know what is the difference among the two functions? bool approximatelyEqual(float a, float b, float epsilon) { return fabs(a - b) <= ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon); } bool essentiallyEqual(float a, float b, float epsilon) { return fabs(a - b) <= ( (fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon); } To give an example: double a = 95.1, b = 100.0; assert( approximatelyEqual( a, b, 0.05 )

Finding 3 dimentional B-spline controll points from given array of points from spline solution?

好久不见. 提交于 2019-12-04 16:21:27
Wa are talking about Non-uniform rational B-spline . We have some simple 3 dimentional array like {1,1,1} {1,2,3} {1,3,3} {2,4,5} {2,5,6} {4,4,4} Which are points from a plane created by some B-spline How to find controll points of spline that created that plane? (I know its a hard task because of weights that need to be calculated but I really hope it is solvable) For thouse who did not got idea of question - sory my writting is wwbad - we have points that are part of plane rendered here and we need to find controll points that form a spline which solution is that rendered plane. There are

Bezier curve approximation for large amount of points

折月煮酒 提交于 2019-12-04 09:56:28
I have about hundred points, that I want to approximate with Bezier curve, but if there are more than 25 points (or something like that), factorial counting in number of combination causes number overflow. Is there a way of approximating such amount of points in a Bezier-like way (smooth curve without passing through all points, except first and last)? Or do I need to choose another approximation algorithm with the same effect? I'm using default swing drawing tools. P.S. English is not native for me, so probably I've used wrong math terms somewhere. Do you want to get one Bezier curve fitting

Approximation to constant “pi” does not get any better after 50 iterations

非 Y 不嫁゛ 提交于 2019-12-04 06:22:46
问题 In R I have written this function ifun <- function(m) { o = c() for (k in 1:m) { o[k] = prod(1:k) / prod(2 * (1:k) + 1) } o_sum = 2 * (1 + sum(o)) # Final result print(o_sum) } This function approximates constant pi , however, after m > 50 the approximation gets stuck, i.e. the approximation is the same value and don't get better. How can I fix this? Thanks. 回答1: Let's go inside: o <- numeric(100) for (k in 1:length(o)) { o[k] = prod(1:k) / prod(2 * (1:k) + 1) } o # [1] 3.333333e-01 1.333333e