爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 10371|回复: 6

[作图] NCL回归-回归系数为正值的大值区域基本不通过95%显著性检验

[复制链接]
发表于 2019-9-16 18:26:17 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
首先谢谢大家的帮助,新人第一次发帖如有不当请大家指出。
我在做SFW系数和32年间的5月份月平均降水的回归,使用的是regcoef函数,先使用的原始数据,得出回归系数绝对值基本小于0.1。
在论坛查看了前辈的一些帖子,将SFW系数用dim_standardize做了标准化,可以得到一个看起来还比较合适的图,并出现回归系数绝对值大于1的情况,搜索之后大部分说回归系数绝对值范围可以超出1,也有一些说存在问题的,如果这里出错麻烦大家指出。
再用student-t函数进行检验(也换betainc函数试过,结果一致),从图上看负值区域通过检验基本是正常的,但是正值的大值区域几乎没有通过95%的显著性检验。
我又尝试了一下90%显著性,正值大值区还是只有小部分通过检验,并且存在挺多回归系数绝对值小于0.1的区域通过检验,我觉得应该是存在错误,搜索之后没有找到相关解决方法,希望能得到大家的帮助,谢谢。以下附图及程序。
5_.png 5.png

begin
data1 = asciiread("C:/data/1/SFW-30hPa-1950-2015-abs.txt", -1, "string")
data = data1(1:)
SFW = tofloat(str_get_cols(data, 8, 13))
year = tofloat(str_get_cols(data, 0, 3))
SFW := SFW(29:60)
SFW := dim_standardize(SFW, 0)
;printVarSummary(SFW)
;print(SFW)

data2 = addfile("C:/data/1/CPCP 197901throughApr2019/precip.mon.mean.nc", "r")
time1 = data2->time
lat = data2->lat
lon = data2->lon
YYYYMM = cd_calendar(time1, -1)
it_s = 197901
it_e = 201012
rec_s = ind(it_s.eq.YYYYMM)
rec_e = ind(it_e.eq.YYYYMM)
precip_ = data2 ->precip(time|rec_s:rec_e,lat|:,lon|:)
;printVarSummary(precip)
precip_n = reshape(precip_ , (/12,32,72,144/))
;print(precip(:,0,:,:))
x = fspan(1979, 2010, 32)
month = fspan(1, 12, 12)
precip_n!1 = "time"
precip_n&time = x
precip_n!0 = "month"
precip_n&month = month
precip_n!2 = "lat"
precip_n&lat = lat
precip_n!3 = "lon"
precip_n&lon = lon
;printVarSummary(precip_n)
precip = precip_n(4,:,:,:)
;printVarSummary(precip)
tval = new((/ 72,144 /),float)
tval!1= "lon"
tval&lon = lon
tval!0= "lat"
tval&lat = lat
nxy = new((/72,144/),integer)
nxy!1= "lon"
nxy&lon = lon
nxy!0= "lat"
nxy&lat = lat

huigui = regcoef(SFW, precip(lat|:,lon|:,time|:),tval,nxy)
huigui!0 = "lat"
huigui&lat = lat
huigui!1 = "lon"
huigui&lon = lon
;printVarSummary(huigui)
df = nxy - 2
prob = student_t(tval, df)
prob!1= "lon"
prob&lon = lon
prob!0= "lat"
prob&lat = lat


