Contents

1 ろ碁 覿(spectral decomposition)
2 觜豺豺覿(singular value decomposition)
3 貊ろる(cholesky decomposition)
4
5 蟇磯Μ


1 ろ碁 覿(spectral decomposition) #

譯殊焔 覿 襭豢 谿 豢曙 覈朱 .
  • $values 螻給壱 轟煙
  • $vectors 轟焔押
> cost.d <-read.table("cost.d", header=T)
> a <- eigen(var(cost.d))
> a
$values
[1] 34.310148 13.210205  7.000452

$vectors
          [,1]        [,2]       [,3]
[1,] 0.7432852 -0.38596102  0.5464075
[2,] 0.6198618  0.09017059 -0.7795130
[3,] 0.2515918  0.91809768  0.3062650

> 

譯殊焔覿 蟆郁骸企.
> p <- prcomp(na.exclude(cost.d), scale=FALSE)
> p
Standard deviations:
[1] 5.857487 3.634585 2.645837

Rotation:
               PC1         PC2        PC3
fuel    -0.7432852  0.38596102 -0.5464075
repair  -0.6198618 -0.09017059  0.7795130
capital -0.2515918 -0.91809768 -0.3062650
> summary(p)
Importance of components:
                         PC1   PC2   PC3
Standard deviation     5.857 3.635 2.646 --> 譴ク谿
Proportion of Variance 0.629 0.242 0.128 --> 蠍一
Cumulative Proportion  0.629 0.872 1.000 --> 蠍一
> 

2 觜豺豺覿(singular value decomposition) #

譴蟯覿, (biplot)煙 襷 一碁.
> svd(cost.d)
$d
[1] 110.32576  22.84343  16.41742

$u
             [,1]          [,2]          [,3]
 [1,] -0.21215522  0.0557455210  0.0725904757
 [2,] -0.07619639  0.0370332907 -0.1049516978
 [3,] -0.11574898 -0.1296149503 -0.2949589350
 [4,] -0.08932679 -0.1431146096  0.1234046163
 [5,] -0.14429006 -0.1031125634 -0.1470916023
 [6,] -0.16302051 -0.0006433233 -0.1984222467
 [7,] -0.18418323  0.0017336700  0.0915719044
 [8,] -0.19172148  0.0688678809  0.2756749095
 [9,] -0.26590080  0.6501805280 -0.1318042864
[10,] -0.16263552 -0.0320523374 -0.0566200519
[11,] -0.11187080 -0.0840168906  0.0213498245
[12,] -0.12248962 -0.0873105804 -0.1716797465
[13,] -0.13593625 -0.1053789574 -0.1136849473
[14,] -0.13375240  0.0172668362 -0.0684177005
[15,] -0.20813275 -0.1385088088  0.2807563704
[16,] -0.10553498  0.0231003004 -0.2180119006
[17,] -0.14920051 -0.1709554639 -0.0723412842
[18,] -0.12690229 -0.2320596468 -0.2074527082
[19,] -0.16796813 -0.0919029542 -0.0486415090
[20,] -0.17239678 -0.1332897290  0.3956716562
[21,] -0.32277302  0.1043890831 -0.0005510683
[22,] -0.15240260  0.0917636909 -0.0136353114
[23,] -0.24991933 -0.1596454855  0.0679756164
[24,] -0.21008575 -0.1203127239  0.0199879122
[25,] -0.16962065 -0.3547313171 -0.1525053416
[26,] -0.09693646  0.0794405351 -0.0689330444
[27,] -0.14454429  0.0625152432  0.2635558982
[28,] -0.14497868  0.1487047602  0.0234333724
[29,] -0.09958599 -0.0022836128 -0.2181248591
[30,] -0.11888776  0.0022965253  0.1200896118
[31,] -0.15912291  0.2178887605  0.1323627644
[32,] -0.13400657 -0.0347721187  0.2107091410
[33,] -0.21290915 -0.0332402427  0.0267472202
[34,] -0.14362342 -0.0679547768  0.1378210132
[35,] -0.15695219 -0.1248936937 -0.2144344826
[36,] -0.16102451  0.2766651395 -0.2039635092

$v
           [,1]       [,2]        [,3]
[1,] -0.7008955  0.5017183 -0.50697566
[2,] -0.4766155  0.1993547  0.85620987
[3,] -0.5306441 -0.8417461 -0.09939989

> 

3 貊ろる(cholesky decomposition) #

蠏 豢 伎. 覿覿 豌 覘朱讌 覈襯願 <;;
> At <- chol(var(cost.d))
> At
            fuel   repair   capital
fuel    4.797224 2.577823 0.6058939
repair  0.000000 3.301354 0.9726902
capital 0.000000 0.000000 3.5566980
> t(At)%*%At #螻給壱
             fuel    repair   capital
fuel    23.013361 12.366395  2.906609
repair  12.366395 17.544111  4.773082
capital  2.906609  4.773082 13.963334

4 #

蠏朱覿一 襭 殊 襯 豸′ 豌
> S <- var(cost.d)
> prod(eigen(S)$values) #朱 覿
[1] 3172.914
> sum(diag(S)) #豌企
[1] 54.52081
> 
伎豺襯 蟇壱企慨覃..(螻給郁骸 蟯螻 谿瑚)
> S <- var(cost.d[-c(9,21), ]) #9, 21覯讌 襭 , 伎豺企襦.., 貊る(,)譯殊!!
> prod(eigen(S)$values) #朱 覿
[1] 1052.025
> sum(diag(S)) #豌企
[1] 35.27106
> 

5 蟇磯Μ #

伎 蟇磯Μ襯 覦覯朱, 伎豺 蟇一 譯朱 .
  • 企Μ 蟇磯Μ(Euclidean distance) : 覈 覲螳 狩 襦 豸′螻, 襴曙 蟆曙 .
  • 覲 襷朱碁 蟇磯Μ(mahalanobis distance): 覈 襭 螳 覲瑚概覿壱 伎
> mah <- mahalanobis(cost.d, mean(cost.d), var(cost.d))
> sort(mah)
 [1]  0.1118357  0.3881699  0.4038355  0.4943593  0.5103162  0.6876501  0.9259149  1.0222128  1.0360761  1.0909704  1.1795764
[12]  1.2436025  1.2828406  1.3408737  1.3693061  1.7448672  1.8811388  2.0838168  2.2881410  2.2910694  2.3969789  2.4234025
[23]  3.0191470  3.0324225  3.1860502  3.1916645  3.2669984  3.3742718  3.5981017  4.2023630  4.2800402  5.0913270  5.8390193
[34]  6.3492220 10.7295757 17.6428421
> 

10.7295757螻 17.6428421 蟇磯Μ螳 覩襦 伎豺 襭 螳レ煙 襷れ .