Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Improving the condition number of rectangular matrix

Subject: Improving the condition number of rectangular matrix

From: drgz

Date: 30 Jun, 2010 09:07:03

Message: 1 of 7

As the topic says, does anyone have any tips for improving the conditioned number of a rectangular matrix?

I'm using rectangular matrices for estimating a system according to a linear model,

y = H*w,

however, with the code I use now, the condition number of the complex matrix H can be in the order of 10^6 ~ 10^20. Although I don't get any errors or warnings, and the results in most cases do look OK, however, when going through some literature reg. solving these systems numerically, I always see a paragraph regarding the condition number of the matrix and that it should be as low as possible.

I make the H matrix with the following code

x - N x 1 complex signal vector (typically a rrc-filtered qam-signal or something)
H = zeros(N,(D+1)*(P+1))
P = 7; % max order of nonlinearity (i.e. 7)
D = 5; % max memory order (i.e. 5)
idx = 0; % iterator for column index
for d = 0:D
         xd = [zeros(d,1); x(1:end-d)];
         for P = 0:P
                  idx = idx + 1;
                  H(:,idx) = xd.*abs(xd).^p; % (or some orthogonal polynomial basis functions, e.g., hermitian, laguerre, etc)
         end
end

Is it something that I can do in order to improve the condition number of this? I've read a bit about preconditioning, however, if I've understood it correct, most methods are for square matrices, which I don't have in my problem.

Subject: Improving the condition number of rectangular matrix

From: Faraz Afzal

Date: 30 Jun, 2010 10:11:03

Message: 2 of 7

"drgz " <syrehue@hotmail.com> wrote in message <i0f1fn$dov$1@fred.mathworks.com>...
> As the topic says, does anyone have any tips for improving the conditioned number of a rectangular matrix?
>
> I'm using rectangular matrices for estimating a system according to a linear model,
>
> y = H*w,
>
> however, with the code I use now, the condition number of the complex matrix H can be in the order of 10^6 ~ 10^20. Although I don't get any errors or warnings, and the results in most cases do look OK, however, when going through some literature reg. solving these systems numerically, I always see a paragraph regarding the condition number of the matrix and that it should be as low as possible.
>
> I make the H matrix with the following code
>
> x - N x 1 complex signal vector (typically a rrc-filtered qam-signal or something)
> H = zeros(N,(D+1)*(P+1))
> P = 7; % max order of nonlinearity (i.e. 7)
> D = 5; % max memory order (i.e. 5)
> idx = 0; % iterator for column index
> for d = 0:D
> xd = [zeros(d,1); x(1:end-d)];
> for P = 0:P
> idx = idx + 1;
> H(:,idx) = xd.*abs(xd).^p; % (or some orthogonal polynomial basis functions, e.g., hermitian, laguerre, etc)
> end
> end
>
> Is it something that I can do in order to improve the condition number of this? I've read a bit about preconditioning, however, if I've understood it correct, most methods are for square matrices, which I don't have in my problem.


Hi Mr/Ms. (drgz)

Similar problem has been asked and solved artistically in the past , and your problem falls into the same category,

I would say you can still apply the left preconditioning methods where a diagonal matrix of max values of rows are used to improve conditions..

Following post will be helpful for you.

http://www.mathworks.com/matlabcentral/newsreader/view_thread/268503

Let me know if this proved to be help.

Regards,
Muhammad Faraz

Subject: Improving the condition number of rectangular matrix

From: drgz

Date: 6 Jul, 2010 09:28:06

Message: 3 of 7

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0f57n$fiv$1@fred.mathworks.com>...
> "drgz " <syrehue@hotmail.com> wrote in message <i0f1fn$dov$1@fred.mathworks.com>...
> > As the topic says, does anyone have any tips for improving the conditioned number of a rectangular matrix?
> >
> > I'm using rectangular matrices for estimating a system according to a linear model,
> >
> > y = H*w,
> >
> > however, with the code I use now, the condition number of the complex matrix H can be in the order of 10^6 ~ 10^20. Although I don't get any errors or warnings, and the results in most cases do look OK, however, when going through some literature reg. solving these systems numerically, I always see a paragraph regarding the condition number of the matrix and that it should be as low as possible.
> >
> > I make the H matrix with the following code
> >
> > x - N x 1 complex signal vector (typically a rrc-filtered qam-signal or something)
> > H = zeros(N,(D+1)*(P+1))
> > P = 7; % max order of nonlinearity (i.e. 7)
> > D = 5; % max memory order (i.e. 5)
> > idx = 0; % iterator for column index
> > for d = 0:D
> > xd = [zeros(d,1); x(1:end-d)];
> > for P = 0:P
> > idx = idx + 1;
> > H(:,idx) = xd.*abs(xd).^p; % (or some orthogonal polynomial basis functions, e.g., hermitian, laguerre, etc)
> > end
> > end
> >
> > Is it something that I can do in order to improve the condition number of this? I've read a bit about preconditioning, however, if I've understood it correct, most methods are for square matrices, which I don't have in my problem.
>
>
> Hi Mr/Ms. (drgz)
>
> Similar problem has been asked and solved artistically in the past , and your problem falls into the same category,
>
> I would say you can still apply the left preconditioning methods where a diagonal matrix of max values of rows are used to improve conditions..
>
> Following post will be helpful for you.
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/268503
>
> Let me know if this proved to be help.
>
> Regards,
> Muhammad Faraz


