确定时间序列R中的最大峰值

时间:2015-08-11 15:50:41

标签: r

我想计算此时间序列中出现峰值的月份,并确定这些变化是否超过分析记录。我能从这个阶段获得这些信息吗?我怎么能在R?

中做到这一点

这是时间序列

 [1] -2.566983e-02 -5.782524e-02 -7.808027e-02 -7.600751e-02 -5.500182e-02 -1.794568e-02  2.287965e-02  6.176569e-02  8.517858e-02  8.618686e-02  6.599044e-02  2.595632e-02
 [13] -2.468891e-02 -7.291849e-02 -1.013152e-01 -1.052718e-01 -7.944368e-02 -2.482406e-02  3.896659e-02  9.315530e-02  1.286337e-01  1.274909e-01  9.111597e-02  2.842469e-02
 [25] -4.845922e-02 -1.157328e-01 -1.537427e-01 -1.534016e-01 -1.060450e-01 -2.458452e-02  6.501879e-02  1.385970e-01  1.746728e-01  1.629937e-01  1.037831e-01  1.111534e-02
 [37] -8.784113e-02 -1.601244e-01 -1.872461e-01 -1.614843e-01 -9.001538e-02  8.044579e-03  1.037991e-01  1.691924e-01  1.878601e-01  1.587651e-01  8.405491e-02 -1.356792e-02
 [49] -1.069555e-01 -1.710607e-01 -1.853867e-01 -1.499666e-01 -7.398990e-02  1.654048e-02  1.006945e-01  1.533522e-01  1.701250e-01  1.431100e-01  8.169068e-02  2.343733e-05
 [61] -8.011875e-02 -1.382533e-01 -1.624560e-01 -1.458858e-01 -9.018088e-02 -1.271360e-02  6.579380e-02  1.277067e-01  1.637702e-01  1.500510e-01  1.026965e-01  2.813767e-02
 [73] -5.578174e-02 -1.241554e-01 -1.614667e-01 -1.555724e-01 -1.118590e-01 -4.256574e-02  3.614970e-02  1.097938e-01  1.532000e-01  1.612439e-01  1.229504e-01  4.904072e-02
 [85] -3.726522e-02 -1.116908e-01 -1.535943e-01 -1.555642e-01 -1.110113e-01 -3.607084e-02  4.671452e-02  1.141403e-01  1.515199e-01  1.411410e-01  9.221573e-02  1.711825e-02
 [97] -6.117735e-02 -1.198699e-01 -1.431554e-01 -1.232685e-01 -6.267357e-02  1.360005e-02  8.311781e-02  1.294568e-01  1.384708e-01  1.110949e-01  4.826190e-02 -3.187023e-02
