Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

## Post a reply

Write your message and submit
|
Options

## Topic review (newest first)

ShivamS
2011-09-03 10:32:50

#### Code:

```from scipy import integrate
def myfunc(x, a, b):
return (x**b) + a

args = (1.0, -2.0)

results = integrate.quad(myfunc, 0.5, 1.5, args)
print 'Integral = ', results[0], ' with error = ', results[1]```
bobbym
2011-08-15 21:05:26

Hi carol33;

Welcome to the forum!

bobbym
2010-05-12 20:47:14

Hi calccrypto;

I know the feeling.

calccrypto
2010-05-12 20:19:58

i try to teach myself here and there and i have learned quite a bit since 2 years ago, but ive had limited experience with polynomials other than using polynomial division to write the AES algorithm in python (a big jump from having a lookup table). i still dont understand so much about polynomials that i would love to know, but are too advanced to learn by skipping around to something interesting that i see

bobbym
2010-05-12 13:56:55

Hi calccrypto;

Your welcome, sorry I couldn't help you more. Sorry, to jargon you to death, I was just trying to give you a little background. If you feel you would like to wait until you can receive some formal training that is cool. You could also start training yourself. The internet has everything you need to get started and you can always bring your unsolved problems in here. Some one will help you. Do not be discouraged that book was very hard for me as well.

calccrypto
2010-05-12 13:47:40

oh deary me... ive gotten myself into more complicated stuff than ive attempted to learn. oops. i think i'll hold off asking more about this for a few more months, when i finally get into college and have a better background in calc

thanks so much for the help bobbym!

bobbym
2010-05-12 13:29:56

Hi calccrypto;

Originally, numerical integration using newton - cotes formulas stuck to the idea of sampling the function at equally spaced points. This includes simpsons rule and the
trapezoidal rule as well as Bodes rule... It was Gauss who discovered the way to sample only the best points of a function. To make the best estimate
he had to drop the limitations of equally spaced abscissa. To do that he made use of the so called Legendre polynomials. The nodes are the roots
of those polynomials.

calccrypto
2010-05-12 12:16:02

im just trying to get a more accurate answer, to at least the thousandths place since for p values, they are usually between .01 and .1 ...

you know what? forget this. i have another question: how do you use the Gauss–Kronrod quadrature formula to integrate? what's with those special nodes?

bobbym
2010-05-12 11:45:18

Hi calccrypto;

Where are we now? What do you need? Can you follow that formula because I can hardly see it?

calccrypto
2010-05-12 08:09:25

thanks bobbym!

and the values came from 1-(sum of a bunch of normalcdfs)

edit: oops. i think i referred to the wrong pages. the number on the actual page says 54, but the pdf page says 63. the formula is on the bottom of (pdf) page 62

bobbym
2010-05-12 06:35:07

Hi calccrypto;

As you can see from above that your cutoff of -100 for - infinty is introducing a small but noticeable error in the CDF

Below is a closed form for the CDF, If you put 1.6 in there you will get the value produced by the second integral 0.945200708300442.

But for the life of me, I cannot determine how he is getting those 2 numbers.

calccrypto
2010-05-12 06:13:49

from -100 to the z scores, like normalcdf(-100,1.6) (using -100 because -infinity is a little too much), except the formula is a sum of normalcdfs

i dont know if this helps but: http://www.scribd.com/doc/11305936/NIST-Statistical-Test-Suite-for-Random-and-PseudoRandom
page 63; 2.14.8 Example

bobbym
2010-05-11 20:24:33

Hi calccrypto;

Since a CDF is an area under the SNC do you know what values you are trying to integrate between?

calccrypto
2010-05-11 20:21:16

no.  1.6/1.9 are the 2 values to use for z in that big mess i have in the code block

bobbym
2010-05-11 12:42:26

Hi cal;

Bear with me for a little bit.

Is this what you want?

## Board footer

Powered by FluxBB