Re: [R] use of sequence on ridge regression

2008-05-07 Thread Prof Brian Ripley

On Wed, 7 May 2008, Rodrigo Briceño wrote:


Sorry to bother with this topic, but I'm still not clear about the
meaning of the value set that is used on lambda values. Is there a
correct way of doing that? My doubt is how to choose those 3 values
that appear in the example.


I think you have not yet read the help for seq(): try printing out
seq(0,0.1,0.001).  There are not '3 values' here, but 3 arguments to a 
function.


'lambda' values start at 0 (no shrinkage), and how large you want them to 
be is problem-specific.  How many you ask for (101 here) is also 
problem-specific, but around 100 values is often used.




Thanks.

On Wed, May 7, 2008 at 9:29 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:

On Wed, 7 May 2008, Rodrigo Briceño wrote:



Nice to meet you Brian. The question is about the numbers that appears
after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used
for testing which value fits best. But I'm not sure if I need to put
whatever I think or what. I tried also with a set of 5 values and I get
an error. Is there a maximum allowed?



 So you mean the set of values of lambda?  It is just a set to be use for a
plot and for searching in the select() methods.

 There is an R function called sequence(), and it is not the same as seq().






plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

__

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30  Fax
+506  88-86-11-77  Celular
[EMAIL PROTECTED]
www.sanigest.com

MSN: [EMAIL PROTECTED]
SKYPE: rbriceno1087

_

This communication contains legal information which is privileged and
confidential. It is for the exclusive use of the address and
distribution, dissemination, copying or use by others is strictly
prohibited. If you have received this communication by error, please
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial
para el uso exclusivo del destinatario. La distribución, diseminación,
copia u otro uso por terceras personas es estrictamente prohibida. Si
usted ha recibido esta comunicación por error, le rogamos borrar el
mensaje original y comunicárnoslo a esta misma dirección.



Prof Brian Ripley wrote:
 What do you mean by 'the sequence option'?

 The authot of lm.ridge

 On Wed, 7 May 2008, Rodrigo Briceño wrote:

   Dear R users. I have a doubt about the use of the
   sequence option on
   Ridge regression. I'm trying to understand the
   use of this option when
   variables are highly linear correlated. I'm
   running a model where the
   variables HtShoes and Ht have high VIF values. My
   program is written
   below, but I'm not sure about the correct way of
   using the sequence
   option:

   library (faraway)
   data (seatpos)
   attach (seatpos)
   spos.mod <- lm(hipcenter ~ .,seatpos) summary
   (spos.mod)
   library(MASS)
   lm.ridge(hipcenter ~ .,seatpos)
   plot(lm.ridge(hipcenter ~ .,seatpos, lambda =
   seq(0,0.1,0.001)))
   select(lm.ridge(hipcenter ~ ., seatpos,lambda =
   seq(0,0.1,0.001)))

   Any advice will be appreaciated. Rodrigo B.

   __
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
   http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained,
   reproducible code.








 --
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented,

