[19245] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] query: sum of arrays

daemon@ATHENA.MIT.EDU (Stefano Sofia)
Fri Sep 17 10:19:23 1999

Message-Id: <37E24BB9.66534CCA@isis.sunderland.ac.uk>
Date: Fri, 17 Sep 1999 15:10:01 +0100
From: Stefano Sofia <cs0sso@isis.sunderland.ac.uk>
Mime-Version: 1.0
To: s-news@wubios.wustl.edu
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Dear all,
I'm really sorry for the misleading notation I used in my previous
e-mail. I think I know what I'm doing, I simply used an informal
notation and not a S-Plus notation because I thought was clearer to
explain the problem in this way. Again sorry for the confusion it
caused.
Let me present everything, again, but this time in the appropriate way.

k is an index from 1 to n; for each k:

pp is a square ( i x i ) matrix therefore I defined it as
pp <- array(NA, dim =c( n , i , i ))

p is a vector of length i therefore I defined it as
p <- array(NA, dim = c( n , i ))

mm is a square ( i x i ) matrix where for each of its elements
corresponds a vector of length s, therefore I defined it as
mm <-array(NA, dim = c( n , i , i , s ))

m is a ( i x s ) matrix , therefore I defined it as
m <- array(NA, dim =c( n , i , s ))

C is a vector of length i and for each of its elements there is a square
( s x s ) matrix, therefore I defined it as
C <- array(NA, dim = c( n , i , s , s ))

CC is a square ( i x i ) matrix where each of its elements contains a
square ( s x s ) matrix, therefore I defined it as
CC <- array(NA, dim = c( n , i , i , s , s ))

For each k I have to evaluate:

m[ k , j , ] = SUM(for h=1 to i ) { pp[ k , h , j ] / p[ k , j ] } mm[ k
, h , j , ]

and

C[ k , j , , ] = SUM(for h=1:4)  ( pp[ k , h , j ] / p[ k , j ] ) { CC[
k , h , j , , ] + (mm[ k , h , j , ] - m[ k , j , ] ) ( mm[ k , h , j ,
] - m[ k , j , ] )' }

where j goes from 1 to i.

Could you please help me writing down the right loops in order to
evaluate the sums above reported ?
I hope that this time everything makes sense, sorry again for the
previous messages.

Stefano



-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post