A list of puns related to "Gaussian Quadrature"
I imagine it has something to do with how the odd-degree terms don't contribute at all to the integral over [-1,1], but I still don't quite grasp how the relevant information for the even terms could be extracted using so few points.
I am tasked with using 3 and 4 point gaussian quadrature to approximate the integral from -1 to 1 of 1.2x^3 + 7x^2 + 2.7
However, I am running into some calculation issues and I am not sure where the error is.
I have that you can approximate the integral by
c1f(x1) + c2f(x2) + c3f(x3)
and my table of values tells me that
c1 = .555555556
c2 = .888888889
c3 = .555555556
x1 = -.774596669
x2 = 0
x3 = .774596669
So, I set up the problem as
.555555556 * f(1.2(-.774596669^3 ) + 7(-.774596669^2 ) + 2.7)
+ .888888889 * f(1.2(0^3 ) + 7(0^2 ) + 2.7)
+ .555555556 * f(1.2(.774596669^3 ) + 7(.77459669 ^2 ) + 2.7)
But when I multiply all this out I end up getting some really big numbers. Like just the first lines is like 350, the integral is nowhere close to that value when evaluated.
Am I doing something wrong formula wise, or is there just some calculation mistake?
Thanks, in advance!
Hello, I'm trying to learn how to write a program for numerical integration. I recently wrote several programs for the left, right, and mid point estimations, the Simpson's rule, and the trapezoidal rule. Currently I'm working on a program for 2 point Gaussian quadrature and I'm getting stuck.
Here's what I've got
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
double f(double x) //function a = f(x) = 1/(1+x^2)
{
double a = 1 / (1 + x*x);
return a;
}
double twoGauss(double a, double b, int n)
{
int i;
double lower, upper, number, width, leftw, rightw, sum = 0;
lower = a;
upper = b;
number = n;
width = (b - a) / n;
leftw = width*(1 - 1./sqrt(3))/2;
rightw = width*(1 + 1./sqrt(3))/2;
double* xa = new double[n];
double* xb = new double[n];
double* ya = new double[n];
double* yb = new double[n];
for (i = 0; i < number; i++)
{
xa[i] = lower + (i)*width + leftw;
xb[i] = lower + (i)*width + rightw;
ya[i] = f(xa[i]);
yb[i] = f(xb[i]);
sum = sum + ya[i] + yb[i];
}
sum = sum*width / 2;
return sum;
}
int main()
{
int n; // n is for the subintervals
double a, b;
cout << "Enter the limits of integration, \nLower limit, a="; // get lower limit of integration
cin >> a;
cout << "Upper limit, b="; // upper limit of integration
cin >> b;
cout << "Number of subintervals, n=";
cin >> n;
cout << "The definite integral using two point Gaussian quadrature is " << twoGauss(a, b, n) << endl;
system("pause");
return 0;
}
I would like to eventually write a similar function for 3 point, 4 point, and 5 point quadrature, and also later 2 dimensional, 3-d, and 4-d, and also to be written for CUDA so I can use a graphics card to do the computation. But right now I'm just trying to focus on getting a simple 1 dimension, 2 point down. Once I figure that out, I figure the rest should follow straightforwardly. I'd appreciate any help you can give, this is my first foray into coding for anything except for an introductory C++ class in my undergrad.
I'm learning about Gaussian quadratures, and I was wondering if there is an example of a function that this method fails to accurately compute?
I'm working on solving some complex differential equations and integrals over the surface of a sphere. Part of my algorithm requires processing spherical signals in the Spherical Harmonics domain. I implemented it myself in matlab, but my implementation was a little unstable, so I decide to use (this package)[http://sourceforge.net/projects/libpsht/].
My only hiccup at this point is that the package supports spherical discretizations in 3 ways: HEALPix, Equirectangular Cylindrical Projections, or Gaussian Quadrature, and I'm not sure exactly what that means in terms of mapping latitude and longitude to a grid. I'm pretty sure I want ECP or Gaussian, but I really and truely don't understand the difference, and reading the wiki article on Gaussian Quadrature seemed to only make it more confusing.
Can anyone help with this?
My question is here: http://math.stackexchange.com/questions/732830/gaussian-quadrature-deriving-a-formula
Basically, I just don't know how to do this exercise and it would be great if someone could show me to go through this problem. Through that, I think I will be able to get a better understanding of how to use theorem.
Okay so i need the general gist of how to even work there out. Lets give a random function to integrate like f (x^(2)*ln(x)) from 1 to 1.5. When n = 2 and n=3 how do i approximate this? Could someone help, I kinda get when n=2 but could someone show full working? Thankyou in advanced
Iβm looking for someone who is very knowledgeable in Numerical Analysis topics. I also need a person who has access to mathematical software such as Maple lite or MATLAB. The software is used to facilite the process of these problems. These topics include interpolation and polynomial approximation, Nevilleβs method, divided differences, hermite interpolation, numerical differentiation, Gaussian quadrature, and norms of vectors and matrices. Please donβt contact me if youβre arenβt knowledgeable. I will be checking ofc. Donβt waste my time.
I hope this is cool/interesting. If you make it to the end, I could some help.
The principle of maximum entropy states that the probability distribution which represents the current state of knowledge about a system is the one with the largest entropy, subject to the appropriate constraints. If your constraints are a mean and a standard deviation, the principle of maximum entropy gives you a Gaussian. If your constraints are a mean and that the distribution is non-negative, the principle of maximum entropy gives you an Exponential distribution.
This gif https://gfycat.com/selfishcreativefeline shows a lower bound being added to a Gaussian. The bound starts at -6, and the distribution is very close to a Gaussian. The distribution changes as the bound changes until at -1, the distribution is basically an exponential distribution. Itβs bounded by -1, not 0, but close enough.
The algorithm fails for a lower bound between -1 and 0. Iβll explain briefly. The mean and standard deviations can be expressed as Lagrange multipliers. With some work, you can show that the distribution is of the form: p(x) = C e^(lambda1 * x + lambda2*x^2). It can be solved numerically. The problem is that the algorithm doesnβt know that lambda2 must be a negative number. If lambda2 is positive, the distribution has infinite area. Since numerically solving it requires a finite quadrature, the algorithm still finds a solution.
Adding skew seems to work. https://gfycat.com/zealousdefiantboar At least for the skew values I typically deal with.
Changing Kurtosis works for values between 1 and 3. https://gfycat.com/giganticearlyindusriverdolphin Kurtosis >= 1 + skew*skew. A Gaussian has a Kurtosis of 3. So I can reduce Kurtosis.
When there is sufficient skew, I can increase Kurtosis a bit. https://gfycat.com/unripebestdunlin However when skew=0. I canβt raise it above 3. The distribution is of the form: p(x) = C e^(lambda1 * x + lambda2*x^2 + lambda3*x^3 + lambda4*x^4). When I increase the Kurtosis, lambda4 > 0. The algorithm finds a solution.
Iβve searched the literature I can find. There is a uniqueness theorem, and the algorithm does give a result. The problem is that it only works because the quadrature in the numerical integral is finite.
Anyone have an idea of what to do? It would
... keep reading on reddit β‘Do your worst!
It really does, I swear!
For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.
I said "hey look, an escaPEA"
No one near me but it didn't half make me laugh for a good hour or so!
Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies π
Theyβre on standbi
Buenosdillas
Pilot on me!!
Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.
This sub is mostly just NSFW puns now.
If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.
Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.
Hello r/AskStatistics,
I'm having some trouble interpreting my the results of my glmm. Everything makes sense until I get to the interactions. So I have "lang" a factor with 3 levels (EP, BP, EN) and collType, a factor with 4 levels (baseline, EO, CC, FC). When I interact these with EN and baseline as the reference levels, how do I interpret it? What is the comparison being made here? Is it comparing with lang or collType? Or both? And what happened to the rest of the interactions, e.g., langEN:collTypecc? I'm so confused!
I'd be really grateful if someone could explain or at least point me to some resources that could help me read these results.
here's my output:
Generalized linear mixed model fit by maximum likelihood (Adaptive Gauss-Hermite Quadrature, nAGQ = 0) ['glmerMod']
Family: inverse.gaussian ( identity )
Formula: RT ~ lang * collType + (1 | item) + (1 | ID) + (1 + collType | ID) + (1 + lang | item)
Data: analysis
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 2e+05))
AIC BIC logLik deviance df.resid
348111.0 348361.8 -174024.5 348049.0 24094
Scaled residuals:
Min 1Q Median 3Q Max
-1.8198 -0.5953 -0.2195 0.3635 9.4057
Random effects:
Groups Name Variance Std.Dev. Corr
ID (Intercept) 1.830e+04 1.353e+02
collTypecc 2.425e+04 1.557e+02 -0.88
collTypeeo 2.839e+04 1.685e+02 -0.74 0.69
collTypefc 2.742e+04 1.656e+02 -0.98 0.79 0.70
ID.1 (Intercept) 1.624e+04 1.274e+02
item (Intercept) 0.000e+00 0.000e+00
langBP 4.334e+03 6.583e+01 NaN
langEP 4.339e+03 6.587e+01 NaN 0.78
item.1 (Intercept) 3.417e+03 5.846e+01
Residual 9.603e-05 9.799e-03
Number of obs: 24125, groups: ID, 329; item, 90
Fixed effects:
Estimate Std. Error t value Pr(>|z|)
(Intercept) 1257.64 22.50 55.892 < 2e-16 ***
langBP 207.83 29.77 6.982 2.92e-12 ***
langEP 185.22 30.45 6.083 1.18e-09 ***
collTypecc -176.83 26.70 -6.624 3.50e-11 ***
collTypeeo -138.12 27.87 -4.956 7.20e-07 ***
collTypefc -246.22 27.03 -9.108 < 2e-16 ***
What did 0 say to 8 ?
" Nice Belt "
So What did 3 say to 8 ?
" Hey, you two stop making out "
When I got home, they were still there.
I won't be doing that today!
You take away their little brooms
This morning, my 4 year old daughter.
Daughter: I'm hungry
Me: nerves building, smile widening
Me: Hi hungry, I'm dad.
She had no idea what was going on but I finally did it.
Thank you all for listening.
There hasn't been a post all year!
Itβs pronounced βNoel.β
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.