<?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: How to simulate process data with some degree of autocorrelation? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551311#M76721</link>
    <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;for the suggestion.&amp;nbsp; This seems like it should be exactly what I need, but I'm afraid I'm having trouble figuring out how to properly implement it.&amp;nbsp; To start with, I would just like to generate one simulated column in a data table.&amp;nbsp; I know the mean, overall process standard deviation, within sigma (control chart sigma - which in this situation is based on the moving range), and the "Autocorrelation" value (from the summary statistics in the distribution platform).&amp;nbsp; I can also get a Correlation value for the process parameter against the Lag() of itself (by one row) from Fit Y by X - and I could repeat the correlation analysis for different row lags.&amp;nbsp; Any chance you could help me understand how I should structure the formula given the information I have (or let me know if I am just missing the boat entirely)?&lt;/P&gt;</description>
    <pubDate>Fri, 30 Sep 2022 15:28:31 GMT</pubDate>
    <dc:creator>gwenhallberg</dc:creator>
    <dc:date>2022-09-30T15:28:31Z</dc:date>
    <item>
      <title>How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550875#M76700</link>
      <description>&lt;P&gt;I work in a manufacturing environment and often see data that is relatively normally distributed, but is not necessarily randomly distributed.&amp;nbsp; &amp;nbsp;The Overall Sigma (standard deviation) is often larger than the Within Sigma (control chart sigma) with regard to process capability calculations.&amp;nbsp; This can occur for a variety of reasons like raw material lot switches and periodic instrument calibrations.&amp;nbsp; I am trying to evaluate some proposed control strategies, but I can't figure out how to accurately simulate my process.&amp;nbsp; If I just use Random Normal(), I don't get any of the autocorrelation I would usually see with the actual process data.&amp;nbsp; Any ideas how to simulate data where the stability index is not 1?&amp;nbsp; This is not a traditional time series problem where there is a predictable period to the data pattern.&amp;nbsp; Thank you all in advance for your assistance.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:54:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550875#M76700</guid>
      <dc:creator>gwenhallberg</dc:creator>
      <dc:date>2023-06-10T23:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550908#M76704</link>
      <description>&lt;P&gt;There is a function for this purpose:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="multivar normal.PNG" style="width: 921px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45912iF61855D8F5DD857E/image-size/large?v=v2&amp;amp;px=999" role="button" title="multivar normal.PNG" alt="multivar normal.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:23:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550908#M76704</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-09-29T18:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550920#M76707</link>
      <description>&lt;P&gt;Edit: I also misread and gave a suggestion for multi-correlation instead of autocorrelation. Woops!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't tried&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;'s suggestion, I think that might be an easier way to do the same thing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try using principal components, create random value for latent variables, then calculate your simulated variables based on those latent variables and add univariate error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1664554728405.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45936i0B8BA494DD343CF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1664554728405.png" alt="ih_0-1664554728405.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using this method you can even make data that is similar to your own process by finding your own loading, coefficients, variances, and errors, and then simulating data just like it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Example Correlated Data",
	Add Rows( 100 ),
	New Column( "Prin 1", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( Random Normal( 0, 1 ) )
	),
	New Column( "Prin 2", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( Random Normal Mixture( [-1, 2], [0.3, 0.6], [0.25, 0.75] ) )
	),
	New Column( "X1", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( :Prin 1 * 20 + :Prin 2 * 1 + 5 + Random Normal( 0, 3 ) )
	),
	New Column( "X2", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( :Prin 1 * 2 + :Prin 2 * 1 + 3 + Random Normal( 0, 2 ) )
	),
	New Column( "X3", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( :Prin 1 * -1 + :Prin 2 * 0.3 + 200 + Random Normal( 0, 0.2 ) )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 11:57:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/550920#M76707</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-10-03T11:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551278#M76719</link>
      <description>&lt;P&gt;Thanks very much,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;,&amp;nbsp;for the suggestion!&amp;nbsp; I'll give both this and Mark's idea a try.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 14:56:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551278#M76719</guid>
      <dc:creator>gwenhallberg</dc:creator>
      <dc:date>2022-09-30T14:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551311#M76721</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;for the suggestion.&amp;nbsp; This seems like it should be exactly what I need, but I'm afraid I'm having trouble figuring out how to properly implement it.&amp;nbsp; To start with, I would just like to generate one simulated column in a data table.&amp;nbsp; I know the mean, overall process standard deviation, within sigma (control chart sigma - which in this situation is based on the moving range), and the "Autocorrelation" value (from the summary statistics in the distribution platform).&amp;nbsp; I can also get a Correlation value for the process parameter against the Lag() of itself (by one row) from Fit Y by X - and I could repeat the correlation analysis for different row lags.&amp;nbsp; Any chance you could help me understand how I should structure the formula given the information I have (or let me know if I am just missing the boat entirely)?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:28:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551311#M76721</guid>
      <dc:creator>gwenhallberg</dc:creator>
      <dc:date>2022-09-30T15:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551341#M76724</link>
      <description>&lt;P&gt;After some investigation, some notes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is some noise added to the values, it seems to have a standard deviation near 1&lt;/LI&gt;
&lt;LI&gt;You need to define a mean vector and symmetric covariance matrix with the same dimensions as a mean vector.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Some examples:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Make a dataset from a mean vector, covariance matrix, and number of rows
Make Correlated Table = Function({mv, cm, nr, name = "Data Table"}, {dt},
	randmvnMat = Random Multivariate Normal( mv, cm, nr );
	dt = New Table( name );
	dt &amp;lt;&amp;lt; Set Matrix(randmvnMat);
	dt &amp;lt;&amp;lt; Scatterplot Matrix( Y( dt &amp;lt;&amp;lt; Get Column References ), Matrix Format( "Lower Triangular" ), Density Ellipses( 1 ) );
	dt
);

dt1 = Make Correlated Table(
	mv = [0 1 1 0],
	cv = [
		1 0 0 0, 
		0 1 0 0,
		0 0 1 0,
		0 0 0 1
	],
	nr = 100,
	name = "No Correlation"
);

dt2 = Make Correlated Table(
	mv = [0 10 20],
	cv = [
		1 1 0, 
		1 1 0, 
		0 0 1
	],
	nr = 20,
	name = "1-2 Correlated"
);

dt3 = Make Correlated Table(
	mv = [0 10 20],
	cv = [
		1 1 1, 
		1 1 1, 
		1 1 1
	],
	nr = 20,
	name = "1-2-3 Correlated"
);

dt4 = Make Correlated Table(
	mv = [0 10 20],
	cv = [
		 1.0  0.8 -0.5, 
		 0.8  1.0  0.0, 
		-0.5  0.0  1.0
	],
	nr = 20,
	name = "Some Correlation"
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:41:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551341#M76724</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-09-30T16:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551366#M76725</link>
      <description>&lt;P&gt;I apologize. I was wrong. You do not have multiple correlation (i.e., more than one variable). You have a time series. Let me look into it more.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 18:58:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551366#M76725</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-09-30T18:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551377#M76727</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;&amp;nbsp;- Your nifty script made it so I could understand how the Random Multivariate Normal() feature was intended to work.&amp;nbsp; This will be great to simulate multiple correlated factors - and is not something I was aware of before.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 19:20:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551377#M76727</guid>
      <dc:creator>gwenhallberg</dc:creator>
      <dc:date>2022-09-30T19:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551380#M76728</link>
      <description>&lt;P&gt;Thanks, Mark.&amp;nbsp; If it helps, at all - here is an example of the type of data I am trying to simulate.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Control Chart.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45939i80C73F096E60B4FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Control Chart.jpg" alt="Control Chart.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 19:29:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551380#M76728</guid>
      <dc:creator>gwenhallberg</dc:creator>
      <dc:date>2022-09-30T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551498#M76735</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt; pointed me to this post. And I looked at your data. It looks like your data can be adequately modeled by a so called AR(1) model, short for A&lt;SPAN class="ILfuVd"&gt;&lt;SPAN class="hgKElc"&gt;utoregressive of Order One. It is a type of time series model which describe a process with auto-correlation.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ILfuVd"&gt;&lt;SPAN class="hgKElc"&gt;For AR(1) model, simulating it by using JMP formula column can be done by the following steps:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ILfuVd"&gt;&lt;SPAN class="hgKElc"&gt;First, fit the AR(1) model and here is the report:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="peng_liu_1-1664571710232.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45948iD96F777A75BC664B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="peng_liu_1-1664571710232.png" alt="peng_liu_1-1664571710232.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I include the script in your original data and attach the updated data table.&lt;/P&gt;
&lt;P&gt;Next, create a formula column like the following. You need three numbers from the previous report: two parameter estimates, and standard deviation in Model Summary. And see how they are used in the formula.&lt;/P&gt;
&lt;P&gt;Now a little about this formula. First imagine how a JMP table evaluate the formula, it is row by row. So the formula says, if it is the first row, just simulate some number according to the sample, here looks like a random Normal(0,1) fits the bill. Then as the row number increases, the formula calculates new values recursively based upon the value from the previous row. This is what that subscript of Y does.&lt;/P&gt;
&lt;P&gt;I attach the finished product as well. Your original data table has three scripts. The simulated data table has three scripts. And you can compare their results to see how close the simulated data is to your original data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="peng_liu_0-1664571635803.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45947i8314A08FA618243A/image-size/large?v=v2&amp;amp;px=999" role="button" title="peng_liu_0-1664571635803.png" alt="peng_liu_0-1664571635803.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more word, if your data is more complicated, and AR(1) no longer suffices, you may need to go after more complicated time series models. By then, simulation is no longer an easy task. Fortunately, the Time Series platform has built-in simulation capabilities. Run the Time Series script in the attached tables, either yours, or the simulated. In the report, within Model Comparison, by the side of the model, click the red triangle, and select Generate Simulation, which will lead you to a dialog to simulate time series. The dialog should be mostly self-explained, so I am not going to elaborate.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="peng_liu_2-1664572304298.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45949i2C71083906D4B00E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="peng_liu_2-1664572304298.png" alt="peng_liu_2-1664572304298.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:16:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551498#M76735</guid>
      <dc:creator>peng_liu</dc:creator>
      <dc:date>2022-09-30T21:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate process data with some degree of autocorrelation?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551944#M76757</link>
      <description>&lt;P&gt;If you don't mind messing with JSL, then you can play the simulation game indefinitely. Please find attached a couple of old scripts that might give you some ideas. The first builds on the reply from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2781"&gt;@peng_liu&lt;/a&gt;&amp;nbsp;and allows you to simulate output from an AR(2) process and see how the estimated parameters match up with the model parameters used. Stating the obvious perhaps, but not every process can be usefully modelled as autoregressive no matter how many parameters are used. I always found &lt;A href="https://books.google.co.uk/books/about/Statistical_Control_by_Monitoring_and_Ad.html?id=9_iB25rb92gC&amp;amp;redir_esc=y" target="_self"&gt;the book by Box and Luceno&lt;/A&gt; very useful in the industrial context. The second script simulates what they call a 'sticky innovation process'.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 11:50:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-simulate-process-data-with-some-degree-of-autocorrelation/m-p/551944#M76757</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2022-10-03T11:50:29Z</dc:date>
    </item>
  </channel>
</rss>

