人在江湖

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  82 Posts :: 10 Stories :: 169 Comments :: 0 Trackbacks

基本概念:

转置矩阵:

如果把mclip_image001n阶矩阵clip_image002的第i行改为第i列,第j列改为第j行,就可得到一个新的nclip_image001[1]m矩阵,记作clip_image003,称为A转置(矩阵),具体表示如下

clip_image004,则clip_image005

显然,n阶方阵的转置仍是n阶方阵,而且对任何矩阵A,有image

 

矩阵的乘法:

clip_image001[6]分别是m×n, n×p矩阵,则矩阵AB的乘积是一m×p矩阵,记为

clip_image002[4],

其中乘积矩阵C中第i行第k列处元素为

clip_image003[4],

并非任何两个矩阵都可以进行: 一个基本的条件是A的列数必须与B的行数相同

矩阵的乘法是不可交换的,或者说,交换之后结果通常不同。

 

单位矩阵

它是个方阵,除左上角到右下角的对角线(称为主对角线)上的元素均为1以外全都为0,即clip_image001[8].

 

逆矩阵:

An阶方阵,若存在n阶矩阵B使得AB=BA=In,则称A是可逆的,或说A是可逆矩阵,而B称为A的逆矩阵.可以证明,这样的逆矩阵是唯一的,因此可记为A-1,而且只需要B满足一个方程AB=InBA=In就是A的逆了.

 

基本语法:

The following statement assigns a 3 × 2 matrix literal to the matrix Z:
z={1  2,  3  4,  5  6};
Here is the resulting matrix:
Z
1 2
3 4
5 6
The following statement creates a matrix W that is three times the matrix Z:
w=3#z;
Here is the resulting matrix:
W
3 6
9 12
15 18

A repetition factor can be placed in brackets before a literal element to have the
element repeated. For example, the following two statements are equivalent:
answer={[2]    ’Yes’,  [2]    ’No’};
answer={’Yes’  ’Yes’,  ’No’  ’No’};

J function: J(  nrow<,ncol<,value> > );

I function: I(  dimension );

Index vector:

>    r=1:5;
R
1  row 5  cols        (numeric)
1 2 3 4 5
>    s=10:6;
S
1  row 5  cols        (numeric)
10 9 8 7 6
>    t=’abc1’:’abc5’;
T
1  row 5  cols        (character,  size  4)
abc1  abc2  abc3  abc4  abc5

 

解方程组:

3x1 − x2 + 2x3    =   8
2x1 − 2x2 + 3x3    =   2
4x1 + x2 − 4x3    =   9

proc iml;

reset print;

   a={3 -1 2,

2 -2 3,

4 1 -4};

   c={8,2,9};

   x=inv(a)*c;

quit;

解为3,5,2

posted on 2011-09-09 07:54 人在江湖 阅读(1003) 评论(0)  编辑  收藏 所属分类: BI

只有注册用户登录后才能发表评论。


网站导航: