Time Series
Example 1
Summary: Visualizes the proportion of Total Plastic defects over time using a P chart in Control Chart Builder, with subgrouping by Week and phase variable by Location.
Code:
// Time Series X11
// Open data table
dt = Open("data_table.jmp");
// Time Series X11
Time Series(
X( :Date ),
Y( :Sales ),
X11( Additive )
);
Code Explanation:
- Open table.
- Analyze time series data.
- Specify date column.
- Specify sales column.
- Apply X11 decomposition.
- Use additive model.
Example 2
Summary: Generates a Time Series Detrended plot to analyze the trend and seasonality of sales data over time, removing both linear and cyclical components.
Code:
// Time Series Detrended
// Open data table
dt = Open("data_table.jmp");
// Time Series Detrended
Time Series(
X( :Date ),
Y( :Sales ),
Remove Linear Trend(
Remove Cycle(
Units per Cycle( 12 ),
Has Constant( 0 )
)
)
);
Code Explanation:
- Open data table.
- Define time series analysis.
- Set X variable as Date.
- Set Y variable as Sales.
- Remove linear trend.
- Remove cycle component.
- Set units per cycle to 12.
- Assume no constant term.
Example 3
Summary: Generates a time series analysis of log passengers data, utilizing a Seasonal ARIMA model with variogram and non-seasonal parameters to forecast future trends.
Code:
// Time Series
// Open data table
dt = Open("data_table.jmp");
// Time Series
Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Seasonal ARIMA(
0,
1,
1,
0,
1,
1,
12,
No Intercept( 1 )
)
);
Code Explanation:
- Open data table.
- Analyze time series data.
- Set response variable.
- Use variogram model.
- Apply Seasonal ARIMA.
- Define non-seasonal parameters.
- Define seasonal parameters.
- Specify season length.
- Exclude intercept term.
- Execute analysis.
Example 4
Summary: Generates a time series analysis of CO2 output based on input gas rate, with transfer function modeling and interactive forecasting capabilities.
Code:
// Time Series
// Open data table
dt = Open("data_table.jmp");
// Time Series
Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function(
Order( 2, 0, 0 ),
Seasonal( 0, 0, 0, 0 ),
:
Input Gas Rate(
Order( 2, 0, 2 ),
Seasonal( 0, 0, 0, 0 ),
Lag( 3 )
)
),
Input Series( :Input Gas Rate ),
SendToReport(
Dispatch(
{"Time Series Output CO2"},
"1", ScaleBox,
{Scale( "Linear" ),
Format( "Fixed Dec", 0 ),
Min( 0 ), Max( 300 ),
Inc( 50 ),
Show Major Grid( 1 )}
),
Dispatch(
{"Time Series Output CO2",
"Transfer Function Model (1)",
"Residuals"}, "1", ScaleBox,
{Scale( "Linear" ),
Format( "Fixed Dec", 0 ),
Min( 0 ), Max( 300 ),
Inc( 50 ),
Show Major Grid( 1 )}
),
Dispatch(
{"Time Series Output CO2",
"Transfer Function Model (1)",
"Interactive Forecasting"},
"1", ScaleBox,
{Scale( "Linear" ),
Format( "Fixed Dec", 0 ),
Min( 0 ), Max( 300 ),
Inc( 50 ),
Show Major Grid( 1 )}
),
Dispatch(
{"Input Time Series Panel",
"Input Series: Input Gas Rate"
}, "1", ScaleBox,
{Scale( "Linear" ),
Format( "Fixed Dec", 0 ),
Min( 0 ), Max( 300 ),
Inc( 50 ),
Show Major Grid( 1 )}
)
)
);
Code Explanation:
- Open table.
- Define time series analysis.
- Set output variable.
- Define input list.
- Configure transfer function.
- Set input series.
- Customize report settings.
- Set scale for main output.
- Set scale for residuals.
- Set scale for forecasting.
Example 5
Summary: Visualizes the spectral density of a time series using the Time Series platform in JMP, providing insights into the underlying patterns and trends.
Code:
// Spectral Density
// Open data table
dt = Open("data_table.jmp");
// Spectral Density
Time Series(
Y( :wolfer ),
Spectral Density( 1 )
);
Code Explanation:
- Open data table.
- Time Series analysis.
- Specify spectral density.
Example 6
Summary: Visualizes the proportion of Total Plastic defects over time using a P chart, with subgrouping by Week and phase variable by Location, in the Control Chart Builder platform.
Code:
Open("data_table.jmp");
Time Series(
X( :Date ),
Y( :Sales ),
Show Lag Plot( 1 ),
X11( Additive ),
SendToReport( Dispatch( {}, "Time Series Basic Diagnostics", OutlineBox, {Close( 1 )} ) )
);
Code Explanation:
- Open data table;
- Create time series plot.
- Set X-axis to Date.
- Set Y-axis to Sales.
- Enable lag plot display.
- Apply additive X11 decomposition.
- Close basic diagnostics outline.
Example 7
Summary: Creates an ARIMA model group for Steel Shipments time series data, specifying orders from 0 to 2 for both AR and MA components.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Steel Shipments ) );
obj << ARIMA Model Group( AR( 0, 2 ), MA( 0, 2 ) );
Code Explanation:
- Open data table.
- Create time series object.
- Specify time series variable.
- Define ARIMA model group.
- Set AR order from 0 to 2.
- Set MA order from 0 to 2.
Example 8
Summary: Creates an ARIMA model to forecast Steel Shipments over time, utilizing Time Series and ARIMA Model Group features in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Steel Shipments ) );
obj << ARIMA Model Group( AR( 0, 2 ), MA( 0, 2 ) );
Eval( obj << Get Script );
Code Explanation:
- Open data table.
- Create time series object.
- Specify ARIMA model parameters.
- Retrieve model script.
Example 9
Summary: Creates a P chart to monitor the proportion of Total Plastic defects over time, utilizing subgrouping by Week and phase variable by Location in the Control Chart Builder platform.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Time Series( Y( :steel shipments ) );
Code Explanation:
- Set default names to current.
- Open data table.
- Create time series object.
Example 10
Summary: Creates a time series analysis report, including a P chart to monitor the proportion of Total Plastic defects over time, with subgrouping by Week and phase variable by Location.
Code:
dt under test = Open("data_table.jmp");
obj = Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ) ),
Input Series( :Input Gas Rate ),
SendToReport(
Dispatch( {"Time Series Output CO2"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)", "Residuals"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)", "Interactive Forecasting"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Input Time Series Panel", "Input Series: Input Gas Rate"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Time Series Output CO2"}, "Model Comparison", OutlineBox, {Close( 1 )} ),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)"}, "Parameter Estimates", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Perform time series analysis.
- Set output variable.
- Define input list.
- Specify transfer function.
- Include input series.
- Customize report settings.
- Adjust scale for output.
- Adjust scale for residuals.
- Adjust scale for forecasting.
Example 11
Summary: Creates a P chart to monitor the proportion of Total Plastic defects over time, with subgrouping by Week and phase variable by Location, using the Time Series platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) ),
Local Data Filter(
Add Filter( columns( :Log Passengers ), Where( :Log Passengers >= 2.1 & :Log Passengers <= 2.5 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 0 );
dt << Select Where( :Season == 10 );
dt << Exclude();
rpt = Report( obj );
Code Explanation:
- Open table.
- Create Time Series object.
- Set Y variable.
- Define Variogram.
- Configure Seasonal ARIMA.
- Add Local Data Filter.
- Set filter conditions.
- Configure filter mode.
- Disable automatic recalculation.
- Select specific season.
- Exclude selected rows.
- Generate report.
Example 12
Summary: Creates a time series object for analyzing log passengers data, incorporating seasonal ARIMA modeling and local data filtering to generate a report.
Code:
dt = Open("data_table.jmp");
obj = Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) ),
Local Data Filter(
Add Filter( columns( :Log Passengers ), Where( :Log Passengers >= 2.1 & :Log Passengers <= 2.5 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 1 );
dt << Select Where( :Season == 10 );
dt << Exclude();
rpt = Report( obj );
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) ),
Local Data Filter(
Add Filter( columns( :Log Passengers ), Where( :Log Passengers >= 2.1 & :Log Passengers <= 2.5 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 0 );
dt << Select Where( :Season == 10 );
dt << Exclude();
rpt = Report( obj );
Code Explanation:
- Open data table.
- Create time series object.
- Set variogram.
- Define seasonal ARIMA model.
- Add local data filter.
- Configure filter mode.
- Enable automatic recalculation.
- Select rows where season is 10.
- Exclude selected rows.
- Generate report.
Example 13
Summary: Creates a time series object for analyzing log passengers data, incorporating seasonal ARIMA modeling and local data filtering to focus on specific ranges.
Code:
dt = Open("data_table.jmp");
obj = Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) ),
Local Data Filter(
Add Filter( columns( :Log Passengers ), Where( :Log Passengers >= 2.1 & :Log Passengers <= 2.5 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 1 );
dt << Select Where( :Season == 10 );
dt << Exclude();
Code Explanation:
- Open data table.
- Create time series object.
- Set response variable.
- Configure variogram.
- Define seasonal ARIMA model.
- Add local data filter.
- Set filter criteria.
- Enable automatic recalculation.
- Select specific rows.
- Exclude selected rows.
Example 14
Summary: Creates a time series analysis to model and forecast CO2 output based on input gas rate, with interactive forecasting capabilities.
Code:
dt under test = Open("data_table.jmp");
obj = Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ) ),
Input Series( :Input Gas Rate ),
SendToReport(
Dispatch( {"Time Series Output CO2"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)", "Residuals"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Time Series Output CO2", "Transfer Function Model (1)", "Interactive Forecasting"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
),
Dispatch( {"Input Time Series Panel", "Input Series: Input Gas Rate"}, "1", ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 0 ), Min( 0 ), Max( 300 ), Inc( 50 ), Show Major Grid( 1 )}
)
)
);
Code Explanation:
- Open data table.
- Define time series analysis.
- Set output variable.
- Specify input list.
- Configure transfer function.
- Define input series.
- Adjust report settings.
- Set scale properties.
- Format numeric display.
- Define axis limits.
Example 15
Summary: Creates a P chart to monitor the proportion of Total Plastic defects over time, using the Control Chart Builder platform with subgrouping by Week and phase variable by Location.
Code:
dt under test = Open("data_table.jmp");
obj = Time Series( Y( :Log Passengers ), Variogram( 1 ), Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) ) );
Code Explanation:
- Open data table.
- Create time series object.
- Specify log passengers as response.
- Add variogram with lag 1.
- Apply seasonal ARIMA model.
- Set non-seasonal terms: 0, 1, 1.
- Set seasonal terms: 0, 1, 1.
- Define seasonal period as 12.
- Exclude intercept from model.
Example 16
Summary: Runs the analysis and modeling of CO2 output data using ARIMA and transfer functions, generating reports and calculating innovations and residual sums of squares.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Output CO2 ), Input List( :Input Gas Rate ), );
obj << Arima( 1, 0, 0, Actual( 1 ) );
obj << Transfer Function( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ) );
rpt = obj << report;
dt1 = (rpt["Model: AR(1)"] << get scriptable object) << Save Columns;
b ssi1 = Sum( (dt1:Innovations Output CO2 << get values) ^ 2 );
b sse1 = Sum( (dt1:Residual Output CO2 << get values) ^ 2 );
summary1 = rpt["Model: AR(1)"]["Model Summary"][Table Box( 1 )] << get as matrix;
dt2 = (rpt["Transfer Function Model (1)"] << get scriptable object) << Save Columns;
b ssi2 = Sum( (dt2:Innovations Output CO2 << get values) ^ 2 );
b sse2 = Sum( (dt2:Residual Output CO2 << get values) ^ 2 );
summary2 = rpt["Transfer Function Model (1)"]["Model Summary"][Table Box( 1 )] << get as matrix;
Close( dt1, no save );
Code Explanation:
- Open data table.
- Create time series object.
- Fit ARIMA model.
- Add transfer function.
- Generate report.
- Save AR(1) columns.
- Calculate Innovations SS.
- Calculate Residual SS.
- Extract Model Summary.
- Close temporary table.
Example 17
Summary: Creates and analyzes time series models for Log Passengers data, including ARIMA, Seasonal ARIMA, and Linear Exponential Smoothing methods.
Code:
dt = Open("data_table.jmp");
obj = Time Series( Y( :Log Passengers ) );
befAA = Associative Array( Window() << get window title );
obj << ARIMA( 0, 1, 1, Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula1 = dt2:Log Passengers Prediction Formula << get values;
pred y1 = dt2:Predicted Log Passengers << get values;
Close( dt2, no save );
befAA = Associative Array( Window() << get window title );
obj << Seasonal ARIMA( 0, 1, 1, 1, 0, 1, 4, Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula2 = dt2:Log Passengers Prediction Formula << get values;
pred y2 = dt2:Predicted Log Passengers << get values;
Close( dt2, no save );
befAA = Associative Array( Window() << get window title );
obj << Simple Exponential Smoothing( Zero to One, Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula3 = dt2:Log Passengers Prediction Formula << get values;
pred y3 = dt2:Predicted Log Passengers << get values;
Close( dt2, no save );
befAA = Associative Array( Window() << get window title );
obj << Linear Exponential Smoothing( Zero to One, Confidence Intervals( 0.9 ), Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula4 = dt2:Log Passengers Prediction Formula << get values;
pred y4 = dt2:Predicted Log Passengers << get values;
Code Explanation:
- Open data_table data
- Create time series object for Log Passengers.
- Capture initial window titles.
- Fit ARIMA model.
- Capture new window titles.
- Remove initial windows from new titles.
- Get keys of new windows.
- Open data table.
- Extract prediction formula and predicted values.
- Close data table without saving.
Example 18
Summary: Creates a time series model to predict CO2 output based on input gas rates, utilizing the Transfer Function platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Output CO2 ), Input List( :Input Gas Rate ), );
befAA = Associative Array( Window() << get window title );
obj << Transfer Function(
Order( 2, 0, 0 ),
Seasonal( 0, 0, 0, 0 ),
:Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ),
Save Columns
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y6 = dt2:Predicted Output CO2 << get values;
If( Host is( Windows ), , );
pred y6 for = Char( dt2:Predicted Output CO2 << get formula );
Code Explanation:
- Open data_table data
- Create time series object.
- Capture initial window titles.
- Apply transfer function model.
- Capture updated window titles.
- Identify new window titles.
- Access first new data table.
- Retrieve predicted CO2 values.
- Check host operating system.
- Get prediction formula.
Example 19
Summary: Runs the prediction of temperature values using a Seasonal ARIMA model, generating predicted temperature values and saving the prediction formula.
Code:
dt1 = Open("data_table.jmp");
obj1 = dt1 << Time Series( Y( :Temperature ), );
obj2 = obj1 << Seasonal ARIMA( 0, 0, 0, 0, 2, 2, 12 );
dt2 = obj2 << Save Prediction Formula;
pred1 = dt2:Predicted Temperature << get values;
pred1 for = dt2:Temperature Prediction Formula << get values;
Code Explanation:
- Open data table.
- Create time series object.
- Apply Seasonal ARIMA model.
- Save prediction formula.
- Extract predicted values.
- Get prediction formula values.
Example 20
Summary: Calculates and visualizes MAPE (Mean Absolute Percentage Error) for a time series model, utilizing Transfer Function and Associative Array operations in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Output CO2 ), Input List( :Input Gas Rate ) );
bef aa = Associative Array( Window() << get window title );
obj << Transfer Function(
Order( 1, 1, 1 ),
Seasonal( 0, 1, 0, 0 ),
:Input Gas Rate( Order( 0, 1, 0 ), Seasonal( 0, 1, 0, 0 ), Lag( 3 ) ),
Save Columns
);
aft aa = Associative Array( Window() << get window title );
aft aa << Remove( bef aa );
aftlst = aft aa << get keys;
dt2 = Data Table( aftlst[1] );
dt2 << New Column( "temp APE", formula( Abs( (:Actual Output CO2 - :Predicted Output CO2) / :Actual Output CO2 ) ) );
b MAPE = Sum( (dt2:temp APE << get values)[5 :: 296] ) * 100 / 295;
rpt = Report( obj );
MAPE = (rpt[Outline Box( "Model Comparison" )][Table Box( 1 )] << get as matrix)[10];
Code Explanation:
- Open data_table data
- Create time series object.
- Store initial window titles.
- Apply transfer function model.
- Store updated window titles.
- Remove initial window titles.
- Extract new window keys.
- Open data table.
- Add temporary APE column.
- Calculate MAPE from APE.
Example 21
Summary: Time series analysis and diagnostics for CO2 output and gas rate input, extracting prewhitening ACF and PACF matrices, and visualizing cross-correlation plots.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Input Series( :Input Gas Rate, Prewhitening( Order( 0, 0, 0 ), Seasonal( 0, 0, 0, 12 ) ) )
);
rpt1 = Report( obj1 );
acf1 = rpt1[Outline Box( "Prewhitening Plot (0,0,0)(0,0,0)12 : Output - Output CO2 vs. Input - Input Gas Rate" )][Table Box( 2 )] <<
get as matrix;
pacf1 = rpt1[Outline Box( "Prewhitening Plot (0,0,0)(0,0,0)12 : Output - Output CO2 vs. Input - Input Gas Rate" )][Table Box( 3 )] <<
get as matrix;
obj2 = dt << Time Series( Y( :Input Gas Rate ), );
rpt2 = Report( obj2 );
acf2 = (rpt2[Outline Box( "Time Series Basic Diagnostics" )][Table Box( 1 )] << get as matrix) || (rpt2[
Outline Box( "Time Series Basic Diagnostics" )][Table Box( 2 )] << get as matrix);
pacf2 = (rpt2[Outline Box( "Time Series Basic Diagnostics" )][Table Box( 3 )] << get as matrix);
Close( dt, no save );
dt = New Table( "Test", New Column( "X", Values( [1, 3, 7, 9, 7, 3, 4] ) ), New Column( "Y", Values( [4, 5, 8, 1, 4, 1, 5] ) ) );
obj = dt << Time Series(
Y( :Y ),
Input List( :X ),
Time Series Graph( 0 ),
Autocorrelation( 0 ),
Partial Autocorrelation( 0 ),
Cross Correlation( 1 ),
Number of Autocorrelation Lags( 3 ),
Input Series( :X, Time Series Graph( 0 ), Autocorrelation( 0 ), Partial Autocorrelation( 0 ), Number of Autocorrelation Lags( 3 ) ),
);
rpt = Report( obj );
nlag = Abs( rpt[Outline Box( "Cross Correlation Plots: Output Series - Y" )][Number Col Box( 1 )] << get as matrix );
se = 1 / Sqrt( J( N Rows( dt ), 1, N Rows( dt ) ) - nlag );
Code Explanation:
- Open data_table data
- Perform time series analysis on CO2 output.
- Extract prewhitening ACF matrix.
- Extract prewhitening PACF matrix.
- Perform time series analysis on gas rate input.
- Extract ACF matrix from diagnostics.
- Extract PACF matrix from diagnostics.
- Close original data table.
- Create new test data table.
- Perform time series analysis on test data.
Example 22
Summary: Generates simulated data for time series forecasting using a seasonal ARIMA model, with variogram modeling and random seed specification.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Ozone Concentration ), Variogram( 1 ), Seasonal ARIMA( 1, 0, 1, 1, 0, 1, 12, No Intercept( 1 ) ) );
dt2 = obj << Generate Simulation( 1, 12345, 100, 10 );
Code Explanation:
- Open data table.
- Create time series object.
- Define variogram model.
- Define seasonal ARIMA model.
- Generate simulation data.
- Set random seed.
- Specify number of simulations.
- Define forecast horizon.
- Include no intercept term.
- Save simulated data table.
Example 23
Summary: Analyze and visualize log passengers data using Time Series, generating a report with a lag plot configured to 4 lags.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series(
Y( :Log Passengers ),
Variogram( 1 ),
Show Lag Plot( 1 ),
Seasonal ARIMA( 0, 1, 1, 0, 1, 1, 12, No Intercept( 1 ) )
);
rpt = obj << report;
rpt[Outline Box( "Lag Plot" )][Number Edit Box( 1 )] << Set( 4 );
Code Explanation:
- Open data_table data
- Launch Time Series analysis.
- Select log passengers variable.
- Enable variogram.
- Show lag plot.
- Configure Seasonal ARIMA model.
- Generate report.
- Access Lag Plot outline box.
- Modify lag plot settings.
- Set lag plot to 4 lags.
Example 24
Summary: Runs a time series analysis to model the relationship between Output CO2 and Input Gas Rate, utilizing a Transfer Function with Order, Seasonal, and Lag components.
Code:
dt = Open("data_table.jmp");
Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 1, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 0, 0, 0 ), Seasonal( 0, 0, 0, 0 ), Lag( 0 ) ) ),
Input Series( :Input Gas Rate )
);
Close( dt, no save );
b DF = 283;
b LL = -4.12514377097875;
Code Explanation:
- Open data table.
- Define time series analysis.
- Set output variable.
- Specify input list.
- Configure transfer function.
- Define input series.
- Close data table without saving.
- Assign degrees of freedom.
- Assign lower limit value.
Example 25
Summary: Creates a transfer function model to analyze CO2 output based on input gas rate, utilizing Time Series and Transfer Function platforms in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ) ),
Input Series( :Input Gas Rate )
);
rpt = obj << report;
summary1 = rpt[Outline Box( "Transfer Function Model (1)" )][Outline Box( "Model Summary" )][Table Box( 1 )] << get as matrix;
Close( dt, no save );
b log1 = "Stablized parameterization returns invalid smoothing parameters. Cannot fit the model.";
Code Explanation:
- Open table.
- Define time series object.
- Set output variable.
- Set input list.
- Define transfer function.
- Set input series.
- Generate report.
- Extract model summary.
- Close table without saving.
- Log error message.
Example 26
Summary: Simulates a time series model to predict Total Plastic defects over time, with subgrouping by Week and phase variable by Location.
Code:
dt = Open("data_table.jmp");
obj = Time Series( Y( :Output CO2 ), Input List( :Input Gas Rate ), Input Series( :Input Gas Rate ) );
obj << Simulate Once( 1 );
Code Explanation:
- Open data table;
- Define time series model.
- Set output variable.
- Specify input variables.
- Run simulation once.
Example 27
Summary: Runs the simulation and reporting of a seasonal ARIMA model for CO2 output based on input gas rate, with 10 iterations and a single report generation.
Code:
dt = Open("data_table.jmp");
obj = Time Series( Y( :Output CO2 ), Input List( :Input Gas Rate ), Difference( 0, 1, 12 ), Input Series( :Input Gas Rate ) );
obj << Seasonal ARIMA( 0, 0, 0, 0, 0, 0, 12 );
rpt = obj << report;
For( i = 1, i <= 10, i++,
obj << Simulate Once( 1 )
);
rpt[Outline Box( "Model Comparison" )][FrameBox( 1 )] << select;
Code Explanation:
- Open data table.
- Create time series object.
- Define model parameters.
- Fit seasonal ARIMA model.
- Generate report.
- Loop 10 times.
- Simulate model once per iteration.
- Select model comparison outline.
- Highlight first frame box.
- Select specific content.
Example 28
Summary: Runs the removal of linear trend and cycle from a time series data set, capturing log information before deletion.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Sales ) );
dt:Sales << Set selected;
log1 = Log Capture( dt << Delete Columns() );
obj << Remove Linear Trend( 1 );
obj << Remove Cycle( Units per cycle( 12 ) );
Close( dt, no save );
rn1 = [];
Code Explanation:
- Open data table;
- Create Time Series object for "Sales".
- Select all rows in "Sales".
- Capture log before deleting columns.
- Delete selected columns.
- Remove linear trend from Time Series.
- Remove 12-unit cycle from Time Series.
- Close table without saving.
- Initialize empty list rn1.
Example 29
Summary: Runs the simulation and analysis of steel shipments using ARIMA modeling, with random seed setting and multiple simulations.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Time Series( Y( :Steel Shipments ) );
obj1 << arima( 1, 0, 0 );
obj1 << Set Seed( 1111 );
obj1 << Simulate Once( 1 );
rn1 = [];
For( i = 1, i <= 100, i++,
rn1 |/= Random Uniform()
);
obj1 << close window( 1 );
For( i = 1, i <= 50, i++,
rn2 = [];
obj2 = dt << Time Series( Y( :Steel Shipments ) );
obj2 << arima( 1, 0, 0 );
obj2 << Set Seed( 1111 );
obj2 << Simulate Once( 1 );
For( j = 1, j <= 100, j++,
rn2 |/= Random Uniform()
);
obj2 << close window( 1 );
);
Code Explanation:
- Open data_table data
- Create time series object.
- Apply ARIMA model.
- Set random seed.
- Simulate once.
- Initialize random number list.
- Loop 100 times.
- Append random numbers.
- Close first window.
- Loop 50 times for simulations.
Example 30
Summary: Creates a P chart to monitor the proportion of Total Plastic defects over time using the Control Chart Builder platform, with subgrouping by Week and phase variable by Location.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series(
Y( :date ),
Input List( :Ozone Concentration ),
Input Series(
:Ozone Concentration,
ARIMA( 0, 0, 0 ),
Prewhitening( Order( 0, 0, 0 ), Seasonal( 0, 0, 0, 12 ) ),
Seasonal ARIMA( 0, 0, 0, 0, 0, 0, 12 )
)
);
rpt = Report( obj );
jrn1 = rpt[CheckBoxBox( 2 )] << get journal;
rpt[CheckboxBox( 2 )] << set( 2 );
rpt2 = Report( obj );
jrn2 = rpt2[CheckBoxBox( 2 )] << get journal;
Code Explanation:
- Open data table;
- Initiate Time Series analysis.
- Set date column as Y variable.
- Add Ozone Concentration to input list.
- Configure Ozone Concentration as input series.
- Define ARIMA model parameters.
- Set prewhitening order and seasonal parameters.
- Define seasonal ARIMA model parameters.
- Generate initial report object.
- Extract journal from checkbox box.
- Toggle checkbox box state.
- Generate updated report object.
- Extract journal from updated checkbox box.
Example 31
Summary: Creates a P chart to monitor the proportion of Total Plastic defects over time, utilizing Control Chart Builder and Time Series analysis.
Code:
dt = Open("data_table.jmp");
obj = Time Series( Y( :Log Passengers ) );
befAA = Associative Array( Window() << get window title );
obj << ARIMA( 0, 1, 1, Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula1 = dt2:Log Passengers Prediction Formula << get values;
pred y1 = dt2:Predicted Log Passengers << get values;
Code Explanation:
- Open table.
- Create time series object.
- Store initial window titles.
- Apply ARIMA model.
- Store updated window titles.
- Remove unchanged titles.
- Extract new window keys.
- Access prediction data table.
- Retrieve prediction formula values.
- Retrieve predicted log passengers values.
Example 32
Summary: Time series analysis and diagnostics for CO2 output and gas rate data, generating prewhitening plots and extracting ACF and PACF matrices.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Input Series( :Input Gas Rate, Prewhitening( Order( 0, 0, 0 ), Seasonal( 0, 0, 0, 12 ) ) )
);
rpt1 = Report( obj1 );
acf1 = rpt1[Outline Box( "Prewhitening Plot (0,0,0)(0,0,0)12 : Output - Output CO2 vs. Input - Input Gas Rate" )][Table Box( 2 )] <<
get as matrix;
pacf1 = rpt1[Outline Box( "Prewhitening Plot (0,0,0)(0,0,0)12 : Output - Output CO2 vs. Input - Input Gas Rate" )][Table Box( 3 )] <<
get as matrix;
obj2 = dt << Time Series( Y( :Input Gas Rate ), );
rpt2 = Report( obj2 );
acf2 = (rpt2[Outline Box( "Time Series Basic Diagnostics" )][Table Box( 1 )] << get as matrix) || (rpt2[
Outline Box( "Time Series Basic Diagnostics" )][Table Box( 2 )] << get as matrix);
pacf2 = (rpt2[Outline Box( "Time Series Basic Diagnostics" )][Table Box( 3 )] << get as matrix);
Code Explanation:
- Open data table.
- Create time series object for CO2 output.
- Define input list and series for gas rate.
- Generate prewhitening plot report.
- Extract ACF matrix from prewhitening plot.
- Extract PACF matrix from prewhitening plot.
- Create time series object for gas rate.
- Generate basic diagnostics report.
- Extract combined ACF matrix from diagnostics.
- Extract PACF matrix from diagnostics.
Example 33
Summary: Runs a time series analysis to model the relationship between Output CO2 and Input Gas Rate, using a Transfer Function with specified orders and seasonal parameters.
Code:
dt = Open("data_table.jmp");
Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 1, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 0, 0, 0 ), Seasonal( 0, 0, 0, 0 ), Lag( 0 ) ) ),
Input Series( :Input Gas Rate )
);
Code Explanation:
- Open data table;
- Define time series analysis.
- Set output variable to "Output CO2".
- Specify input list as "Input Gas Rate".
- Configure transfer function order.
- Set seasonal parameters for transfer function.
- Define input series order.
- Set seasonal parameters for input series.
- Set lag for input series.
- Execute time series analysis.
Example 34
Summary: Creates a transfer function model to analyze the relationship between Output CO2 and Input Gas Rate, generating a report with summary statistics.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 0 ), :Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ) ),
Input Series( :Input Gas Rate )
);
rpt = obj << report;
summary1 = rpt[Outline Box( "Transfer Function Model (1)" )][Outline Box( "Model Summary" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Define time series analysis.
- Set output variable.
- Specify input list.
- Configure transfer function.
- Define input series.
- Generate report.
- Extract model summary.
- Convert to matrix.
- Store in variable.
Example 35
Summary: Process of creating a P chart to monitor the proportion of Total Plastic defects over time, utilizing Control Chart Builder with subgrouping by Week and phase variable by Location.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Sales ) );
dt:Sales << Set selected;
log1 = Log Capture( dt << Delete Columns() );
obj << Remove Linear Trend( 1 );
obj << Remove Cycle( Units per cycle( 12 ) );
Code Explanation:
- Open table.
- Create time series object.
- Select sales column.
- Capture log.
- Delete columns.
- Remove linear trend.
- Remove cycle.
Example 36
Summary: Analyzes and creates reports for Steel Shipments time series data using ARIMA modeling, with interactive features for model comparison and automatic recalculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Steel Shipments ) );
obj << arima( 1, 0, 0 );
rpt = obj << report;
max1 = rpt["Model Comparison"][AxisBox( 2 )] << get max;
obj << Automatic Recalc( 1 );
dt << Select Randomly( 0.1 ) << Hide and Exclude();
rpt = obj << report;
max2 = rpt["Model Comparison"][AxisBox( 2 )] << get max;
Code Explanation:
- Open data table.
- Create time series object.
- Fit ARIMA model.
- Generate report.
- Get maximum value.
- Enable automatic recalculation.
- Randomly select rows.
- Hide and exclude selected rows.
- Generate updated report.
- Get new maximum value.
Example 37
Summary: Runs the analysis and simulation of Steel Shipments time series data using ARIMA modeling, generating a report and simulating more scenarios.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( Y( :Steel Shipments ) );
obj << arima( 1, 0, 0 );
rpt = obj << report;
obj << Simulate More( 1, 2 );
Code Explanation:
- Open data table.
- Create time series object.
- Apply ARIMA model.
- Generate report.
- Simulate more scenarios.
Example 38
Summary: Creates a time series object with simple moving average model and report generation, utilizing the Time Series platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series( X( :Date ), Y( :Sales ), Simple Moving Average( Add Model( 5 ) ), );
rpt = obj << report;
temp = rpt["Simple Moving Average"] << get scriptable object;
temp << remove report;
Code Explanation:
- Open table "data_table".
- Create time series object.
- Set X variable as Date.
- Set Y variable as Sales.
- Add simple moving average model.
- Get report of time series object.
- Extract simple moving average section.
- Remove simple moving average report.
Example 39
Summary: Creates a time series model to forecast CO2 output based on input gas rate, using Transfer Functions with Order and Seasonal components.
Code:
dt = Open("data_table.jmp");
obj = dt << Time Series(
Y( :Output CO2 ),
Input List( :Input Gas Rate ),
Transfer Function(
Order( 2, 0, 0 ),
Seasonal( 0, 0, 0, 0 ),
:Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ),
No Intercept( 1 )
),
Transfer Function(
Order( 2, 0, 0 ),
Seasonal( 0, 0, 0, 0 ),
:Input Gas Rate( Order( 2, 0, 2 ), Seasonal( 0, 0, 0, 0 ), Lag( 3 ) ),
No Intercept( 1 ),
No Constrain( 1 )
),
Input Series( :Input Gas Rate ),
);
rpt = obj << report;
est1 = rpt["Transfer Function Model(1)"]["Parameter Estimates"][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data_table data
- Create time series object.
- Set output variable to CO2.
- Define input variable as gas rate.
- Configure first transfer function.
- Set transfer function order.
- Disable seasonal effects.
- Specify input gas rate parameters.
- Exclude intercept term.
- Extract parameter estimates into matrix.
Example 40
Summary: Analyze time series data by applying double exponential smoothing and ARIMA models to a dataset, extracting summary statistics and calculating AIC, SBC, R-squared, MAPE, and variance.
Code:
dt = Open("data_table.jmp");
obj = Time Series( y( :Log Passengers ) );
obj << Double Exponential Smoothing( unconstrained );
obj << ARIMA( 0, 2, 2, No Intercept( 1 ) );
rslt = obj << Get Models();
DF3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["DF"];
neg2LL3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["-2logLikelihood"];
AIC3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["AIC"];
SBC3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["SBC"];
RSQ3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["RSquared"];
MAPE3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["MAPE"];
var3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["Variance"];
est3 = rslt["Double (Brown) Exponential Smoothing"]["Level Smoothing Weight"]["Estimate"];
stderr3 = rslt["Double (Brown) Exponential Smoothing"]["Level Smoothing Weight"]["Std Err"];
Close( dt, no save );
b DF5 = 140;
b SSE5 = 0.287516621327776;
b var5 = 0.00205369015234126;
b SD5 = 0.0453176582839544;
b AIC5 = -469.193691163933;
b SBC5 = -463.28203704873;
b RSQ5 = 0.9410032503768;
b RSQAdj5 = 0.940581845022348;
b MAPE5 = 1.6491742352283;
b MAE5 = 0.039475277482647;
b neg2LL5 = -473.193691163933;
b level est5 = 1.27914764406304;
b trend est5 = 0.00000020685495623;
b level stderr5 = 0.0946695317579881;
b trend stderr5 = 0.000003715054589111;
b DF6 = 140;
b SSE6 = 0.287516561793894;
b var6 = 0.00205368972709924;
b SD6 = 0.0453176535921626;
b AIC6 = -469.193691164066;
b SBC6 = -463.282037048863;
b RSQ6 = 0.941003250382928;
b RSQAdj6 = 0.940581845028521;
b MAPE6 = 1.6491742320009;
b MAE6 = 0.0394752774094628;
b neg2LL6 = -473.193691164066;
b est6 = [0.720852329514038, 0.279147670483537];
b stderr6 = [0.0963449439647497, 0.0947912356930383];
Code Explanation:
- Open data table.
- Create time series object.
- Apply double exponential smoothing.
- Apply ARIMA model.
- Retrieve models from object.
- Extract summary statistics for DES.
- Calculate AIC for DES.
- Calculate SBC for DES.
- Calculate R-squared for DES.
- Close data table without saving.
Example 41
Summary: Analyze a time series dataset using seasonal exponential smoothing, retrieving model results and extracting various statistical metrics.
Code:
dt = Open("data_table.jmp");
obj = Time Series( y( :Log Passengers ) );
obj << Seasonal Exponential Smoothing( 12, unconstrained );
rslt = obj << Get Models();
DF9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["DF"];
neg2LL9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["-2logLikelihood"];
AIC9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["AIC"];
SBC9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["SBC"];
RSQ9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["RSquared"];
MAPE9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["MAPE"];
var9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Summary"]["Variance"];
level est9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Level Smoothing Weight"]["Estimate"];
level stderr9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Level Smoothing Weight"]["Std Err"];
season est9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Seasonal Smoothing Weight"]["Estimate"];
season stderr9 = rslt["Seasonal Exponential Smoothing( 12, Unconstrained )"]["Seasonal Smoothing Weight"]["Std Err"];
Close( dt, no save );
b DF11 = 128;
b SSE11 = 3.06458621232845e-33;
b var11 = 2.3942079783816e-35;
b SD11 = 4.89306445735349e-18;
b AIC11 = -670.119136608099;
b SBC11 = -661.493544638496;
b RSQ11 = 0.988610560515491;
b RSQAdj11 = 0.988432600523546;
b MAPE11 = 0.591555034883716;
b MAE11 = 0.0141607495444859;
b neg2LL11 = -676.119136608099;
b level est11 = -12478019.3789299;
b trend est11 = -21201937.2459429;
b season est11 = 223879056.399471;
b level stderr11 = 0.000000012621404604;
b trend stderr11 = 7027310.89747523;
b season stderr11 = 0.0000000014169191791;
Code Explanation:
- Open data table.
- Create time series object.
- Apply seasonal exponential smoothing.
- Retrieve model results.
- Extract degrees of freedom.
- Extract negative log-likelihood.
- Extract Akaike information criterion.
- Extract Schwarz Bayesian criterion.
- Extract R-squared.
- Extract mean absolute percentage error.
Example 42
Summary: Runs the application of Winters method to a time series object, extracting various metrics such as degrees of freedom, negative log-likelihood, and R-squared value.
Code:
dt = Open("data_table.jmp");
obj = Time Series( y( :Log Passengers ) );
obj << Winters Method( 12, unconstrained );
rslt = obj << Get Models();
DF11 = rslt["Winters Method (Additive)"]["Summary"]["DF"];
neg2LL11 = rslt["Winters Method (Additive)"]["Summary"]["-2logLikelihood"];
AIC11 = rslt["Winters Method (Additive)"]["Summary"]["AIC"];
SBC11 = rslt["Winters Method (Additive)"]["Summary"]["SBC"];
RSQ11 = rslt["Winters Method (Additive)"]["Summary"]["RSquared"];
MAPE11 = rslt["Winters Method (Additive)"]["Summary"]["MAPE"];
var11 = rslt["Winters Method (Additive)"]["Summary"]["Variance"];
level est11 = rslt["Winters Method (Additive)"]["Level Smoothing Weight"]["Estimate"];
level stderr11 = rslt["Winters Method (Additive)"]["Level Smoothing Weight"]["Std Err"];
trend est11 = rslt["Winters Method (Additive)"]["Trend Smoothing Weight"]["Estimate"];
trend stderr11 = rslt["Winters Method (Additive)"]["Trend Smoothing Weight"]["Std Err"];
season est11 = rslt["Winters Method (Additive)"]["Seasonal Smoothing Weight"]["Estimate"];
season stderr11 = rslt["Winters Method (Additive)"]["Seasonal Smoothing Weight"]["Std Err"];
Code Explanation:
- Open data table.
- Create time series object.
- Apply Winters method.
- Retrieve models from object.
- Extract degrees of freedom.
- Extract negative log-likelihood.
- Extract Akaike information criterion.
- Extract Schwarz Bayesian criterion.
- Extract R-squared value.
- Extract mean absolute percentage error.
Example 43
Summary: Analyze time series data by applying double exponential smoothing and ARIMA models to a dataset, extracting various statistical metrics.
Code:
dt = Open("data_table.jmp");
obj = Time Series( y( :Log Passengers ) );
obj << Double Exponential Smoothing( unconstrained );
obj << ARIMA( 0, 2, 2, No Intercept( 1 ) );
rslt = obj << Get Models();
DF3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["DF"];
neg2LL3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["-2logLikelihood"];
AIC3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["AIC"];
SBC3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["SBC"];
RSQ3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["RSquared"];
MAPE3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["MAPE"];
var3 = rslt["Double (Brown) Exponential Smoothing"]["Summary"]["Variance"];
est3 = rslt["Double (Brown) Exponential Smoothing"]["Level Smoothing Weight"]["Estimate"];
stderr3 = rslt["Double (Brown) Exponential Smoothing"]["Level Smoothing Weight"]["Std Err"];
Code Explanation:
- Open data_table data
- Create time series object.
- Apply double exponential smoothing.
- Apply ARIMA model.
- Retrieve models from object.
- Extract degrees of freedom.
- Extract negative log-likelihood.
- Extract Akaike Information Criterion.
- Extract Schwarz Bayesian Criterion.
- Extract R-squared value.
Example 44
Summary: Analyze a time series dataset using linear exponential smoothing and ARIMA models, extracting summary statistics and model estimates.
Code:
dt = Open("data_table.jmp");
obj = Time Series( y( :Log Passengers ) );
obj << Linear Exponential Smoothing( unconstrained );
obj << ARIMA( 0, 2, 2, No Intercept( 1 ) );
rslt = obj << Get Models();
DF5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["DF"];
neg2LL5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["-2logLikelihood"];
AIC5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["AIC"];
SBC5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["SBC"];
RSQ5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["RSquared"];
MAPE5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["MAPE"];
var5 = rslt["Linear (Holt) Exponential Smoothing"]["Summary"]["Variance"];
level est5 = rslt["Linear (Holt) Exponential Smoothing"]["Level Smoothing Weight"]["Estimate"];
level stderr5 = rslt["Linear (Holt) Exponential Smoothing"]["Level Smoothing Weight"]["Std Err"];
trend est5 = rslt["Linear (Holt) Exponential Smoothing"]["Trend Smoothing Weight"]["Estimate"];
trend stderr5 = rslt["Linear (Holt) Exponential Smoothing"]["Trend Smoothing Weight"]["Std Err"];
DF6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["DF"];
neg2LL6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["-2logLikelihood"];
AIC6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["AIC"];
SBC6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["SBC"];
RSQ6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["RSquared"];
MAPE6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["MAPE"];
var6 = rslt["IMA(2, 2) No Intercept"]["Summary"]["Variance"];
est6 = rslt["IMA(2, 2) No Intercept"]["MA Coefficients"];
stderr6 = rslt["IMA(2, 2) No Intercept"]["MA Coefficient Std Errors"];
Code Explanation:
- Open table.
- Create time series object.
- Apply linear exponential smoothing.
- Apply ARIMA model.
- Retrieve models.
- Extract Linear (Holt) Exponential Smoothing summary statistics.
- Extract IMA(2, 2) No Intercept summary statistics.
- Store results in variables.
- Save estimates and standard errors.
- Save MA coefficients and standard errors.
Time Series using Set Values
Example 1
Summary: Creates a time series object from a data table, setting X to year and Y to Wolfer, and calculating spectral density.
Code:
dt under test = Open("data_table.jmp");
dt under test:year << Set Values( Date MDY( 1, 1, dt under test:year << Get As Matrix ) );
dt under test:year << Format( "m/y" );
obj = Time Series( X( :year ), Y( :wolfer ), Spectral Density( 1 ) );
Code Explanation:
- Open data table.
- Convert year values to dates.
- Format year column as month/year.
- Create time series object.
- Set X variable to year.
- Set Y variable to Wolfer.
- Calculate spectral density.
- Analyze time series data.
Example 2
Summary: Creates a time series object from a data table, setting X to year and Y to Wolfer, with spectral density calculation.
Code:
dt under test = Open("data_table.jmp");
dt under test:year << Set Values(Date MDY(1,1,dt under test:year << Get As Matrix));
dt under test:year << Format("m/y");
obj = Time Series( X( :year ), Y( :wolfer ), Spectral Density( 1 ) );
Code Explanation:
- Open data table;
- Convert year values to dates.
- Format year column as month/year.
- Create time series object.
- Set X variable to year.
- Set Y variable to Wolfer.
- Calculate spectral density.
Time Series using Log Capture
Example 1
Summary: Time series analysis and report generation, capturing spectral density and redoing the analysis with a specific missing value code.
Code:
dt = Open("data_table.jmp");
Log Capture( obj = Time Series( X( :year ), Y( :wolfer ), Spectral Density( 1 ) ) );
:wolfer << Set Property( "Missing Value Codes", 1544 );
Log Capture( obj2 = obj << Redo Analysis );
rpt = obj2 << Report;
actN = (rpt[Number Col Box( 1 )] << Get( 3 ));
Code Explanation:
- Open data table.
- Create time series object.
- Log time series analysis.
- Set missing value code.
- Redo time series analysis.
- Capture analysis report.
- Extract numerical column box.
- Retrieve third element.
- Assign to variable actN.
Example 2
Summary: Analyze Steel Shipments data using Linear Exponential Smoothing with Stable Invertible model, generating a log capture object for further exploration.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture( obj = dt << Time Series( Y( :Steel Shipments ), Linear Exponential Smoothing( Stable Invertible ) ) );
Code Explanation:
- Open data table.
- Create log capture object.
- Launch Time Series analysis.
- Set Y variable to Steel Shipments.
- Apply Linear Exponential Smoothing.
- Ensure model is Stable Invertible.
Example 3
Summary: Runs state space smoothing and model comparison for a time series data set, utilizing error types, trend types, seasonal types, and constraints.
Code:
dt = Open("data_table.jmp");
Log Capture( obj = Time Series( Y( :Y ), X( :Time ), Where( :Series == "N 646" ), ) );
obj << State Space Smoothing(
Error Type( "Multiplicative" ),
Trend Type( "Additive" ),
Seasonal Type( "Multiplicative" ),
Damped( "No" ),
Period( 12 ),
Constrained( "Yes" )
);
obj << State Space Smoothing(
Error Type( "Additive" ),
Trend Type( "None" ),
Seasonal Type( "None" ),
Damped( "No" ),
Constrained( "Yes" )
);
rpt = obj << report;
rpt["Model Comparison"][CheckBoxBox( 2 )] << set all( 1 );
rpt["Model Comparison"][CheckBoxBox( 2 )] << set( 1, 0 );
Code Explanation:
- Open table.
- Create time series object.
- Apply state space smoothing.
- Configure error type.
- Set trend type.
- Define seasonal type.
- Disable damping.
- Set period.
- Enable constraints.
- Compare models.
Time Series using New Column
Example 1
Summary: Creates a time series plot and diagnostic report for 'Steel Shipments' data, with adjustments made to values after May.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Steel Shipments2", numeric, formula( If( Month( :Date ) > 5, 2 * :Steel Shipments, :Steel Shipments ) ) );
obj1 = dt << Time Series( Y( :steel shipments2 ) );
rpt1 = obj1 << report;
test1 = (rpt1["Time Series Basic Diagnostics"][Table Box( 1 )] << get as matrix);
obj2 = dt << Time Series( Y( :steel shipments ), Automatic Recalc( 1 ) );
:Steel Shipments[Where( Month( :Date ) > 5 )] *= 2;
rpt2 = obj2 << report;
test2 = (rpt2["Time Series Basic Diagnostics"][Table Box( 1 )] << get as matrix);
Code Explanation:
- Open data_table data
- Create new column "Steel Shipments2".
- Apply formula to new column.
- Generate time series plot for "Steel Shipments2".
- Extract diagnostics from first plot.
- Generate time series plot for "Steel Shipments".
- Double values for "Steel Shipments" after May.
- Extract diagnostics from second plot.
Example 2
Summary: Fits a standard least squares model with multiple effects and generates a profiler plot for data analysis.
Code:
dt = Open("data_table.jmp");
dt << New Column( "YearMonth", Numeric, Continuous, Formula( Date MDY( :Month, 1, :Year ) ), Format( "m/y" ) );
dt:Name( "YearMonth" ) << Set Property( "Time Frequency", {"Numeric"} );
obj = dt << Time Series( Y( :CO2 ), X( :Name( "YearMonth" ) ), ARIMA( 1, 0, 1 ) );
rpt = obj << report;
Try(
rpt[Outline Box( "Model Comparison" )][CheckBoxBox( 2 )] << set;
rpt[Outline Box( "Model Comparison" )][CheckBoxBox( 2 )] << set;
rpt[Outline Box( "Model Comparison" )][CheckBoxBox( 2 )] << set;
);
Code Explanation:
- Open data table.
- Create YearMonth column.
- Set YearMonth as numeric time frequency.
- Perform ARIMA(1,0,1) time series analysis.
- Retrieve model comparison report.
- Attempt to set checkbox twice.
Example 3
Summary: Fits a standard least squares model with multiple effects and generating a profiler plot using JMP's Time Series analysis feature.
Code:
dt = Open("data_table.jmp");
dt << New Column( "year2",
numeric,
Format( "yyyyQq", 9 ),
formula( Informat( Char( :year ) || "Q1", "yyyyQq" ) ),
Set Property( "Time Frequency", Time Frequency( Annual ) )
);
obj = dt << Time Series( X( :year2 ), Y( :wolfer ), Spectral Density( 1 ) );
befAA = Associative Array( Window() << get window title );
obj << Save Spectral Density( 1 );
rpt = Report( obj );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
dt2 = Data Table( (aftlst = aftAA << get keys)[1] );
p1 = dt2:Period << get values;
f1 = dt2:Angular Frequency << get values;
f2 = dt2:Frequency << get values;
den1 = dt2:Spectral Density << get values;
kappa = (rpt[Outline Box( "White Noise test" )][Table Box( 1 )] << get as matrix)[1];
pkappa = (rpt[Outline Box( "White Noise test" )][Table Box( 1 )] << get as matrix)[2];
bartlett ks = (rpt[Outline Box( "White Noise test" )][Table Box( 1 )] << get as matrix)[3];
Code Explanation:
- Open data table.
- Create new column "year2".
- Set column format and formula.
- Define time frequency as annual.
- Run Time Series analysis.
- Store initial window titles.
- Save spectral density plot.
- Retrieve report object.
- Store updated window titles.
- Compare and remove unchanged titles.
Time Series using Set Property
Example 1
Summary: Runs the processing and smoothing of a time series dataset, generating a table with smoothed columns.
Code:
dt = Open("data_table.jmp");
dt:DATE << Set Property( "Time Frequency", {"Numeric"} );
ts = dt << Time Series( X( :DATE ), Y( :LEADPROD ), );
m1 = ts << Simple Exponential Smoothing( Zero to One );
saved dt = m1 << Save Columns;
Code Explanation:
- Open data table.
- Set DATE column as numeric.
- Create time series plot.
- Apply simple exponential smoothing.
- Save smoothed columns to table.
Example 2
Summary: Analyze and visualize mean profit by product line and quarter from the Profit by Product dataset using Graph Builder.
Code:
dt = Open("data_table.jmp");
dt:Year << Set Property( "Time Frequency", Time Frequency( Annual ) );
Log Capture( obj = dt << Time Series( X( :Year ), Y( :Sales ), ARIMA( 1, 0, 0 ) ) );
Report( obj )[Outline Box( "Model Comparison" )][CheckBoxBox( 2 )] << Set( 1 );
Close( dt, no save );
b log1 = "Deleting columns is canceled. Column Sales is used by a report.";
Code Explanation:
- Open data table.
- Set Year as annual time frequency.
- Perform ARIMA analysis on Sales.
- Log capture of time series analysis.
- Enable model comparison checkbox.
- Close data table without saving.
- Define log message for column deletion cancellation.
Example 3
Summary: Process of applying seasonal exponential smoothing to a time series dataset, extracting new window keys and retrieving prediction formulas.
Code:
dt = Open("data_table.jmp");
dt:DATE << Set Property( "Time Frequency", {"Numeric"} );
obj = dt << Time Series( X( :date ), Y( :Ozone Concentration ) );
befAA = Associative Array( Window() << get window title );
obj << Seasonal Exponential Smoothing( 12, Zero to One, Save Prediction Formula );
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
dt2 = Data Table( aftlst[1] );
pred y formula5 = dt2:Ozone Concentration Prediction Formula << get values;
pred y5 = dt2:Predicted Ozone Concentration << get values;
Code Explanation:
- Open data table.
- Set date property.
- Create time series object.
- Capture initial window titles.
- Apply seasonal exponential smoothing.
- Capture updated window titles.
- Remove unchanged titles.
- Extract new window keys.
- Access prediction data table.
- Retrieve prediction formulas.
Example 4
Summary: Time series analysis and model comparison for the specified data table, setting the year's time frequency to annual and fitting an ARIMA(1, 0, 0) model.
Code:
dt = Open("data_table.jmp");
dt:Year << Set Property( "Time Frequency", Time Frequency( Annual ) );
Log Capture( obj = dt << Time Series( X( :Year ), Y( :Sales ), ARIMA( 1, 0, 0 ) ) );
Report( obj )[Outline Box( "Model Comparison" )][CheckBoxBox( 2 )] << Set( 1 );
Code Explanation:
- Open data table;
- Set Year's time frequency to Annual.
- Log capture Time Series analysis.
- Fit ARIMA(1, 0, 0) model.
- Access Model Comparison outline box.
- Select second checkbox.
- Set selected checkbox to 1.
Time Series using Column
Summary: Creates ARIMA(1,1,1) model predictions for a specified column in a JMP data table.
Code:
dt = Open("data_table.jmp");
yColN = "Steel Shipments";
yCol = Column( dt, "Steel Shipments" );
ts = dt << Time Series( Y( Eval( yCol ) ), Number of Forecast Periods( 1 ), Save Prediction Formula( 1 ) );
tsmodel = "ARIMA(1,1,1)";
Eval( Parse( "model1 = ts <<" || tsmodel ) );
dt2 = model1 << Save Prediction Formula( 1 );
pred2 = dt2:Steel Shipments Prediction Formula << get values;
modspec = ts << Get Model Specs;
fVals = Eval(
Substitute(
Expr(
ARIMA Forecast( dtcol, length, _model, _estimates, from, to )
),
Expr( dtcol ), Eval( yCol ),
Expr( length ), Parse( Char( N Row( dt ) ) ),
Expr( from ), Parse( Char( -1 * N Row( dt ) + 1 ) ),
Expr( to ), 0,
Expr( _model ), Parse( tsmodel ),
Expr( _estimates ), Arg( modspec[1], 2 )
)
);
dt << New Column( "Predictions for " || yColN || " from " || tsmodel, Numeric, Continuous, Values( fVals ) );
pred1 = dt:Name( "Predictions for Steel Shipments from ARIMA(1,1,1)" ) << get values;
Code Explanation:
- Open table.
- Set column name.
- Create time series object.
- Define ARIMA model.
- Fit ARIMA model.
- Save prediction formula.
- Extract prediction values.
- Get model specifications.
- Generate forecast values.
- Add predictions to table.