Hi Rick,
I saw the code below written by you. I wounder if there is an extension to cover a bivariate case f(x,y)
start TrapIntegral(x,y); N = nrow(x); dx = x[2:N] - x[1:N-1]; meanY = ( y[2:N] + y[1:N-1] )/2; return( dx` * meanY ); finish;
Thank you
Majdi
Yes, but you have to work with triangles instead of rectangles.
The trapezoidal rule is a piecewise linear method that approximates the area under a 1-D curve on [a,b] by using the function evaluated at the endpoints. You use the two endpoints because "two points determine a line."
For the volume under a surface, you can use the fact that "three points determine a plane." Chop the domain of integration into triangles and approximate the volume under the surface on each triangle ABC as the volume under the plane defined by f(A), f(B), and F(C).
If the domain is polygonal, you can always decompose it exactly into a union of triangles. For nonpolygonal domains (for example, a surface), you can approximate the regions to arbitrary closeness by using triangles.
Hi Rick,
Thank you for the reply. I am kind of lost her.
Have you posted any code that is similar to this case. I may look at it and try to mimic it for my pdf.
Thank you
Salah
No, I have not posted any code. If you have a PDF, I suggest that you use more careful integration techniques. A crude linear approximation will not be an efficient way to compute probabilities.
What is the name (or formula) for your bivariate pdf?
It is bivariate Lomax distribution (see attachment).
Thank you
It seems to me that this function has an exact integral, so you don't need to use numerical methods at all. Just integrate w/r/t x from 0 to s and then integrate y from 0 to t to get an analytic expression for the bivariate CDF.
Thank you
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.