cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Evaluating slope of each cycle/season in a time series

I am trying to figure out the slope for each cycle in a time series and was wondering what could be done next to evaluate this.  The slope of the highlighted section in blue is to be found Capture.PNGCapture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Evaluating slope of each cycle/season in a time series

You will need to create a new data column that identifies each cycle. Then use Analyze > Fit Y by X. Cast Column 5 in the Y role, Time in the X role, and the grouping column in the By role. Click OK.

 

Press and hold the Ctrl key for Windows or the Command key for macOS, click the red triangle next to the first Bivariate object, and select Fit Line. (Actually, it looks like the cycles have a non-linear change, so you might try Fit Polynomial degree=2 instead.) Right-click on a table of Parameter Estimates and select Make Combined Data Table.

View solution in original post

8 REPLIES 8

Re: Evaluating slope of each cycle/season in a time series

You will need to create a new data column that identifies each cycle. Then use Analyze > Fit Y by X. Cast Column 5 in the Y role, Time in the X role, and the grouping column in the By role. Click OK.

 

Press and hold the Ctrl key for Windows or the Command key for macOS, click the red triangle next to the first Bivariate object, and select Fit Line. (Actually, it looks like the cycles have a non-linear change, so you might try Fit Polynomial degree=2 instead.) Right-click on a table of Parameter Estimates and select Make Combined Data Table.

Re: Evaluating slope of each cycle/season in a time series

Thanks @Mark_Bailey . 

 

But how can I make another data column that automatically identifies each cycle?

 

The existing columnCapture.PNG is attached  

txnelson
Super User

Re: Evaluating slope of each cycle/season in a time series

No importable file was attached.

Jim
peng_liu
Staff

Re: Evaluating slope of each cycle/season in a time series

Do you mean the observations go up and down once is a cycle? Then based on the plot, the big jump might be a good indicator. The jumps are pretty large. To calculate jumps, you can generate them from Time Series platform directly. Look for Difference, then follow the steps accordingly. In the end, "Save" column from the Difference report.

peng_liu_0-1655474267540.png

Otherwise, using JMP column formula to generate the jumps is also straightforward. Right click on your data column, choose "New Formula Column", choose "Row", choose "Difference".

Re: Evaluating slope of each cycle/season in a time series

@peng_liu Please see the revised diagram. I need the slopes of the lines starting from the peak point to the lowest point for each cycle .

peng_liu
Staff

Re: Evaluating slope of each cycle/season in a time series

Yep, I understood correctly then. My suggestion was identify the jumps as I pointed out in the following screenshot. We won't be able to identify them in the raw form. But if you calculate the difference, which is the current row minus the previous row, these differences should stand out as big positive numbers. They will be your indicators of the starts of individual cycles. Then I guess that you need to come up a way to mark every segment by a unique value, followed by what @Mark_Bailey suggested.

peng_liu_0-1655475559560.png

 

txnelson
Super User

Re: Evaluating slope of each cycle/season in a time series

Create a new column and name it "Cycle".  Then paste the below formula into the formula for the new column, and see if it gives you the cycle values you are looking for.

If( Row() == 1,
	myCycle = 1;
	cflag = 0;
	holdCycle = 0;
);
If( :"Column 5 (Detrended)"n > Lag( :"Column 5 (Detrended)"n, 1 ) & cflag == 0,
	cflag = 1;
	holdCycle = myCycle;
	myCycle = .;
);

If( :"Column 5 (Detrended)"n > :"Column 5 (Detrended)"n[Row() + 1] & cflag == 1,
	cflag = 0;
	myCycle = holdCycle + 1;
);
myCycle;

txnelson_0-1655475840623.png

 

Jim

Re: Evaluating slope of each cycle/season in a time series

@txnelson Thanks for your suggestion. 

Can you please modify the code such that the cycle will only increase if the preceding number is equal to or greater than 3 of the previous number?

 

Thanks