<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: plotting Time sequence forcast plot  with graph builder(script) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/plotting-Time-sequence-forcast-plot-with-graph-builder-script/m-p/48776#M27729</link>
    <description>&lt;P&gt;Time series predictions do not seem as straight forward as other platforms.&amp;nbsp; To solve this I:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Saved the time series script from the platform but then split it into separate Time Series() and Seasonal Arima() functions.&lt;/LI&gt;&lt;LI&gt;Saved predictions into a new table&lt;/LI&gt;&lt;LI&gt;Copied the script back to the original table&lt;/LI&gt;&lt;LI&gt;Made graph&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Time Series Prediction Formula.png" style="width: 694px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8723iA84463E594A9B884/image-size/large?v=v2&amp;amp;px=999" role="button" title="Time Series Prediction Formula.png" alt="Time Series Prediction Formula.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here( 1 );

//Open sample data
dt = Open( "$Sample_data/time series/co2.jmp" );

//Add rows to the original table
dt &amp;lt;&amp;lt; Add rows( 12 );

//Calculate date for future rows
dt &amp;lt;&amp;lt; New Column( "Year&amp;amp;Month Future",
	Numeric,
	"Continuous",
	Formula( 
		If( Is Missing( :Name( "Year&amp;amp;Month" ) ),
			Lag( :Name( "Year&amp;amp;Month Future" ), 1 ) + 1 / 24,
			:Name( "Year&amp;amp;Month" )
		)
	)
);

//Open time series
ts = dt &amp;lt;&amp;lt; Time Series( Y( :CO2 ) );

//Add Arima
ar = ts &amp;lt;&amp;lt; Seasonal Arima( 1, 1, 0, 0, 1, 1, 12 );

//Make a new table with predications
dtArima = ar &amp;lt;&amp;lt; Save Prediction Formula;

//Graph with predictions in a separate data table
dtArima &amp;lt;&amp;lt; Graph Builder(
	Size( 493, 303 ),
	Show Control Panel( 0 ),
	Variables( 
		X( :Row ), 
		Y( :Actual CO2 ), 
		Y( :Predicted CO2, Position( 1 ) ) ),
	Elements( 
		Points( X, Y( 1 ), 
		Legend( 19 ) ), 
		Line( X, Y( 2 ), 
		Legend( 20 ) ) )
);

//Or add predictions to original table:

//Copy the prediction formula and replace the column name, then save it to the original
//data table
Eval( Parse( 
	"dt &amp;lt;&amp;lt; " || 
	Substitute( 
		Char((Column(dtArima, "CO2 Prediction Formula" ) &amp;lt;&amp;lt; Get Script ) ), 
		":Actual ", 
		":" 
	) 
) );

/*
//Close temporary windows
ts &amp;lt;&amp;lt; Close Window
dtArima &amp;lt;&amp;lt; Close Window;
*/