[109] -1.029242e-01 -1.465521e-01 -1.493273e-01 -1.069210e-01 -3.451630e-02  4.808568e-02  1.152376e-01  1.475487e-01  1.423903e-01  9.678471e-02  2.042843e-02 -6.301876e-02
[121] -1.307709e-01 -1.621329e-01 -1.482143e-01 -9.408793e-02 -1.091879e-02  7.770917e-02  1.466600e-01  1.752333e-01  1.613551e-01  1.014390e-01  1.233963e-02 -8.395569e-02
[133] -1.568942e-01 -1.900819e-01 -1.721025e-01 -1.060657e-01 -9.791183e-03  8.962102e-02  1.643729e-01  1.959725e-01  1.698956e-01  9.874419e-02  4.063712e-03 -9.332515e-02
[145] -1.653777e-01 -1.908999e-01 -1.714995e-01 -1.056551e-01 -9.412571e-03  9.176901e-02  1.704038e-01  2.107884e-01  1.959427e-01  1.302384e-01  2.709246e-02 -8.280759e-02
[157] -1.722022e-01 -2.242869e-01 -2.189376e-01 -1.606955e-01 -5.842590e-02  5.697796e-02  1.590890e-01  2.238129e-01  2.332621e-01  1.821653e-01  8.796006e-02 -2.804040e-02
[169] -1.370321e-01 -2.171222e-01 -2.378465e-01 -2.004218e-01 -1.160496e-01 -4.281969e-03  1.050972e-01  1.908922e-01  2.247106e-01  2.014388e-01  1.247218e-01  2.324572e-02
[181] -7.522908e-02 -1.497589e-01 -1.809624e-01 -1.666022e-01 -1.176099e-01 -4.498645e-02  3.233885e-02  9.812366e-02  1.361637e-01  1.352237e-01  1.010775e-01  4.642129e-02
[193] -1.229179e-02 -6.198903e-02 -8.762626e-02 -8.745873e-02 -7.072290e-02 -4.123783e-02 -8.680191e-03  1.983371e-02  4.176359e-02  4.857435e-02  4.229918e-02  2.785419e-02
[205]  1.123948e-02 -7.127771e-03 -2.058425e-02 -2.566657e-02 -2.470011e-02 -1.869947e-02 -1.005953e-02  4.231329e-03  2.079108e-02  3.393548e-02  3.458949e-02  2.465338e-02
[217]  8.125533e-03 -9.914837e-03 -2.958697e-02 -3.901624e-02 -4.084610e-02 -2.888188e-02 -1.052842e-02  1.739696e-02  3.451113e-02  4.782416e-02  5.209275e-02  4.578052e-02
[229]  2.652363e-02  1.504811e-04 -2.352872e-02 -4.675681e-02 -5.486831e-02 -5.110543e-02 -3.164919e-02 -2.465634e-03  3.044004e-02  5.946521e-02  7.533064e-02  6.878881e-02
[241]  3.968605e-02 -8.599631e-04 -3.705050e-02 -6.874023e-02 -7.858607e-02 -6.366839e-02 -2.886664e-02  1.470032e-02  5.256284e-02  7.871812e-02  7.941835e-02  5.261808e-02
[253]  3.232945e-03 -4.866670e-02 -8.060033e-02 -8.655462e-02 -6.345511e-02 -1.341964e-02  4.022795e-02  7.877580e-02  9.041708e-02  7.017194e-02  2.731874e-02 -2.426977e-02
[265] -6.618300e-02 -8.652564e-02 -7.566890e-02 -4.360560e-02  2.427347e-04  4.560736e-02  7.147917e-02  7.334999e-02  5.439404e-02  1.828790e-02 -2.180237e-02 -5.176644e-02
[277] -6.194357e-02 -5.263502e-02 -2.702600e-02  5.459462e-03  2.764591e-02  3.515949e-02  2.904689e-02  9.856334e-03 -1.099115e-02 -2.476568e-02 -2.473909e-02 -1.470535e-02
[289]  9.901777e-04  1.269958e-02  1.628164e-02  1.215371e-02 -7.787407e-05 -1.170293e-02 -2.252639e-02 -2.297631e-02 -1.216422e-02  7.715951e-03  2.662490e-02  3.497172e-02
[301]  2.913067e-02  1.052321e-02 -1.770285e-02 -4.316586e-02 -5.294941e-02 -4.598436e-02 -2.154287e-02  1.347715e-02  4.857204e-02  6.759757e-02  6.256019e-02  3.480956e-02
[313] -8.177469e-03 -4.727875e-02 -7.296587e-02 -7.333275e-02 -4.710260e-02 -2.676638e-03  4.868405e-02  8.367411e-02  9.452564e-02  7.463526e-02  2.867804e-02 -2.773269e-02
[325] -7.303544e-02 -9.532996e-02 -8.841880e-02 -5.778710e-02 -9.568579e-03  4.231762e-02  7.537721e-02  8.680084e-02  7.547977e-02  4.510019e-02  3.801842e-03 -3.529420e-02
[337] -6.033518e-02 -6.668869e-02 -5.458891e-02 -2.999038e-02 -2.593124e-04  2.806880e-02  4.193105e-02  4.383955e-02  3.707603e-02  2.022521e-02  6.101334e-03 -5.717493e-03
[349] -1.234244e-02 -1.620367e-02 -1.806666e-02 -1.922020e-02 -2.110791e-02 -2.127266e-02 -2.096110e-02 -1.714399e-02 -2.783072e-03  1.654030e-02  3.282535e-02  4.414188e-02
[361]  4.770084e-02  3.847246e-02  1.832072e-02 -1.056649e-02 -3.722579e-02 -5.740149e-02 -6.341912e-02 -5.426390e-02 -2.980793e-02  7.470599e-04  3.212034e-02  5.011929e-02
[373]  5.734303e-02  4.622466e-02  2.630451e-02  1.905363e-03 -2.046357e-02 -3.383679e-02 -3.753406e-02 -2.872917e-02 -1.366504e-02  1.757055e-03  1.296441e-02  1.619348e-02
[385]  1.238192e-02  5.528508e-03 -5.078213e-03 -1.051610e-02 -1.070992e-02 -3.608823e-03  4.587764e-03  1.269367e-02  1.821489e-02  1.886193e-02  9.326559e-03 -6.350481e-03
[397] -2.268550e-02 -3.562078e-02 -3.750427e-02 -2.826171e-02 -9.722588e-03  1.425940e-02  3.382628e-02  4.683378e-02  4.966529e-02  3.399604e-02  7.296378e-03 -2.218337e-02

enter image description here

1 个答案:

答案 0 :(得分:1)

尝试?which.max

> which.max( iris[,1] )
[1] 132

这将为您提供给定系列中最大值的索引。但是,您需要提供更多信息。这些数据是如何存储的,是月度数据吗? Please refer to this in the future.