cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-264931%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%EB%AA%AC%ED%85%8C%EC%B9%B4%EB%A5%BC%EB%A1%9C%20%EC%8B%9C%EB%AE%AC%EB%A0%88%EC%9D%B4%EC%85%98%EC%9C%BC%EB%A1%9C%20%EC%98%88%EC%B8%A1%20%EA%B5%AC%EA%B0%84%20%EB%A7%8C%EB%93%A4%EA%B8%B0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-264931%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EC%95%88%EB%85%95%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%EB%88%84%EA%B5%B0%EA%B0%80%20%EB%82%98%EB%A5%BC%20%EB%8F%84%EC%9A%B8%20%EC%88%98%20%EC%9E%88%EB%8A%94%EC%A7%80%20%EA%B6%81%EA%B8%88%ED%95%A9%EB%8B%88%EB%8B%A4.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%EB%91%90%20%EC%97%B4%EC%97%90%20%EB%8D%B0%EC%9D%B4%ED%84%B0%20%EC%84%B8%ED%8A%B8%EA%B0%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%26nbsp%3B%20%EC%97%B4%201%EC%97%90%EB%8A%94%20%EC%8B%A4%ED%96%89%20ID%EA%B0%80%20%EC%9E%88%EA%B3%A0%20%EC%97%B4%202%EC%97%90%EB%8A%94%20%EC%8B%A4%ED%96%89%EC%97%90%EC%84%9C%20%EC%83%9D%EC%84%B1%20%EB%90%9C%20%EB%8D%B0%EC%9D%B4%ED%84%B0%EA%B0%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%26nbsp%3B%20%EB%82%B4%20%EC%B5%9C%EC%A2%85%20%EB%AA%A9%ED%91%9C%EB%8A%94%20N%2C%20N-1%2C%20N-2%2C%20N-3%EC%97%90%20%EC%9D%98%ED%95%B4%20%EC%83%9D%EC%84%B1%20%EB%90%9C%20%EC%8B%A0%EB%A2%B0%20%EA%B5%AC%EA%B0%84%EC%9D%98%2095%20%25%20%EC%98%88%EC%B8%A1%20%EA%B0%84%EA%B2%A9%EC%9D%84%20%EA%B7%B8%EB%A6%AC%EB%8A%94%20%EA%B2%83%EC%9E%85%EB%8B%88%EB%8B%A4%20...%20%EC%8B%A4%ED%96%89%20%EB%8B%B9%20%EB%91%90%20%EA%B0%9C%EC%9D%98%20%EB%8D%B0%EC%9D%B4%ED%84%B0%20%ED%8F%AC%EC%9D%B8%ED%8A%B8%20%EB%A7%8C%EC%9E%88%EC%9D%84%20%EB%95%8C%EA%B9%8C%EC%A7%80%20N%20%3D%20%EC%B4%88%EA%B8%B0%20%EB%B3%B5%EC%A0%9C%20%EC%88%98.%26nbsp%3B%20%EB%94%B0%EB%9D%BC%EC%84%9C%20%EB%8B%A8%EA%B3%84%EB%B3%84%EB%A1%9C%2C%20%EC%98%88%EB%A5%BC%20%EB%93%A4%EC%96%B4%20%EC%8B%A4%ED%96%89%20%EB%8B%B9%2040%20%EA%B0%9C%EC%9D%98%20%EB%B0%98%EB%B3%B5%20%EC%8B%A4%ED%97%98%EC%9D%B4%EC%9E%88%EB%8A%94%20%EA%B2%BD%EC%9A%B0%20JMP%EC%97%90%EC%84%9C%20%EA%B0%81%20%EC%8B%A4%ED%96%89%EC%97%90%20%EB%8C%80%ED%95%B4%2039%20%EA%B0%9C%EC%9D%98%20%EB%B0%98%EB%B3%B5%20%EC%8B%A4%ED%97%98%EC%9D%84%20%EB%AC%B4%EC%9E%91%EC%9C%84%EB%A1%9C%20%EC%84%A0%ED%83%9D%ED%95%98%EA%B3%A0%20%EA%B0%81%20%EC%8B%A4%ED%96%89%EC%97%90%20%EB%8C%80%ED%95%B4%2095%20%25%20%EB%AF%B8%EB%A7%8C%EC%9D%98%20%EC%8B%A0%EB%A2%B0%20%EA%B5%AC%EA%B0%84%EA%B3%BC%2095%20%25%20%EC%9D%B4%EC%83%81%EC%9D%98%20%EC%8B%A0%EB%A2%B0%20%EA%B5%AC%EA%B0%84%EC%9D%84%20%EC%88%98%ED%96%89%20%ED%95%9C%20%EB%8B%A4%EC%9D%8C%2095%20%25%20%EB%AF%B8%EB%A7%8C%EC%9C%BC%EB%A1%9C%20%EC%88%98%ED%96%89%ED%95%98%EA%B3%A0%20%EC%8B%B6%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EA%B0%81%20%EC%8B%A4%ED%96%89%EC%9D%98%20%ED%95%98%EC%9C%84%2095%20%25%20%EC%8B%A0%EB%A2%B0%20%EA%B5%AC%EA%B0%84%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%98%88%EC%B8%A1%20%EA%B5%AC%EA%B0%84%20%EB%B0%8F%20%EA%B0%81%20%EC%8B%A4%ED%96%89%EC%9D%98%20%EC%83%81%EC%9C%84%2095%20%25%20%EC%8B%A0%EB%A2%B0%20%EA%B5%AC%EA%B0%84%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%83%81%EC%9C%84%2095%20%25%20%EC%98%88%EC%B8%A1%20%EA%B5%AC%EA%B0%84%EC%9E%85%EB%8B%88%EB%8B%A4.%26nbsp%3B%20%EC%9D%B4%EA%B2%83%EC%9D%80%2038%20%ED%9A%8C%20%EB%B0%98%EB%B3%B5%2C%2037%20%ED%9A%8C%20%EB%B0%98%EB%B3%B5%EC%9C%BC%EB%A1%9C%20%EB%B0%98%EB%B3%B5%EB%90%A9%EB%8B%88%EB%8B%A4%20...%20%EB%B3%B5%EC%A0%9C%EA%B0%80%202%20%EA%B0%9C%EB%A7%8C%20%EB%90%A0%20%EB%95%8C%EA%B9%8C%EC%A7%80%26nbsp%3B%20x%20%EC%B6%95%EC%97%90%20%EB%B3%B5%EC%A0%9C%20%EB%B2%88%ED%98%B8%EB%A5%BC%20%EA%B7%B8%EB%9E%98%ED%94%84%EB%A1%9C%20%ED%91%9C%EC%8B%9C%ED%95%98%EA%B3%A0%20%EC%95%84%EB%9E%98%20%ED%91%9C%EC%8B%9C%EB%90%9C%20%EA%B2%83%EA%B3%BC%20%EC%9C%A0%EC%82%AC%ED%95%98%EA%B2%8C%20%EC%83%81%EC%9C%84%2095%20%25%20%EC%98%88%EC%B8%A1%20%EA%B0%84%EA%B2%A9%EA%B3%BC%20%ED%95%98%EC%9C%84%2095%20%25%20%EC%98%88%EC%B8%A1%20%EA%B0%84%EA%B2%A9%EC%9D%84%20%EB%AA%A8%EB%91%90%20%ED%94%8C%EB%A1%AF%ED%95%98%EA%B3%A0%20%EC%8B%B6%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HCK1977_0-1588795664027.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22HCK1977_0-1588795664027.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F23788i2C3A75EDDCE384B0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22HCK1977_0-1588795664027.png%22%20alt%3D%22HCK1977_0-1588795664027.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-267654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%EB%8B%A4%EC%8B%9C%20%3A%20%EB%AA%AC%ED%85%8C%20%EC%B9%B4%EB%A5%BC%EB%A1%9C%20%EC%8B%9C%EB%AE%AC%EB%A0%88%EC%9D%B4%EC%85%98%EC%9C%BC%EB%A1%9C%20%EC%98%88%EC%B8%A1%20%EA%B0%84%EA%B2%A9%20%EB%A7%8C%EB%93%A4%EA%B8%B0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EC%95%88%EB%85%95%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%EB%82%98%EB%8A%94%20%EB%8B%B9%EC%8B%A0%EC%97%90%EA%B2%8C%20%EB%8C%80%EB%8B%B5%EC%9D%B4%20%EC%9E%88%EB%8B%A4%EA%B3%A0%20%EC%83%9D%EA%B0%81%ED%95%A9%EB%8B%88%EB%8B%A4.%26nbsp%3B%20%EC%82%AC%EC%9A%A9%ED%95%A9%EB%8B%88%EB%8B%A4%20%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F15.1%2F%3Fos%3Dwin%26amp%3Bsource%3Dapplication%26amp%3Butm_source%3Dhelpmenu%26amp%3Butm_medium%3Dapplication%23page%2Fjmp%2Fbootstrapping.shtml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%20JMP%20Pro%EC%9D%98%20%EB%B6%80%ED%8A%B8%20%EC%8A%A4%ED%8A%B8%EB%9E%A9%20%EA%B8%B0%EB%8A%A5%20%3C%2FA%3E%20%EA%B7%B8%EB%9F%B0%20%EC%9D%B4%EC%9C%A0%EB%A1%9C%20JMP%20Pro%EC%97%90%EC%84%9C%EB%A7%8C%20%EC%9E%91%EB%8F%99%ED%95%A9%EB%8B%88%EB%8B%A4.%26nbsp%3B%20%ED%95%9C%20%EB%B2%88%20%EC%82%B4%ED%8E%B4%EB%B3%B4%EA%B3%A0%20%EA%B7%B8%20%ED%9B%84%EC%97%90%20%EB%AC%B4%EC%97%87%EC%9D%84%ED%95%98%EB%8A%94%EC%A7%80%20%EC%95%8C%EB%A0%A4%EC%A3%BC%EC%8B%AD%EC%8B%9C%EC%98%A4.%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adist%3Ddt%26lt%3B%3CDISTRIBUTION%3E%3C%2FDISTRIBUTION%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-267655%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%EB%8B%A4%EC%8B%9C%20%3A%20%EB%AA%AC%ED%85%8C%20%EC%B9%B4%EB%A5%BC%EB%A1%9C%20%EC%8B%9C%EB%AE%AC%EB%A0%88%EC%9D%B4%EC%85%98%EC%9C%BC%EB%A1%9C%20%EC%98%88%EC%B8%A1%20%EA%B0%84%EA%B2%A9%20%EB%A7%8C%EB%93%A4%EA%B8%B0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267655%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%EA%B7%B8%EA%B1%B4%20%EA%B7%B8%EB%A0%87%EA%B3%A0%2C%EC%9D%B4%20%EC%86%94%EB%A3%A8%EC%85%98%EC%9D%80%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%9D%98%20%EB%B9%84%ED%8A%B8%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%A9%EB%8B%88%EB%8B%A4.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscovery-Summit-Munich-2020%2FDetermining-Confidence-Limits-for-Linear-Combinations-of%2Fta-p%2F243885%22%20target%3D%22_self%22%3E%20JMP%20Discovery%20Summit%20Europe%202020%EC%97%90%EC%84%9C%20%EC%B6%94%EA%B0%80%20%EA%B8%B0%EB%8A%A5%20%EC%A0%9C%EA%B3%B5%20%3C%2FA%3E%20.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
HCK1977
Level I