//Graph with predictions in the original table
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 493, 303 ),
	Show Control Panel( 0 ),
	Variables( 
		X( :Name("Year&amp;amp;Month Future") ), 
		Y( :CO2 ), 
		Y( :CO2 Prediction Formula, Position( 1 ) ) ),
	Elements( 
		Points( X, Y( 1 ), 
		Legend( 19 ) ), 
		Line( X, Y( 2 ), 
		Legend( 20 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 17 Dec 2017 16:34:33 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2017-12-17T16:34:33Z</dc:date>
    <item>
      <title>plotting Time sequence forcast plot  with graph builder(script)</title>
      <link>https://community.jmp.com/t5/Discussions/plotting-Time-sequence-forcast-plot-with-graph-builder-script/m-p/48771#M27727</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering that I can keep the plot the time series predicted plot in graph builder or not. So that my supervisor can esaily read the trend in future then take plan immediately. The plot I already made have grouped x, so it should show several predicted line in one single plot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fowllowing script is the&amp;nbsp; time series predicted plot :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Time Series(
	X( :date ),
	Y( :CD ),
	ARIMA( 0, 1, 0 ),
	SendToReport(
	
		Dispatch(
			{"Model: I(1)  ", "Forecast"},
			"Time Series Predicted Graph",
			FrameBox,
			{Frame Size( 659, 144 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 09:21:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/plotting-Time-sequence-forcast-plot-with-graph-builder-script/m-p/48771#M27727</guid>
      <dc:creator>Leo_Huang</dc:creator>
      <dc:date>2017-12-17T09:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: plotting Time sequence forcast plot  with graph builder(script)</title>
      <link>https://community.jmp.com/t5/Discussions/plotting-Time-sequence-forcast-plot-with-graph-builder-script/m-p/48776#M27729</link>
      <description>&lt;P&gt;Time series predictions do not seem as straight forward as other platforms.&amp;nbsp; To solve this I:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Saved the time series script from the platform but then split it into separate Time Series() and Seasonal Arima() functions.&lt;/LI&gt;&lt;LI&gt;Saved predictions into a new table&lt;/LI&gt;&lt;LI&gt;Copied the script back to the original table&lt;/LI&gt;&lt;LI&gt;Made graph&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Time Series Prediction Formula.png" style="width: 694px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8723iA84463E594A9B884/image-size/large?v=v2&amp;amp;px=999" role="button" title="Time Series Prediction Formula.png" alt="Time Series Prediction Formula.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here( 1 );

//Open sample data
dt = Open( "$Sample_data/time series/co2.jmp" );

//Add rows to the original table
dt &amp;lt;&amp;lt; Add rows( 12 );

//Calculate date for future rows
dt &amp;lt;&amp;lt; New Column( "Year&amp;amp;Month Future",
	Numeric,
	"Continuous",
	Formula( 
		If( Is Missing( :Name( "Year&amp;amp;Month" ) ),
			Lag( :Name( "Year&amp;amp;Month Future" ), 1 ) + 1 / 24,
			:Name( "Year&amp;amp;Month" )
		)
	)
);

//Open time series
ts = dt &amp;lt;&amp;lt; Time Series( Y( :CO2 ) );

//Add Arima
ar = ts &amp;lt;&amp;lt; Seasonal Arima( 1, 1, 0, 0, 1, 1, 12 );

//Make a new table with predications
dtArima = ar &amp;lt;&amp;lt; Save Prediction Formula;

//Graph with predictions in a separate data table
dtArima &amp;lt;&amp;lt; Graph Builder(
	Size( 493, 303 ),
	Show Control Panel( 0 ),
	Variables( 
		X( :Row ), 
		Y( :Actual CO2 ), 
		Y( :Predicted CO2, Position( 1 ) ) ),
	Elements( 
		Points( X, Y( 1 ), 
		Legend( 19 ) ), 
		Line( X, Y( 2 ), 
		Legend( 20 ) ) )
);

//Or add predictions to original table:

//Copy the prediction formula and replace the column name, then save it to the original
//data table
Eval( Parse( 
	"dt &amp;lt;&amp;lt; " || 
	Substitute( 
		Char((Column(dtArima, "CO2 Prediction Formula" ) &amp;lt;&amp;lt; Get Script ) ), 
		":Actual ", 
		":" 
	) 
) );

/*
//Close temporary windows
ts &amp;lt;&amp;lt; Close Window
dtArima &amp;lt;&amp;lt; Close Window;
*/

//Graph with predictions in the original table
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 493, 303 ),
	Show Control Panel( 0 ),
	Variables( 
		X( :Name("Year&amp;amp;Month Future") ), 
		Y( :CO2 ), 
		Y( :CO2 Prediction Formula, Position( 1 ) ) ),
	Elements( 
		Points( X, Y( 1 ), 
		Legend( 19 ) ), 
		Line( X, Y( 2 ), 
		Legend( 20 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Dec 2017 16:34:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/plotting-Time-sequence-forcast-plot-with-graph-builder-script/m-p/48776#M27729</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2017-12-17T16:34:33Z</dc:date>
    </item>
  </channel>
</rss>

