Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Fernando Rios Avila <f.rios.a@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: How to solve the matrix equation AX = B for X without using Mata |

Date |
Thu, 15 Dec 2011 08:18:06 -0500 |

Also, a bit of traditional matrix algebra: AX = B X=inv(A)*B On Thu, Dec 15, 2011 at 8:11 AM, Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com> wrote: > You might want to reconsider Mata. The syntax is no more complicated, > and there are several advantages to doing numerical computations in > Mata, with a small overhead: > > ********************************** > matrix def A = (0.5, 0.25)' > matrix def B = (10, 0.5 \ 0.5, 15) > mata: st_matrix("C", /// > C=lusolve(st_matrix("B"), st_matrix("A"))) > mat li C > ********************************** > You might also want to read this excellent post by Bill Gould: > http://www.stata.com/statalist/archive/2011-02/msg00376.html > > Unless of course you are constrained by your Stata version... > > T > > On Thu, Dec 15, 2011 at 4:46 AM, Tiago V. Pereira > <tiago.pereira@mbe.bio.br> wrote: >> Dear statalisters, >> >> I need to perform the division of matrices A/B, and need to solve the >> matrix equation AX = B for X. >> >> Is there a quick way to solve for X without using Mata? >> >> For example, I have the following matrices: >> >> matrix A = (0.5, 0.25) >> matrix B = (10, 0.5 \ 0.5, 15) >> >> and the results should be something like: >> >> matrix C = (0.05, 0) >> >> >> Thanks for your time. >> >> Tiago >> >> >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/statalist/faq >> * http://www.ats.ucla.edu/stat/stata/ > > > > -- > Tirthankar Chakravarty > tchakravarty@ucsd.edu > tirthankar.chakravarty@gmail.com > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: How to solve the matrix equation AX = B for X without using Mata***From:*Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>

**References**:**st: How to solve the matrix equation AX = B for X without using Mata***From:*"Tiago V. Pereira" <tiago.pereira@mbe.bio.br>

**Re: st: How to solve the matrix equation AX = B for X without using Mata***From:*Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>

- Prev by Date:
**Re: st: How to solve the matrix equation AX = B for X without using Mata** - Next by Date:
**st: ml - could not calculate numerical derivatives missing values encountered** - Previous by thread:
**Re: st: How to solve the matrix equation AX = B for X without using Mata** - Next by thread:
**Re: st: How to solve the matrix equation AX = B for X without using Mata** - Index(es):