Creating a prediction interval with monte carlo simulation

Hi,

 

I was wondering if anyone could help me.  

 

I have a set of data in two columns.  Column one contains a Run ID while Column 2 contains data generated by the run.  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.  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.  This would get repeated with 38 replicates, 37 replicates... until there is only 2 replicates.  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:

HCK1977_0-1588795664027.png

 

 

 

2 REPLIES 2

Re: Creating a prediction interval with monte carlo simulation

Hi,

 

I believe I have an answer for you.  It makes use of the Bootstrapping functionality in JMP Pro, and for that reason will only work with JMP Pro.  Please take a look and let me know if it does what you are after.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dist=dt<<Distribution(Y(:Weight));//Create Distribution report of column "Weight""

//JMP PRO REQUIRED FOR NEXT STEP
boot_dt=(dist << Report)[TableBox( 2 )] << Bootstrap(
	40,
	Fractional Weights( 1 ),
	Split Selected Column( 1 )
);//Bootstrap 40 samples of Summary Statistics

boot_dist=boot_dt[2]<<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 << Close Window;
	
	nsims[1] = N Rows( boot_dt[2] ) - 1;//Estimates were taken using all rows of table, except the first.
	
//	dist << Close Window;
	
	For( i = 2, i <= 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] << Select Where( Row() == i );
		boot_dt[2] << Exclude;
	
		boot_dist=boot_dt[2]<<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 << 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 << New Column( "Lower Confidence limit" );	//column of lower confidence limits
	graphdt << add Rows( N Items( lowCL ) ); //add rows 
	lowCLcolumn << Set Values( lowCL ); // set values from lowCL into column
	
	upCLcolumn = graphdt << New Column( "Upper Confidence limit" );	//column of upper confidence limits
	upCLcolumn << Set Values( upCL );//set values from upCL into column
	
	Nsimscol = graphdt << New Column( "N" );	//column of number of rows in simulated estimates table that were not exlcuded (x-axis of GB report)
	Nsimscol << Set Values( nsims ); // set values from nsims into column
	
	//create GB report
	gb = graphdt << 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 ) ) )
	);

Re: Creating a prediction interval with monte carlo simulation

By the way, this solution makes use of bits of a script from an add-in presented at the JMP Discovery Summit Europe 2020.

Recommended Articles