Re: [R] square root of inverse

2010-04-08 Thread David Winsemius


On Apr 8, 2010, at 1:45 AM, arindam fadikar wrote:


Dear users,

How to get a symmetric square root of a positive definite matrix? I  
have
tried using spectral decomposition, but some eigen values come out  
to be
complex. Is there any function in R that can give the symmetric  
square root

of a pd matrix?



require(expm)
?sqrtm



--
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

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


David Winsemius, MD
West Hartford, CT

__
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] square root of inverse

2010-04-08 Thread arindam fadikar
On Thu, Apr 8, 2010 at 5:38 PM, David Winsemius dwinsem...@comcast.netwrote:


 On Apr 8, 2010, at 1:45 AM, arindam fadikar wrote:

  Dear users,

 How to get a symmetric square root of a positive definite matrix? I have
 tried using spectral decomposition, but some eigen values come out to be
 complex. Is there any function in R that can give the symmetric square
 root
 of a pd matrix?


 require(expm)
 ?sqrtm


 expm is not a package, but a function which gives  exp of a matrix, and i
dont get any result from ?sqrtm. Please help.

  --
 Arindam Fadikar
 M.Stat
 Indian Statistical Institute.
 New Delhi, India

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


 David Winsemius, MD
 West Hartford, CT




-- 
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

[[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] square root of inverse

2010-04-08 Thread baptiste auguie
try this,

install.packages(expm, repos=http://R-Forge.R-project.org;)

On 8 April 2010 17:28, arindam fadikar arindam.fadi...@gmail.com wrote:
 On Thu, Apr 8, 2010 at 5:38 PM, David Winsemius dwinsem...@comcast.netwrote:


 On Apr 8, 2010, at 1:45 AM, arindam fadikar wrote:

  Dear users,

 How to get a symmetric square root of a positive definite matrix? I have
 tried using spectral decomposition, but some eigen values come out to be
 complex. Is there any function in R that can give the symmetric square
 root
 of a pd matrix?


 require(expm)
 ?sqrtm


 expm is not a package, but a function which gives  exp of a matrix, and i
 dont get any result from ?sqrtm. Please help.

  --
 Arindam Fadikar
 M.Stat
 Indian Statistical Institute.
 New Delhi, India

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


 David Winsemius, MD
 West Hartford, CT




 --
 Arindam Fadikar
 M.Stat
 Indian Statistical Institute.
 New Delhi, India

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


__
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] square root of inverse

2010-04-08 Thread Charles C. Berry

On Thu, 8 Apr 2010, arindam fadikar wrote:


On Thu, Apr 8, 2010 at 5:38 PM, David Winsemius dwinsem...@comcast.netwrote:



On Apr 8, 2010, at 1:45 AM, arindam fadikar wrote:

 Dear users,


How to get a symmetric square root of a positive definite matrix? I have
tried using spectral decomposition, but some eigen values come out to be
complex. Is there any function in R that can give the symmetric square
root
of a pd matrix?



require(expm)
?sqrtm


expm is not a package, but a function which gives  exp of a matrix, and i

dont get any result from ?sqrtm. Please help.



install.packages(expm, repos=http://R-Forge.R-project.org;)

HTH,

Chuck





 --

Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

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



David Winsemius, MD
West Hartford, CT





--
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

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



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] square root of inverse

2010-04-08 Thread David Winsemius


On Apr 8, 2010, at 11:28 AM, arindam fadikar wrote:




On Thu, Apr 8, 2010 at 5:38 PM, David Winsemius dwinsem...@comcast.net 
 wrote:


On Apr 8, 2010, at 1:45 AM, arindam fadikar wrote:

Dear users,

How to get a symmetric square root of a positive definite matrix? I  
have
tried using spectral decomposition, but some eigen values come out  
to be
complex. Is there any function in R that can give the symmetric  
square root

of a pd matrix?


require(expm)
?sqrtm


expm is not a package, but a function which gives  exp of a matrix,  
and i dont get any result from ?sqrtm. Please help.


It most assuredly _is_ a package. It's on R-forge rather than on CRAN.  
Since you apparently have the Matrix package loaded, you are seeing a  
different version of expm (the function). You might also try searching  
about this topic:


RSiteSearch(complex square root matrix)

Information on package 'expm'

Description:

Package:   expm
Type:  Package
Title: Matrix exponential
Version:   0.96-2
Date:  2009-06-06
Author:Vincent Goulet, Christophe Dutang,  
Martin Maechler, David
   Firth, Marina Shapira, Michael  
Stadelmann

Maintainer:Expm Developers
   expm-develop...@lists.r-forge.r-project.org 



--
David




--
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

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

David Winsemius, MD
West Hartford, CT




--
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India


David Winsemius, MD
West Hartford, CT

__
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] square root of inverse

2010-04-07 Thread arindam fadikar
Dear users,

How to get a symmetric square root of a positive definite matrix? I have
tried using spectral decomposition, but some eigen values come out to be
complex. Is there any function in R that can give the symmetric square root
of a pd matrix?

-- 
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India

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