wks = gsn_open_wks("png","C:/data/5")
gsn_define_colormap(wks,"BlueWhiteOrangeRed")
res = True  
  res@gsnDraw   = False
  res@gsnFrame  = False
  res@gsnAddCyclic         = False               ;添加循环点
  res@mpMaxLonF                 =180
  res@mpMinLonF                 =-180
  res@mpMaxLatF                 =90
  res@mpMinLatF                 =-90  

  res@mpGridAndLimbOn             = False         ;绘制经纬度线
  res@mpGridLatSpacingF           = 10           ;纬线间隔
  res@mpGridLonSpacingF           = 10           ;经线间隔
  res@mpGridLineDashPattern       = 2            ;经纬线类型
  res@mpGridLineThicknessF        = 0.5          ;经纬线粗细

  res@pmTickMarkDisplayMode   = "Always"     ;坐标上标签上添加度符号

  ;地图边界线
  res@mpGeophysicalLineColor      = "black"
  res@mpGeophysicalLineDashPattern= 0
  res@mpGeophysicalLineDashSegLenF= 0.2  
  res@mpGeophysicalLineThicknessF = 0.5          ;地图边界的粗细
  res@mpOutlineOn                 = True
  res@mpCenterLonF                = 180


  res@cnLinesOn             = False
   res@cnLineDashPattern    = 16
   res@cnLineThicknessF     = 2
  res@gsnContourNegLineDashPattern = 2
  res@gsnContourPosLineDashPattern = 0
  
  res@cnLineLabelsOn     =False
  res@cnLineLabelAngleF  = 0.0
  res@cnInfoLabelOn       = True
res@cnInfoLabelOrthogonalPosF = 0.05
res@cnInfoLabelOn       =   False
  res@gsnAddCyclic = True
  res@cnFillOn = True

res@cnLevelSelectionMode = "ExplicitLevels"
  res@cnLevels = (/-0.9,-0.7,-0.5,-0.3,-0.1,0.1,0.3,0.5,0.7,0.9/)
res@cnFillColors = (/3,19,35,50,65,80,0,160,185,200,215,231,247/);12/5




;a=0.05
  sres = True
  sres@gsnDraw = False
  sres@gsnFrame = False

  sres@cnLineLabelsOn = False
  sres@cnFillOn = True
  sres@cnLinesOn       = False                                                         ; do not draw contour lines               
  sres@cnInfoLabelOn   = False
  sres@cnLevelSelectionMode = "ExplicitLevels"  
  sres@cnLevels             = (/0.0,0.05/)
  sres@cnFillDotSizeF       = (/"0.004","0.005","0.005"/)
  sres@lbLabelBarOn    = False
  sres@gsnCenterString   = ""
  sres@gsnLeftString  =""
  sres@gsnRightString = ""
  opt1 = True
  opt1@gsnShadeFillType="pattern"
  opt1@gsnShadeHigh     = -1                                                                                                      
  opt1@gsnShadeLow      = -1
  opt1@gsnShadeMid      = 17

plot = gsn_csm_contour_map(wks,huigui,res)
plot_=gsn_csm_contour(wks, prob, sres)
plot_ = gsn_contour_shade(plot_, 0, 0.05, opt1)
overlay(plot,plot_)
draw(plot)
frame(wks)
end



密码修改失败请联系微信:mofangbao
发表于 2019-9-17 08:45:36 | 显示全部楼层
你的降水场是距平场吗?一般回归系数多大都是可以的,取决于你用的哪个变量场,相关系数场是-1到1.
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2019-9-18 09:01:55 | 显示全部楼层
好久不见 发表于 2019-9-17 08:45
你的降水场是距平场吗?一般回归系数多大都是可以的,取决于你用的哪个变量场,相关系数场是-1到1.

不是诶,我用的就是原始场,我去试一下距平场
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2019-9-18 10:58:55 | 显示全部楼层
本帖最后由 感觉自己萌萌哒 于 2019-9-18 20:45 编辑
好久不见 发表于 2019-9-17 08:45
你的降水场是距平场吗?一般回归系数多大都是可以的,取决于你用的哪个变量场,相关系数场是-1到1.

不对,我之前距平的有问题,以为有变化,改成正确的距平之后发现,用距平场和原始场出来的图是一样的
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2019-11-19 08:11:31 来自手机 | 显示全部楼层
现在做出来了吗
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2019-12-16 10:42:40 | 显示全部楼层
student_t检验回归系数好像就是容易这样,用r检验试试呢
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2020-9-14 10:40:18 | 显示全部楼层
您好,请问您的问题解决了嘛,我最近也出现了类似的问题
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表