Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Statistics on Matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28344] Re: Statistics on Matrices
  • From: "Ian McInnes" <ian at whisper-wood.demon.co.uk>
  • Date: Thu, 12 Apr 2001 02:18:07 -0400 (EDT)
  • References: <9b0sia$ra@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I am not sure how your 2x2 matrices are structured. I assume that each of
the elements in each of the 2x2 matrices is part of a vector of n data
elements for analysis.
However, the vector to be analyzed will have to be a straight list (i.e.
have the last subscript in the structure) before it can be processed by
Mathematica statistics functions. It may therefore be necessary to generate
lists of data from your matrices before processing.
You may find the functions in Statistics`DataManipulation` helpful in
generating data in the required format.

You can create a tensor comprising a 2x2 matrix, each element of which is a
vector of 10 random numbers, assign the result to a variable "data" and
display the result in tabulated form as follows:
In[1]:= TableForm[data = Table[Random[], {2}, {2}, {10}]]
Out[1]//TableForm=
    0.49369986230426244       0.9465224339344231
    0.9913285106572212        0.3784524458372144
    0.2898268826591832        0.644480988927919
    0.331982205797736         0.01240313919410749
    0.10761500670403604       0.870597641011543
    0.6706360058631035        0.402640901927991
    0.2020012635861316        0.818959662208764
    0.6420811858547422        0.40814147805443873
    0.7023892044184972        0.6970241571849349
    0.8879424968680832        0.3526417845221992

    0.27720159676674444       0.21616710481014687
    0.9154272002999428        0.04951965830702386
    0.7079952510554617        0.9734975233399488
    0.023583049959502077      0.365520186911535
    0.783501734462482         0.26964467087572375
    0.9240986896427216        0.6710672124698095
    0.41816836839627847       0.32901653441202977
    0.691600844161766         0.3531170477174275
    0.6758867277584459        0.3990470298641807
    0.2534626837796182        0.2684263105418185

Then you can get (for example) a LocationReport for each element as follows:
In[2]:= TableForm[Table[LocationReport[data[[i, j]] ], {i, 2}, {j, 2}] ]
Out[2]//TableForm=
  Mean->0.5319502624712997                      Mean->0.5531864632803535
  HarmonicMean->0.34085333609600316     HarmonicMean->0.1026177104224238
  Median->0.5678905240795022                   Median->0.5263112334911789

  Mean->0.5670926146282962                      Mean->0.3895023279249644
  HarmonicMean->0.16628892788688754     HarmonicMean->0.2179384207305456
  Median->0.683743785960106                     Median->0.34106679106472865

Regards,

Ian McInnes.

<Moranresearch at aol.com> wrote in message news:9b0sia$ra at smc.vnet.net...
> I have a series of 2x2 matrices
> How can I get a LocationReport on each element
> {{ai,bi},{ci,di}} , {i,1,n}
> or even simpler a mean for each element
> {{Mean[a],Mean[b]},{Mean[c],Mean[d}}
> I prefer to use the Location Report, DistributionReport etc if possible
> Thankyou.
>




  • Prev by Date: Re: Special Matrix
  • Next by Date: Re: Special Matrix
  • Previous by thread: Re: Statistics on Matrices
  • Next by thread: differential eq.