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:
Generalized Ridge Regression

Subject: Generalized Ridge Regression

From: Vivek Saxena

Date: 28 Mar, 2010 12:58:05

Message: 1 of 8

Hi,

Is there a command in MATLAB for performing a generalized ridge regression?

Thanks
Vivek

Subject: Generalized Ridge Regression

From: John D'Errico

Date: 28 Mar, 2010 13:21:06

Message: 2 of 8

"Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> Hi,
>
> Is there a command in MATLAB for performing a generalized ridge regression?

Yes. Use backslash.

help slash

All you need to do is to define the matrices.

John

Subject: Generalized Ridge Regression

From: Vivek Saxena

Date: 28 Mar, 2010 15:25:24

Message: 3 of 8

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <honl42$4qb$1@fred.mathworks.com>...
> "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> > Hi,
> >
> > Is there a command in MATLAB for performing a generalized ridge regression?
>
> Yes. Use backslash.
>
> help slash
>
> All you need to do is to define the matrices.
>
> John

John, does this give a solution to

(X'X + Lambda)Y = X'Y

where Lambda is a diagonal matrix, with unequal diagonal entries? I need the entries of the Lamdba matrix using a process similar to the ridge trace method. I do not have Lambda apriori.

Subject: Generalized Ridge Regression

From: Vivek Saxena

Date: 28 Mar, 2010 15:34:08

Message: 4 of 8

"Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honsd4$gme$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <honl42$4qb$1@fred.mathworks.com>...
> > "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > Is there a command in MATLAB for performing a generalized ridge regression?
> >
> > Yes. Use backslash.
> >
> > help slash
> >
> > All you need to do is to define the matrices.
> >
> > John
>
> John, does this give a solution to
>
> (X'X + Lambda)Y = X'Y
>
> where Lambda is a diagonal matrix, with unequal diagonal entries? I need the entries of the Lamdba matrix using a process similar to the ridge trace method. I do not have Lambda apriori.

Correction:

(X'X + Lambda)Z = X'Y

Subject: Generalized Ridge Regression

From: John D'Errico

Date: 28 Mar, 2010 16:02:05

Message: 5 of 8

"Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honstg$nmo$1@fred.mathworks.com>...
> "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honsd4$gme$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <honl42$4qb$1@fred.mathworks.com>...
> > > "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > Is there a command in MATLAB for performing a generalized ridge regression?
> > >
> > > Yes. Use backslash.
> > >
> > > help slash
> > >
> > > All you need to do is to define the matrices.
> > >
> > > John
> >
> > John, does this give a solution to
> >
> > (X'X + Lambda)Y = X'Y
> >
> > where Lambda is a diagonal matrix, with unequal diagonal entries? I need the entries of the Lamdba matrix using a process similar to the ridge trace method. I do not have Lambda apriori.
>
> Correction:
>
> (X'X + Lambda)Z = X'Y

You asked if matlab can perform a generalized ridge
regression.

First of all, do NOT do it by solving this form:

> (X'X + Lambda)Z = X'Y

Instead, use of the form:

[X;sqrt(Lambda)]\Y

is strongly preferred. This will be considerably more
accurate.

Next, if you don't have the diagonal matrix, then no,
nothing is provided in matlab to divine what you want
it to be.

John

Subject: Generalized Ridge Regression

From: Bruno Luong

Date: 28 Mar, 2010 17:11:07

Message: 6 of 8

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <honuht$hlh$1@fred.mathworks.com>...
> "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honstg$nmo$1@fred.mathworks.com>...
> > "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honsd4$gme$1@fred.mathworks.com>...
> > > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <honl42$4qb$1@fred.mathworks.com>...
> > > > "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> > > > > Hi,
> > > > >
> > > > > Is there a command in MATLAB for performing a generalized ridge regression?
> > > >
> > > > Yes. Use backslash.
> > > >
> > > > help slash
> > > >
> > > > All you need to do is to define the matrices.
> > > >
> > > > John
> > >
> > > John, does this give a solution to
> > >
> > > (X'X + Lambda)Y = X'Y
> > >
> > > where Lambda is a diagonal matrix, with unequal diagonal entries? I need the entries of the Lamdba matrix using a process similar to the ridge trace method. I do not have Lambda apriori.
> >
> > Correction:
> >
> > (X'X + Lambda)Z = X'Y
>
> You asked if matlab can perform a generalized ridge
> regression.
>
> First of all, do NOT do it by solving this form:
>
> > (X'X + Lambda)Z = X'Y
>
> Instead, use of the form:
>
> [X;sqrt(Lambda)]\Y

John, I'm sure you wanted to write
 
[X;sqrt(Lambda)]\[Y;0]

Bruno

Subject: Generalized Ridge Regression

From: Ambarish Jash

Date: 14 Apr, 2010 18:54:05

Message: 7 of 8

Hi Vivek try the function ridge, if you want to implement a linear ridge regression. If you want a kernel version of ridge regression you can download it from my mathworks page.

Subject: Generalized Ridge Regression

From: kahina izmeralda

Date: 17 Jun, 2011 12:04:07

Message: 8 of 8

"Vivek Saxena" wrote in message <honstg$nmo$1@fred.mathworks.com>...
> "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honsd4$gme$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <honl42$4qb$1@fred.mathworks.com>...
> > > "Vivek Saxena" <maverick280857@yahoo.com> wrote in message <honjot$f3c$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > Is there a command in MATLAB for performing a generalized ridge regression?
> > >
> > > Yes. Use backslash.
> > >
> > > help slash
> > >
> > > All you need to do is to define the matrices.
> > >
> > > John
> >
> > John, does this give a solution to
> >
> > (X'X + Lambda)Y = X'Y
> >
> > where Lambda is a diagonal matrix, with unequal diagonal entries? I need the entries of the Lamdba matrix using a process similar to the ridge trace method. I do not have Lambda apriori.
>
> Correction:
>
> (X'X + Lambda)Z = X'Y
b_ridge= [(X'X+lambda)^-1]X'Y
but there is also a command in matlab: ridge(Y,X,lambda)
the problem i had is that the results are not the same so i don't know witch one is the correct!

Tags for this Thread

No tags are associated with 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