1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > matlab怎么画碎石图 成分分析中biplot函数不理解_主成分分析

matlab怎么画碎石图 成分分析中biplot函数不理解_主成分分析

时间:2019-06-16 17:05:34

相关推荐

matlab怎么画碎石图 成分分析中biplot函数不理解_主成分分析

成分分析中biplot函数不理解_主成分分析

对主成分分析中的biplot函数不理解,谁能帮忙解释?谢谢了

解答:

运行下面的例子,理解我加黑的那句话即可:

Examples

Perform a principal component analysis of the data in carsmall.mat:

load carsmall

x = [Acceleration Displacement Horsepower MPG Weight];

x = x(all(~isnan(x),2),:);

[coefs,score] = princomp(zscore(x));

View the data and the original variables in the space of the first three principal components:

vbls = {‘Accel’,’Disp’,’HP’,’MPG’,’Wgt’};

biplot(coefs(:,1:3),’scores’,score(:,1:3),…

‘varlabels’,vbls);

又基本上看了一个下午,我的时间啊!!不过基本上搞明白了

1.图只能表示二个或三个主成分的载荷,这是其缺点,所以往往只看重点主成分。

2.红点代表二个或三个观测值主成分值,如二维图,红点横坐标就是主成分1的值,纵坐标就是主成分2的值。但都是经过一定的量化。(Scale the scores so they fit on the plot, and change the sign of their coordinates according to the sign convention for the coefs.)。

3.蓝点和蓝线代表的是载荷值,坐标与红点意义相类似,所以线在横坐标的投影就是对主成分1的载荷(系数),在纵坐标的投影就是对主成分2的载荷。其值是或取相反数了。 (magnitude in each column of COEFS to be positive.This flips some of the vectors in COEFS to the opposite direction, but often makes the ploteasier to read)。

希望给那些像我一样不懂的人一点启示

r语言主成分分析biplot怎么看

#R中作为主成分分析最主要的函数是princomp()函数

#princomp()主成分分析 可以从相关阵或者从协方差阵做主成分分析

#summary()提取主成分信息

#loadings()显示主成分分析或因子分析中载荷的内容

#predict()预测主成分的值

#screeplot()画出主成分的碎石图

#biplot()画出数据关于主成分的散点图和原坐标在主成分下的方向

3、案例

#现有30名中学生身高、体重、胸围、坐高数据,对身体的四项指标数据做主成分分析。

#1.载入原始数据

test

X1=c(148, 139, 160, 149, 159, 142, 153, 150, 151, 139,

140, 161, 158, 140, 137, 152, 149, 145, 160, 156,

151, 147, 157, 147, 157, 151, 144, 141, 139, 148),

喜欢 (4)or分享 (0)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。