Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-28-2018 08:05 AM
(933 views)

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

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

It is bivariate Lomax distribution (see attachment).

Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

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.