plot more than 50 components in RSSA package in R

白昼怎懂夜的黑 提交于 2019-12-11 18:24:27

问题


require(Rssa)
t=ssa(co2,200) #200 here should be the number of components
plot(t)       # this way it plots only the first 50 not 200!

Above code produces a graph the first 50 components only. I need to plot more than 50 components

I tried

plot(t$sigma[1:200],type='l',log='y')

but it didn't work!

Example : similar to this case accessing eigenvalues in RSSA package in R


回答1:


Looking at the help page for ?ssa we see a parameter named neig which is documented as;

integer, number of desired eigentriples. If 'NULL', then sane default value will be used, see 'Details'

Using that as a named parameter:

 t=ssa(co2, neig=200) 
 plot(t)

And:

> t$sigma
  [1] 78886.190749   329.031810   327.198387   184.659743    88.695271    88.191805    52.380502
  [8]    40.527875    31.329930    29.409384    27.157698    22.334446    17.237926    14.175096
 [15]    14.111402    12.976716    12.943775    12.216524    11.830642    11.614243    11.226010
 [22]    10.457529    10.435998  snipped the remaining 200 numbers.

(Apparently, the package authors do not consider 200 to be "sane" number to use, although looking at the values of the results from neig=50 and neig-200 I do not see a discernable cutpoint at the 50th eigenvalue. But ... they must set it in the code which I've shown you how to access.)



来源:https://stackoverflow.com/questions/51078004/plot-more-than-50-components-in-rssa-package-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!