[R] Odp: Coding matrix equation

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Mon, 11 Apr 2011 10:05:33 +0200

Hi

r-help-bounces_at_r-project.org napsal dne 11.04.2011 09:43:03:

> Hi all,
>
> I have two matrices:
>
> G<-matrix(c(2.0, 0.5, 0.5, 0.5, 2.0, 0.5, 0.5, 0.5,2.0),3,3)
> P<-matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5,1.0),3,3)
>
> and I want to run this equation to get a new matrix F:
>
> F = [P+2G]^-1/2 P [P+2G]^-1/2

Is this what you want?

(P+2*G)^-1/2 * P * (P+2*G)^-1/2

Regards
Petr

>
> Could someone please tell me how to code this in R?
>
> Many thanks in advance for your time.
>
> Best wishes,
> Matt
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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_at_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. Received on Mon 11 Apr 2011 - 08:08:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Apr 2011 - 08:50:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive