<?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 Creating a prediction interval with monte carlo simulation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/264931#M51608</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if anyone could help me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a set of data in two columns.&amp;nbsp; Column one contains a Run ID while Column 2 contains data generated by the run.&amp;nbsp; My end goal is to plot the 95% prediction interval of the confidence intervals produced by N, N-1, N-2, N-3... until you only have two datapoints per Run, where N = initial number of replicates.&amp;nbsp; Therefore step by step, If for example I had 40 replicates per run, I would like for JMP to randomly select 39 replicates for each run, conduct a lower 95% and upper 95% confidence interval for each Run, then conduct a lower 95% Prediction interval for the lower 95% confidence intervals of each run and a upper 95% prediction interval for the upper 95% confidence intervals of each run.&amp;nbsp; This would get repeated with 38 replicates, 37 replicates... until there is only 2 replicates.&amp;nbsp; I would like to graph on the x-axis the replicate number and plot both the upper 95% Preidiction interval and lower 95% prediction interval similar to what is shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HCK1977_0-1588795664027.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23788i2C3A75EDDCE384B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HCK1977_0-1588795664027.png" alt="HCK1977_0-1588795664027.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>Wed, 06 May 2020 20:08:04 GMT</pubDate>
    <dc:creator>HCK1977</dc:creator>
    <dc:date>2020-05-06T20:08:04Z</dc:date>
    <item>
      <title>Creating a prediction interval with monte carlo simulation</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/264931#M51608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if anyone could help me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a set of data in two columns.&amp;nbsp; Column one contains a Run ID while Column 2 contains data generated by the run.&amp;nbsp; My end goal is to plot the 95% prediction interval of the confidence intervals produced by N, N-1, N-2, N-3... until you only have two datapoints per Run, where N = initial number of replicates.&amp;nbsp; Therefore step by step, If for example I had 40 replicates per run, I would like for JMP to randomly select 39 replicates for each run, conduct a lower 95% and upper 95% confidence interval for each Run, then conduct a lower 95% Prediction interval for the lower 95% confidence intervals of each run and a upper 95% prediction interval for the upper 95% confidence intervals of each run.&amp;nbsp; This would get repeated with 38 replicates, 37 replicates... until there is only 2 replicates.&amp;nbsp; I would like to graph on the x-axis the replicate number and plot both the upper 95% Preidiction interval and lower 95% prediction interval similar to what is shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HCK1977_0-1588795664027.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/23788i2C3A75EDDCE384B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HCK1977_0-1588795664027.png" alt="HCK1977_0-1588795664027.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>Wed, 06 May 2020 20:08:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/264931#M51608</guid>
      <dc:creator>HCK1977</dc:creator>
      <dc:date>2020-05-06T20:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a prediction interval with monte carlo simulation</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/267654#M52114</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I believe I have an answer for you.&amp;nbsp; It makes use of the &lt;A href="https://www.jmp.com/support/help/en/15.1/?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#page/jmp/bootstrapping.shtml" target="_self"&gt;Bootstrapping functionality in JMP Pro&lt;/A&gt;,&amp;nbsp;and for that reason will only work with JMP Pro.&amp;nbsp; Please take a look and let me know if it does what you are after.&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dist=dt&amp;lt;&amp;lt;Distribution(Y(:Weight));//Create Distribution report of column "Weight""

//JMP PRO REQUIRED FOR NEXT STEP
boot_dt=(dist &amp;lt;&amp;lt; Report)[TableBox( 2 )] &amp;lt;&amp;lt; Bootstrap(
	40,
	Fractional Weights( 1 ),
	Split Selected Column( 1 )
);//Bootstrap 40 samples of Summary Statistics

boot_dist=boot_dt[2]&amp;lt;&amp;lt;Distribution(Y(Column(3)));//Create Distribution of Bootstrap samples for whichever statistic ends up in Column 3 - "Lower 95% Mean"" in our case. 

	lowCL = {};//container for lower confidence limits
	upCL = {};//container for upper confidence limits
	nsims = {};	//container for number of simulations - for x-axis of GB report
	
	lowCL[1] = Report( boot_dist )["Bootstrap Confidence Limits"][Number Col Box( 2 )][1];//lower a=0.05 limit
	upCL[1] = Report( boot_dist )["Bootstrap Confidence Limits"][Number Col Box( 3 )][1];//upper a=0.05 limit
	boot_dist &amp;lt;&amp;lt; Close Window;
	
	nsims[1] = N Rows( boot_dt[2] ) - 1;//Estimates were taken using all rows of table, except the first.
	
//	dist &amp;lt;&amp;lt; Close Window;
	
	For( i = 2, i &amp;lt;= N Rows( boot_dt[2] ) - 2, i++, //Create distribution reports after excluding rows one-at-a-time, save values in lowCL, upCL and nsims containers.
	
		boot_dt[2] &amp;lt;&amp;lt; Select Where( Row() == i );
		boot_dt[2] &amp;lt;&amp;lt; Exclude;
	
		boot_dist=boot_dt[2]&amp;lt;&amp;lt;Distribution(Y(Column(3)));
		lowCL[i] = Report( boot_dist )["Bootstrap Confidence Limits"][Number Col Box( 2 )][1];//lower a=0.05 limit
		upCL[i] =  Report( boot_dist )["Bootstrap Confidence Limits"][Number Col Box( 3 )][1];//upper a=0.05 limit
		boot_dist &amp;lt;&amp;lt; Close Window;
	
		nsims[i] = N Rows( boot_dt[2]) - i;
	);//end of For-loop, containers now have values for each row.
	
	

	
	graphdt = New Table(); //create new table to generate GB report
	lowCLcolumn = graphdt &amp;lt;&amp;lt; New Column( "Lower Confidence limit" );	//column of lower confidence limits
	graphdt &amp;lt;&amp;lt; add Rows( N Items( lowCL ) ); //add rows 
	lowCLcolumn &amp;lt;&amp;lt; Set Values( lowCL ); // set values from lowCL into column
	
	upCLcolumn = graphdt &amp;lt;&amp;lt; New Column( "Upper Confidence limit" );	//column of upper confidence limits
	upCLcolumn &amp;lt;&amp;lt; Set Values( upCL );//set values from upCL into column
	
	Nsimscol = graphdt &amp;lt;&amp;lt; New Column( "N" );	//column of number of rows in simulated estimates table that were not exlcuded (x-axis of GB report)
	Nsimscol &amp;lt;&amp;lt; Set Values( nsims ); // set values from nsims into column
	
	//create GB report
	gb = graphdt &amp;lt;&amp;lt; Graph Builder(
		Size( 531, 456 ),
		Show Control Panel( 0 ),
		Variables( X( :N ), Y( :Lower Confidence limit ), Y( :Upper Confidence limit, Position( 1 ) ) ),
		Elements( Line( X, Y( 1 ), Y( 2 ), Legend( 7 ) ) )
	);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 11:52:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/267654#M52114</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2020-05-19T11:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a prediction interval with monte carlo simulation</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/267655#M52115</link>
      <description>&lt;P&gt;By the way, this solution makes use of bits of a script from an &lt;A href="https://community.jmp.com/t5/Discovery-Summit-Munich-2020/Determining-Confidence-Limits-for-Linear-Combinations-of/ta-p/243885" target="_self"&gt;add-in presented at the JMP Discovery Summit Europe 2020&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 11:54:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-prediction-interval-with-monte-carlo-simulation/m-p/267655#M52115</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2020-05-19T11:54:52Z</dc:date>
    </item>
  </channel>
</rss>

