[R] how to apply summation sign formula to R

David Winsemius dwinsemius at comcast.net
Sat Aug 24 20:35:03 CEST 2013


On Aug 24, 2013, at 6:37 AM, Sebastian Hersberger wrote:

> Hi all
> 
> I have a short question relating to the usage of the summation sign in R.
> 
> Let's define A and B as two kxk matrice.
> My goal is to calculate the matrix C for the periods from 1 to 200 (n=1-200).
> 
> C^(n) = Σ_(j=1)^n [(Σ_(i=1)^(j-1) A^i ) B (Σ_(i=1)^(j-1) A^i)’  ]
> 
> How has that to be implemented in R (lets say for example for period = n = 150)?

I don't follow all this notation but you might want to look at the expm package that has a powm function. It's possible that the expm function may do what you want, but as I said I was unclear what the equation was attempting to do. Perhaps if you explained the steps in mathematical language, then other viewers who actually woke up to attend their linear algebra course might have a better chance of offering assistance.

( When I saw the earlier copy yesterday, I had hopes that such wiser viewers might chime in and still have such hopes.)

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list