matlab指数积分函数,求助 如何用matlab的morans_I函数计算局部morans I指数?

已知有13个地区,它们的人均GDP为A=[26998;30840;34892;41099;45444;50467;58204;64491;66940;73856;81658;87475;19141;]

临界矩阵为

W=[0,1,0,0,1,0,1,0,1;1,0,0,1,1,0,0,1,0;0,0,0,0,0,0,1,0,0;0,1,0,0,0,1,0,0,0;1,1,0,0,0,0,1,1,0;0,0,0,1,0,0,0,0,0;1,0,1,0,1,0,0,1,1;0,1,0,0,1,0,1,0,0;1,0,0,0,0,0,1,0,0;1,0,0,1,0,1,0,0,0;0,0,0,0,0,0,0,0,0;0,0,1,0,0,0,0,0,0;0,0,1,0,0,0,1,1,0;]

然后我找到了Moran_I指数的函数

HELP morans_I

PURPOSE: calculate global Moran's I for an input grid (matrix) by calculating all

local Moran's I for a given moving windows size using a weight matrix.

-------------------------------------------------------------------

USAGE: M = moransI(grid, W, s);

where: [grid] is the matrix to analyse

[W] is the normalized weight matrix of the size the local Moran's

I will be calculated for (uneven sized!)

[s] is an optional flag to use zscores of input values for

calculation. Set to 'true' if zscores of local grid should be

calculated. Leave blank if not desired or input values are already

standardized.

-------------------------------------------------------------------------

OUTPUTS:

[M] matrix of all local Moran's I

-------------------------------------------------------------------

NOTES: Weight matrix needs to be 'moving window' style, not contiguity

matrix: Moran's I is calculated and weighted for neighbours to center cell.

Matrix needs to be normalized (weights sum to 1) and center cell weight

will be set to 0 if not already. Uses localmoran.m

-> Use nanmean(M(:)) to get the average global Moran's I.

See Anselin (1995, 'LISA.', Geogr. Analysis 27(2),p.93f) for details on

standardized variables in calculation of local Moran's I.

EXAMPLE:  M = moransI(rand(20,20),ones(5,5),'true')

Felix Hebeler, Geography Dept.,de University Zurich, March 2006.

请问使用M=Morans_I(A,W,'ture')计算吗?为什么算出来都是NaN?

求大神帮助

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Matlab中的莫兰指数(Moran's I)计算可以使用spatgsa工具箱中的sg162函数。这个函数可以帮助你计算全局莫兰指数的z值和p值。通过计算全局莫兰指数,你可以评估数据集中的空间自相关性。 可以参考Maurizio Pisati关于sg162函数的参考资料。此外,如果你需要完整的Matlab莫兰指数的源码,你可以查找并下载资源名为morans_i_莫兰指数_matlab的项目。这个项目提供了全套经过测试校正后百分百成功运行的源码,并适合新手及有一定经验的开发人员使用。 所以,如果你想在Matlab计算莫兰指数,可以使用spatgsa工具箱中的sg162函数,或者根据morans_i_莫兰指数_matlab项目中提供的源码进行计算。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [【MATLAB】全局莫兰指数(含p值和z值)](https://blog.csdn.net/weixin_43249102/article/details/125490301)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [morans_i_莫兰指数_matlab](https://download.csdn.net/download/m0_53407570/85020657)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值