Re: [R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Sorry to bother with this topic, but I'm still not clear about the
meaning of the value set that is used on lambda values. Is there a
correct way of doing that? My doubt is how to choose those 3 values
that appear in the example.
Thanks.

On Wed, May 7, 2008 at 9:29 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> On Wed, 7 May 2008, Rodrigo Briceño wrote:
>
>
> > Nice to meet you Brian. The question is about the numbers that appears
> > after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used
> > for testing which value fits best. But I'm not sure if I need to put
> > whatever I think or what. I tried also with a set of 5 values and I get
> > an error. Is there a maximum allowed?
> >
>
>  So you mean the set of values of lambda?  It is just a set to be use for a
> plot and for searching in the select() methods.
>
>  There is an R function called sequence(), and it is not the same as seq().
>
>
>
>
> >
> > plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
> > select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))
> >
> > __
> >
> > Rodrigo Briceño
> > Project Manager
> > Sanigest Internacional
> >
> > +506  22-91-12-00 ext. 113   Oficina Costa Rica
> > +506  22-32-08-30  Fax
> > +506  88-86-11-77  Celular
> > [EMAIL PROTECTED]
> > www.sanigest.com
> >
> > MSN: [EMAIL PROTECTED]
> > SKYPE: rbriceno1087
> >
> > _
> >
> > This communication contains legal information which is privileged and
> > confidential. It is for the exclusive use of the address and
> > distribution, dissemination, copying or use by others is strictly
> > prohibited. If you have received this communication by error, please
> > delete the original message and e-mail us.
> >
> >
> > Esta comunicación contiene información legal privilegiada y confidencial
> > para el uso exclusivo del destinatario. La distribución, diseminación,
> > copia u otro uso por terceras personas es estrictamente prohibida. Si
> > usted ha recibido esta comunicación por error, le rogamos borrar el
> > mensaje original y comunicárnoslo a esta misma dirección.
> >
> >
> >
> > Prof Brian Ripley wrote:
> >  What do you mean by 'the sequence option'?
> >
> >  The authot of lm.ridge
> >
> >  On Wed, 7 May 2008, Rodrigo Briceño wrote:
> >
> >Dear R users. I have a doubt about the use of the
> >sequence option on
> >Ridge regression. I'm trying to understand the
> >use of this option when
> >variables are highly linear correlated. I'm
> >running a model where the
> >variables HtShoes and Ht have high VIF values. My
> >program is written
> >below, but I'm not sure about the correct way of
> >using the sequence
> >option:
> >
> >library (faraway)
> >data (seatpos)
> >attach (seatpos)
> >spos.mod <- lm(hipcenter ~ .,seatpos) summary
> >(spos.mod)
> >library(MASS)
> >lm.ridge(hipcenter ~ .,seatpos)
> >plot(lm.ridge(hipcenter ~ .,seatpos, lambda =
> >seq(0,0.1,0.001)))
> >select(lm.ridge(hipcenter ~ ., seatpos,lambda =
> >seq(0,0.1,0.001)))
> >
> >Any advice will be appreaciated. Rodrigo B.
> >
> >__
> >R-help@r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained,
> >reproducible code.
> >
> >
> >
> >
> >
>
>
>  --
>  Brian D. Ripley,  [EMAIL PROTECTED]
>  Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>  University of Oxford, Tel:  +44 1865 272861 (self)
>  1 South Parks Road, +44 1865 272866 (PA)
>  Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Nice to meet you Brian. The question is about the numbers that appears 
after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used 
for testing which value fits best. But I'm not sure if I need to put 
whatever I think or what. I tried also with a set of 5 values and I get 
an error. Is there a maximum allowed?

plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

__

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30  *Fax
*+506  88-86-11-77*  Celular**
[EMAIL PROTECTED] 
www.sanigest.com 

MSN: [EMAIL PROTECTED] 
SKYPE: rbriceno1087

_

This communication contains legal information which is privileged and 
confidential. It is for the exclusive use of the address and 
distribution, dissemination, copying or use by others is strictly 
prohibited. If you have received this communication by error, please 
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial 
para el uso exclusivo del destinatario. La distribución, diseminación, 
copia u otro uso por terceras personas es estrictamente prohibida. Si 
usted ha recibido esta comunicación por error, le rogamos borrar el 
mensaje original y comunicárnoslo a esta misma dirección.



Prof Brian Ripley wrote:
> What do you mean by 'the sequence option'?
>
> The authot of lm.ridge
>
> On Wed, 7 May 2008, Rodrigo Briceño wrote:
>
>> Dear R users. I have a doubt about the use of the sequence option on
>> Ridge regression. I'm trying to understand the use of this option when
>> variables are highly linear correlated. I'm running a model where the
>> variables HtShoes and Ht have high VIF values. My program is written
>> below, but I'm not sure about the correct way of using the sequence
>> option:
>>
>> library (faraway)
>> data (seatpos)
>> attach (seatpos)
>> spos.mod <- lm(hipcenter ~ .,seatpos) summary (spos.mod)
>> library(MASS)
>> lm.ridge(hipcenter ~ .,seatpos)
>> plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
>> select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))
>>
>> Any advice will be appreaciated. Rodrigo B.
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide 
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] use of sequence on ridge regression

