I am working on NDVI Time-Series
Data which has 23 observations in a year. I am able to detect the peaks occurring between the 14 - 19 observation. Now I want to find the start and end of the Peak. I am able to find the start and end of peak by looking for sign change using `diff(). But in some cases I am note able to find the end, as end of the peak is in next year. Solution is to repeat the values after 23 observation to make it cyclic and find the end.
Example given below will explain the problem in detail
x = c(250.7943,292.2904,340.459,368.811,363.4534,330.2302,291.6527,275.2815,299.9305,367.0331,461.2618,559.0772,639.6197,691.723,713.9833,709.5409,680.4415,626.1153,547.0395,450.4623,353.0839,277.257,241.597)
I am looking for sign change from the Peak in both direction and able to find the start of the peak at 8 observation but when I am looking for the end starting from Peak I am not able to find any change till 23. In this case I should get the end the peak at 23. As shown in table I have repeated the values manually in Excel to get the Sign change.
How this can be done in R???
One solution may be that putting a condition to check if sign change is not found till 23 observation then all 23 values will be padded at end of the vector and then look for the sign change.
Is there a simple approach to accomplish this???