[R] Efficient algorithm to get a solution path for ridge regression?

2010-04-15 Thread Kenneth Lo
With the use of the LARS algorithm, a path of solutions corresponding  
to a sequence of the regularization parameter can be obtained for  
LASSO (or even the elastic net, a hybrid between LASSO and ridge) at  
the cost of one linear regression. In terms of computational speed  
LASSO seems to have beaten ridge regression, the solution of which  
needs to be computed individually, at the cost of one linear  
regression, for each regularization parameter. Is there any efficient  
method to compute a path of solutions for ridge regression  
corresponding to a sequence of the regularization parameter? Thanks.


__
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] Efficient algorithm to get a solution path for ridge regression?

2010-04-15 Thread Kenneth Lo
Thanks for your pointer. I looked into Applied Regression Analysis  
by Draper and Smith, and the ridge trace solution can be obtained  
efficiently by expressing it in canonical form. It could be coded  
without much difficulty, but I'm just wondering if there's any package  
which has already implemented this (or other) efficient way of  
returning a solution path for a sequence of regularization parameter?  
The function provided by MASS computes the solution individually for  
each value of the parameter. A quick look into the parcor and  
penalized packages seems to be promising, but I need to check the  
source code to see if they really implement an efficient algorithm as  
desired. Any input to this would be much appreciated.


Thanks again.


On 15-Apr-10, at 8:49 AM, Charles C. Berry wrote:


On Wed, 14 Apr 2010, Kenneth Lo wrote:

With the use of the LARS algorithm, a path of solutions  
corresponding to a sequence of the regularization parameter can be  
obtained for LASSO (or even the elastic net, a hybrid between LASSO  
and ridge) at the cost of one linear regression. In terms of  
computational speed LASSO seems to have beaten ridge regression,  
the solution of which needs to be computed individually, at the  
cost of one linear regression, for each regularization parameter.  
Is there any efficient method to compute a path of solutions for  
ridge regression corresponding to a sequence of the regularization  
parameter? Thanks.


Yes.

Check a textbook like Draper and Smith. Or Google for course notes.

HTH,

Chuck



__
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.



Charles C. Berry(858) 534-2098
   Dept of Family/Preventive  
Medicine

E mailto:cbe...@tajo.ucsd.edu   UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego  
92093-0901





__
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] Compilation error on installing rgl package

2008-02-21 Thread Kenneth Lo
Thank you for your reply.  Hope that it will be
available soon.

Kenneth


--- Duncan Murdoch [EMAIL PROTECTED] wrote:

 On 20/02/2008 4:54 PM, Kenneth Lo wrote:
  Hi all,
  
  I encountered difficulties when I tried to install
 the
  rgl package.  I'm using R devel (2.7.0) on Mac OS
 X
  10.5.1.  Below is the message popping up when
  compiling the package from source.
 
 There's been some discussion of this on the
 R-sig-mac list.  The problem 
 is that none of the developers of rgl have access to
 64 bit OSX (or 10.5 
 of any type, for that matter), and nobody with
 access has provided a 
 patch.
 
 Duncan Murdoch
 
  I'd be grateful if someone can help me solve the
  problem.
  
  Thanks,
  Kenneth
  
  * Installing *source* package 'rgl' ...
  checking for gcc... gcc -arch x86_64 -std=gnu99
  checking for C compiler default output file
 name...
  a.out
  checking whether the C compiler works... yes
  checking whether we are cross compiling... no
  checking for suffix of executables... 
  checking for suffix of object files... o
  checking whether we are using the GNU C
 compiler...
  yes
  checking whether gcc -arch x86_64 -std=gnu99
 accepts
  -g... yes
  checking for gcc -arch x86_64 -std=gnu99 option to
  accept ANSI C... none needed
  checking how to run the C preprocessor... gcc
 -arch
  x86_64 -std=gnu99 -E
  checking for gcc... (cached) gcc -arch x86_64
  -std=gnu99
  checking whether we are using the GNU C
 compiler...
  (cached) yes
  checking whether gcc -arch x86_64 -std=gnu99
 accepts
  -g... (cached) yes
  checking for gcc -arch x86_64 -std=gnu99 option to
  accept ANSI C... (cached) none needed
  checking for libpng-config... yes
  configure: using libpng-config
  configure: using libpng dynamic linkage
  checking for X... libraries /usr/X11/lib, headers
  /usr/X11/include
  checking for glEnd in -lGL... yes
  checking for gluProject in -lGLU... yes
  configure: creating ./config.status
  config.status: creating src/Makevars
  ** libs
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c BBoxDeco.cpp -o BBoxDeco.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c Background.cpp -o
 Background.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c Color.cpp -o Color.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c Disposable.cpp -o
 Disposable.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c FaceSet.cpp -o FaceSet.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c Light.cpp -o Light.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include  
 -g
  -O2 -fPIC  -g -O2 -c LineSet.cpp -o LineSet.o
  g++ -arch x86_64
 
 -I/Library/Frameworks/R.framework/Resources/include
 
 -I/Library/Frameworks/R.framework/Resources/include
 

-I/System/Library/Frameworks/OpenGL.framework/Headers
 
  -DHAVE_PNG_H -I/usr/local/include/libpng12
  -I/usr/X11/include -DDarwin -DNO_GL_PREFIX
  -I/usr/X11R6/include -Iext -I/usr/local/include

[R] Compilation error on installing rgl package

2008-02-20 Thread Kenneth Lo
Hi all,

I encountered difficulties when I tried to install the
rgl package.  I'm using R devel (2.7.0) on Mac OS X
10.5.1.  Below is the message popping up when
compiling the package from source.

I'd be grateful if someone can help me solve the
problem.

Thanks,
Kenneth

* Installing *source* package 'rgl' ...
checking for gcc... gcc -arch x86_64 -std=gnu99
checking for C compiler default output file name...
a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
yes
checking whether gcc -arch x86_64 -std=gnu99 accepts
-g... yes
checking for gcc -arch x86_64 -std=gnu99 option to
accept ANSI C... none needed
checking how to run the C preprocessor... gcc -arch
x86_64 -std=gnu99 -E
checking for gcc... (cached) gcc -arch x86_64
-std=gnu99
checking whether we are using the GNU C compiler...
(cached) yes
checking whether gcc -arch x86_64 -std=gnu99 accepts
-g... (cached) yes
checking for gcc -arch x86_64 -std=gnu99 option to
accept ANSI C... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries /usr/X11/lib, headers
/usr/X11/include
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c BBoxDeco.cpp -o BBoxDeco.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c Background.cpp -o Background.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c Color.cpp -o Color.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c Disposable.cpp -o Disposable.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c FaceSet.cpp -o FaceSet.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c Light.cpp -o Light.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c LineSet.cpp -o LineSet.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c LineStripSet.cpp -o
LineStripSet.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin -DNO_GL_PREFIX
-I/usr/X11R6/include -Iext -I/usr/local/include   -g
-O2 -fPIC  -g -O2 -c Material.cpp -o Material.o
g++ -arch x86_64
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include
-I/System/Library/Frameworks/OpenGL.framework/Headers 
-DHAVE_PNG_H -I/usr/local/include/libpng12
-I/usr/X11/include -DDarwin