Thanks for the link! I haven't had time to try to implement the various methods disucssed in the other post yet, but I'll give it a try the coming week.

Best regards,
drgz

Subject: Improving the condition number of rectangular matrix

From: Greg Heath

Date: 6 Jul, 2010 13:07:49

Message: 4 of 7

On Jun 30, 5:07 am, "drgz " <syre...@hotmail.com> wrote:
> As the topic says, does anyone have any tips for improving the conditioned number of a rectangular matrix?
>
> I'm using rectangular matrices for estimating a system according to a linear model,
>
> y = H*w,
>
> however, with the code I use now, the condition number of the complex matrix H can be in the order of 10^6 ~ 10^20. Although I don't get any errors or warnings, and the results in most cases do look OK, however, when going through some literature reg. solving these systems numerically, I always see a paragraph regarding the condition number of the matrix and that it should >be as low as possible.

especially if you are using

w = inv(H)*y.

However, I hope you aren't doing that.

help slash

Greg

Subject: Improving the condition number of rectangular matrix

From: drgz

Date: 6 Jul, 2010 13:29:08

Message: 5 of 7

Greg Heath <heath@alumni.brown.edu> wrote in message <a74d56d1-1acc-48eb-b23e-0838de7b82f1@i28g2000yqa.googlegroups.com>...
> On Jun 30, 5:07 am, "drgz " <syre...@hotmail.com> wrote:
> > As the topic says, does anyone have any tips for improving the conditioned number of a rectangular matrix?
> >
> > I'm using rectangular matrices for estimating a system according to a linear model,
> >
> > y = H*w,
> >
> > however, with the code I use now, the condition number of the complex matrix H can be in the order of 10^6 ~ 10^20. Although I don't get any errors or warnings, and the results in most cases do look OK, however, when going through some literature reg. solving these systems numerically, I always see a paragraph regarding the condition number of the matrix and that it should >be as low as possible.
>
> especially if you are using
>
> w = inv(H)*y.
>
> However, I hope you aren't doing that.
>
> help slash
>
> Greg

So far I've mostly used

w = pinv(H)*y; (or pseudoinverse by Bruno Luong)

since I for some other similar matrices (constructed with different polynomial basis functions) tend to get rank deficiency problems if I use

w = H\y;

So basically I'd like to see if by improving the condition number, the modeling of the nonlinear system will be improved as well (better MSE or such). But I'll come back to this when I've made some attempts on preconditioning the data matrix :)

Subject: Improving the condition number of rectangular matrix

From: drgz

Date: 6 Jul, 2010 13:34:04

Message: 6 of 7

Just to avoid any misunderstanding reg. my previous post;
I'm modeling a nonlinear system with a linear-in-parameter model, hence, I try to solve y = H*w :)

Subject: Improving the condition number of rectangular matrix

From: drgz

Date: 26 Jul, 2010 13:04:06

Message: 7 of 7

Been trying some of the techniques discussed in the order post; but I'm not sure if I'm on the right track.

I.e. the technique by multiplying the data matrix, H, with a diagonal matrix D where the diagonal elements are the maximum abs. values of the data matrix.

If I've understood this correct, I compute;

[m,n] = size(H);
D = zeros(m);
for j = 1:m
    D(m,m) = max(abs(H(m,:)));
end

DH = D*H; % (m-by-m *m-by-n = m-by-n)
Dy = D*y; % (m-by-m * m-by-1 = m-by-1)
w_hat = DH\Dy; % or w = pinv(DH)*Dy; (m-by-n \ m-by-1 = n-by-1)
y_hat = DH*w_hat; % (m-by-n * n-by-1 = m-by-1)

At the moment I haven't tried this with my complete x and y-vectors, as the D matrix would be approximately 16k-by-16k, consuming more than 2GB ram. However, when trying with just a part of the x and y vectors (~length i.e. 1000), the condition number of DH is greater than H originally, and when solving the linear system I end up with a greater error than without using this technique (~MSE = ~ 60dB with this technique, Vs. MSE = -55 dB originally). If I switch to

y_hat = X*w_hat;

using the same w_hat as derived above, the MSE is about -33 dB, still far worse than without using this method, hence I assume I do something wrong (if so, what?).

As for trying other methods, will it be the same solving

[Q R] = mgs_qr(H); % Modified Gram-Schmidt QR-decomposition (using MATLABs built in QR function takes ages with my full matrix, any tips of speeding up this?)
w_hat = Q\y;
y_hat = Q*y;

?

Doing this, I get a MSE of ~-55 dB as I originally did without applying any methods at all, however, the Q matrix now got a condition number equal to one, which should be good. But the question then is, should have I managed to get any better results, i.e. lower MSE, by doing this or?

And maybe someone could recommend a good book(s) which cover the topic so I can do some reading myself.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us