这个作业是用R语言对多个城市进行建模并计算距离

Math381 Assignment 7 Multidimensional Scaling

首先,我们选择一组6个彼此相距500公里以内的城市,并为
他们。 然后,我们通过使用R来应用MDS(多维缩放)来创建1维,2维和3维模型
到距离矩阵
其次,我们选择另一套相距甚远的6个城市,并重复与第一部分相同的操作。
让我们从6个城市的较近位置开始,这是它们之间的距离(公里)的图表:
西雅图贝尔维尤柯克兰伦顿图克维拉雷德蒙德酒店
西雅图0 10.51 12.45 17.09 15.08 17.39
贝尔维尤10.51 0 6.94 15.56 16.10 8.45
柯克兰12.45 6.94 0 22.39 22.53 5.94
伦顿17.09 15.56 22.39 0 3.95 23.16
塔克维拉15.08 16.10 22.53 3.95 0 24.29
雷德蒙德17.39 8.45 5.94 23.16 24.29 0
(您应该包括R代码输入和输出,以及带有图形的1、2和3维模型。然后,
进行比较,按照讲座的建议做事,以调查结果
很好的模型。 )
Next, we have another set of 6 cities that are far apart in distance, and here is a chart of the distances (km)
between them:
1
Beijing New York City London Sydney Tokyo Brazil
Beijing 0 10985 8138 8951 2099 16929
New York City 10985 0 5570 15989 10846 6834
London 8138 5570 0 16994 9561 8792
Sydney 8951 15989 16994 0 7825 14133
Tokyo 2099 10846 9561 7825 0 17673
Brazil 16929 6834 8792 14133 17673 0
(You should include R code input and output, and the 1, 2, and 3 dimensional models with graphs. Then,
make a comparison between them Do things with the result as suggested by the lectures to investigate how
good the models are. )