Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linear regression
Date: Sun, 18 May 2008 11:29:02 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 26
Message-ID: <g0p3tu$qj7$1@fred.mathworks.com>
References: <13a0ad36-75d8-4ca0-b585-727d3a8ce1a9@w8g2000prd.googlegroups.com>  <2e7d4e65-1ce4-4bf3-8ab3-81f0bae4638c@c19g2000prf.googlegroups.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1211110142 27239 172.30.248.37 (18 May 2008 11:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 18 May 2008 11:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:469085


fas <faisalmufti@gmail.com> wrote in message <2e7d4e65-1ce4-4bf3-
8ab3-81f0bae4638c@c19g2000prf.googlegroups.com>...

> Ok, X and Y were for an example case are of size 100. In actual X and
> Y are both of 2D of size (100x100  again example case). I converted
> them to vectorized form as 10000x1. So I have 10000 equations each for
> one point and now I want to fit polyfit. But the problem is that as
> they are converted from 2D matrix. If I plot in 1D they do not appear
> right and hence I believe polyfit may not work. The other option I can
> think of is to sort it after converting it into vectorized form, so
> that then can come in some order (for of some curve). Will it be ok to
> apply polyfit on it. Will the coefficient that I find will have same
> meaning or if the regression is done on the same 2D function (some
> how)
> Thanks,

What does not "appear" right?

If your model is as stated, then this is correct.

I think that you are asking to do a 2-d regression,
in both the x and y directinos, but for some reason
do not realize that is what you want to do. Or, you
just don't want to admit it.

John