2008-05-07 Thread Prof Brian Ripley

On Wed, 7 May 2008, Rodrigo Briceño wrote:


Nice to meet you Brian. The question is about the numbers that appears
after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used
for testing which value fits best. But I'm not sure if I need to put
whatever I think or what. I tried also with a set of 5 values and I get
an error. Is there a maximum allowed?


So you mean the set of values of lambda?  It is just a set to be use for a 
plot and for searching in the select() methods.


There is an R function called sequence(), and it is not the same as seq().



plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

__

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30      Fax
+506  88-86-11-77  Celular
[EMAIL PROTECTED]
www.sanigest.com

MSN: [EMAIL PROTECTED]
SKYPE: rbriceno1087

_

This communication contains legal information which is privileged and
confidential. It is for the exclusive use of the address and
distribution, dissemination, copying or use by others is strictly
prohibited. If you have received this communication by error, please
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial
para el uso exclusivo del destinatario. La distribución, diseminación,
copia u otro uso por terceras personas es estrictamente prohibida. Si
usted ha recibido esta comunicación por error, le rogamos borrar el
mensaje original y comunicárnoslo a esta misma dirección.



Prof Brian Ripley wrote:
  What do you mean by 'the sequence option'?

  The authot of lm.ridge

  On Wed, 7 May 2008, Rodrigo Briceño wrote:

Dear R users. I have a doubt about the use of the
sequence option on
Ridge regression. I'm trying to understand the
use of this option when
variables are highly linear correlated. I'm
running a model where the
variables HtShoes and Ht have high VIF values. My
program is written
below, but I'm not sure about the correct way of
using the sequence
option:

library (faraway)
data (seatpos)
attach (seatpos)
spos.mod <- lm(hipcenter ~ .,seatpos) summary
(spos.mod)
library(MASS)
lm.ridge(hipcenter ~ .,seatpos)
plot(lm.ridge(hipcenter ~ .,seatpos, lambda =
seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda =
seq(0,0.1,0.001)))

Any advice will be appreaciated. Rodrigo B.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained,
reproducible code.






--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] use of sequence on ridge regression

2008-05-07 Thread Prof Brian Ripley

What do you mean by 'the sequence option'?

The authot of lm.ridge

On Wed, 7 May 2008, Rodrigo Briceño wrote:


Dear R users. I have a doubt about the use of the sequence option on
Ridge regression. I'm trying to understand the use of this option when
variables are highly linear correlated. I'm running a model where the
variables HtShoes and Ht have high VIF values. My program is written
below, but I'm not sure about the correct way of using the sequence
option:

library (faraway)
data (seatpos)
attach (seatpos)
spos.mod <- lm(hipcenter ~ .,seatpos) summary (spos.mod)
library(MASS)
lm.ridge(hipcenter ~ .,seatpos)
plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

Any advice will be appreaciated. Rodrigo B.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Dear R users. I have a doubt about the use of the sequence option on
Ridge regression. I'm trying to understand the use of this option when
variables are highly linear correlated. I'm running a model where the
variables HtShoes and Ht have high VIF values. My program is written
below, but I'm not sure about the correct way of using the sequence
option:

library (faraway)
data (seatpos)
attach (seatpos)
spos.mod <- lm(hipcenter ~ .,seatpos) summary (spos.mod)
library(MASS)
lm.ridge(hipcenter ~ .,seatpos)
plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

Any advice will be appreaciated. Rodrigo B.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.