2021-01-31

clear all;
load carbig
X=[Acceleration Displacement Horsepower MPG Weight];
X=X(all(~isnan(X),2)😅;
%估计因素负荷矩阵
[Lambda,Psi,T,stats,F]=factoran(X,2,‘scores’,‘regression’);
Lambda %输出因素负荷矩阵
inv(T’T) %F的相关矩阵
Lambda
Lambda’+diag(Psi)%X的相关矩阵
Lambdainv(T) %未经旋转的因素负荷矩阵
F
T’; %未经旋转的因素贡献率
%绘制未经旋转的负荷点和旋转斜坐标
invT=inv(T);
Lambda0=Lambda*invT;
biplot(Lambda,‘LineWidth’,2,‘MarkerSize’,20);
line([-invT(1,1),invT(1,1),NaN,-invT(2,1),invT(2,1)],[-invT(1,2),invT(1,2),NaN,-invT(2,2),invT(2,2)]);
XiuYanJiang YuanCaiChen,XiangYuChen

Lambda =

-0.2432 -0.8500
0.8773 0.3871
0.7618 0.5930
-0.7978 -0.2786
0.9692 0.2129

ans =

1.0000   -0.0000

-0.0000 1.0000

ans =

1.0000   -0.5424   -0.6893    0.4309   -0.4167

-0.5424 1.0000 0.8979 -0.8078 0.9328
-0.6893 0.8979 1.0000 -0.7730 0.8647
0.4309 -0.8078 -0.7730 1.0000 -0.8326
-0.4167 0.9328 0.8647 -0.8326 1.0000

ans =

-0.5020 0.7277
0.9550 -0.0865
0.9113 -0.3185
-0.8450 0.0091
0.9865 0.1079
在这里插入图片描述
clear all;
load carbig
X=[Acceleration Displacement Horsepower MPG Weight];
X=X(all(~isnan(X),2)😅;
%估计因素负荷矩阵
[Lambda,Psi,T,stats,F]=factoran(X,2,‘scores’,‘regression’);
Lambda %输出因素负荷矩阵
inv(T’T) %F的相关矩阵
Lambda
Lambda’+diag(Psi)%X的相关矩阵
Lambdainv(T) %未经旋转的因素负荷矩阵
F
T’; %未经旋转的因素贡献率
%绘制未经旋转的负荷点和旋转斜坐标
invT=inv(T);
Lambda0=Lambda*invT;
biplot(Lambda,‘LineWidth’,2,‘MarkerSize’,20);
line([-invT(1,1),invT(1,1),NaN,-invT(2,1),invT(2,1)],[-invT(1,2),invT(1,2),NaN,-invT(2,2),invT(2,2)]);
xlabel(‘载入因素1’);
ylabel(‘载入因素2’);
在这里插入图片描述
张德丰编著—MATLAB概率与数据统计分析----第305页—【M】北京:机械工业出版社

属性 Properties

Copyright © 2004-2019 by

Aric Hagberg hagberg@lanl.gov

Dan Schult dschult@colgate.edu

Pieter Swart swart@lanl.gov

All rights reserved.

BSD license.

import matplotlib.pyplot as plt
from networkx import nx

G = nx.lollipop_graph(4, 6)

pathlengths = []

print(“source vertex {target:length, }”)
for v in G.nodes():
spl = dict(nx.single_source_shortest_path_length(G, v))
print(’{} {} '.format(v, spl))
for p in spl:
pathlengths.append(spl[p])

print(’’)
print(“average shortest path length %s” % (sum(pathlengths) / len(pathlengths)))

histogram of path lengths

dist = {}
for p in pathlengths:
if p in dist:
dist[p] += 1
else:
dist[p] = 1

print(’’)
print(“length #paths”)
verts = dist.keys()
for d in sorted(verts):
print(’%s %d’ % (d, dist[d]))

print(“radius: %d” % nx.radius(G))
print(“diameter: %d” % nx.diameter(G))
print(“eccentricity: %s” % nx.eccentricity(G))
print(“center: %s” % nx.center(G))
print(“periphery: %s” % nx.periphery(G))
print(“density: %s” % nx.density(G))

nx.draw(G, with_labels=True)
plt.show()
在这里插入图片描述

在这里插入图片描述

节点颜色Node Colormap

Author: Aric Hagberg ,modified by Chen Xiang Yu(hagberg@lanl.gov,cxy_0809@qq.com)

import matplotlib.pyplot as plt
import networkx as nx

G = nx.cycle_graph(28)

设置排列位置,iterations迭代次数

pos = nx.spring_layout(G, iterations=300)

node_color节点颜色

nx.draw(G, pos, node_color=range(28), node_size=900, cmap=plt.cm.Blues)
plt.show()
在这里插入图片描述
在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=plt.cm.Reds)
在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=“Accent”)

在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=“Accent_r”)
在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=“Blues_r”)
在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=“Reds_r”)
在这里插入图片描述
nx.draw(G, pos, node_color=range(28), node_size=900, cmap=“Set1”)

在这里插入图片描述

在这里插入图片描述
Servlet第一讲:https://v.youku.com/v_show/id_XNTA5MjY1NDMyMA==.html
Servlet第五讲:https://v.youku.com/v_show/id_XNTA5MjY3NDU3Ng==.html
Servlet第四讲:https://v.youku.com/v_show/id_XNTA5MjY3MzU0NA==.html
Servlet第六讲:https://v.youku.com/v_show/id_XNTA5MjY3NTQwOA==.html
Servlet第九讲://v.youku.com/v_show/id_XNTA5MjY3NzkxMg==.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值