cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

4-Participant

## Extracting a Multivariate Fitting Function

Hi All --

I have 182 (x,y,z) data triplets to which I would like to fit a surface. I am able to get a very good fit with a 12th order multinomial using the regress function. However, I am having difficulty symbolically extracting the entire function. I use the short programs included in the "Multivariate Regression" worksheet in the Resource Center, and this will provide correct interpolated values. What I am more interested in is the actual function in symbolic form so that I can manipulate it in other ways -- gradient, directional derivatives, etc. If I try to get the function symbolically, I get a "subscript too big or too small" error. Any ideas?

Thanks.

Matt
14 REPLIES 14
19-Tanzanite
(To:MoeSzyslak)
You didn't attach the data files.

Richard
4-Participant
(To:RichardJ)
Sorry -- here are the data files....

Matt
1-Newbie
(To:MoeSzyslak)
First, that symbolic construction doesn't work in the posted example, why would you expect it to work in your work sheet? That doesn't solve your problem.

Second, I'm a little nervous about using reserved words like "coeffs" for other purposes. Does that really work? That didn't solve your problem either.

Third, WOW! Is that REALLY the order in which the term appears? Is that motivated by anything? Still, this won't solve your problem.
4-Participant
(To:TKHunny)
First -- to what symbolic construction and to which posted example are you referring?

Second -- the variable "coeff" was taken directly from a Resource Center file -- it worked there.

Third -- I'm afraid I don't get your point here.

Thanks for looking at the problem.

Matt
1-Newbie
(To:MoeSzyslak)
p(X,Y) -> Error. This does not show the coefficients.

"coeffs" - Right. And it was a bad idea there, too.
23-Emerald II
(To:MoeSzyslak)
Matt

I think the recursion may be behind the symbolic problems.

Please see attached M2000 format worksheet (Note: created in M11.1)

Stuart
1-Newbie
(To:StuartBruff)
Not sure exactly what you are expecting to get, or what you are trying to illustrate.

On my system (2001i) the last function does not evaluate symbolically. I thought that was still failing in 11 -- has it been fixed?

Your expression 6 is not a recursive function, as it does not call itself but rather the coefficients function from the previous expression. Probably a good thing too, as N is not a parameter, and will never be equal to one.

Tom Gutman
23-Emerald II
(To:TomGutman)
On 9/3/2003 6:44:37 PM, Tom_Gutman wrote:
>Not sure exactly what you are expecting to get, or what you are trying to illustrate.

Don't worry about it, Tom - neither do I apparently.

>Your expression 6 is not a recursive function, as it does not call itself but rather the coefficients function from the previous expression. Probably a good thing too, as N is not a parameter, and will never be equal to one.

Quite right. I originally kept the name as coeffs then decided to change the name to recurs and completely and utterly messed up the edit and, even worse, the checking. When, when, when will I ever learn. (that's rhetorical, by the way, or partially ... can't decide whether it's t = 1/0 or t = 1.0/0.0)

>On my system (2001i) the last function does not evaluate symbolically. I thought that was still failing in 11 -- has it been fixed?

The entire worksheet evaluates symbolically in 11.1

The real reasons for the original worksheet in this thread not working seem to be that the symbolic processor doesn't like:

a. evaluating z as constructed - it whines pitifully about the matrix dimensions being incompatible; using a range variable to create z helps.

b. when that's corrected, evaluating regress.

Stuart

4-Participant
(To:StuartBruff)
Unfortunately, very little of this worksheet evaluates symbolically in Mathcad 2001....perhaps I should upgrade....
19-Tanzanite
(To:MoeSzyslak)
On 9/8/2003 10:51:32 AM, tmattevans wrote:
>Unfortunately, very little of
>this worksheet evaluates
>2001....perhaps I should

Does the derivatives worksheet I posted work OK?

Also, if you have not noted what's going on in this thread:

you should read it. It relates to some serious plotting problems using the x-y grid from your worksheet.

Richard

23-Emerald II
(To:MoeSzyslak)
Although M11 has its share of problems, it seems to have more capability and less restrictions than 2001 users report. Besides, it's worth upgrading to M11 for the Undo feature alone 🙂

Stuart
19-Tanzanite
(To:MoeSzyslak)
The function p(X,Y), with the coefficients in coeffs and the powers of X and Y in the matrix I, together constitues a symbolic answer, and are all you need to get the derivatives. An expression 10 pages wide, with 91 terms, will not help.

Richard
1-Newbie
(To:RichardJ)
If you doubt about the first contour plot (under determined), then specify a bit more.

jmG

4-Participant
(To:RichardJ)
Richard --

Thank you very much for the help. Your solution is exactly what I need -- and more compact than what I was initially envisioning.

Matt
Announcements