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%E4%BD%BF%E7%94%A8%E8%92%99%E7%89%B9%E5%8D%A1%E6%B4%9B%E6%A8%A1%E6%93%AC%E5%89%B5%E5%BB%BA%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-264931%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E6%98%AF%E5%90%A6%E6%9C%89%E4%BA%BA%E5%8F%AF%E4%BB%A5%E5%B9%AB%E5%8A%A9%E6%88%91%E3%80%82%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%E5%85%A9%E5%88%97%E4%B8%AD%E6%9C%89%E4%B8%80%E7%B5%84%E6%95%B8%E6%93%9A%E3%80%82%26nbsp%3B%20%E7%AC%AC%E4%B8%80%E5%88%97%E5%8C%85%E5%90%AB%E9%81%8B%E8%A1%8CID%EF%BC%8C%E8%80%8C%E7%AC%AC%E4%BA%8C%E5%88%97%E5%8C%85%E5%90%AB%E9%81%8B%E8%A1%8C%E7%94%9F%E6%88%90%E7%9A%84%E6%95%B8%E6%93%9A%E3%80%82%26nbsp%3B%20%E6%88%91%E7%9A%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E6%AF%8F%E6%AC%A1%E9%81%8B%E8%A1%8C%E7%9A%84%E8%BC%83%E4%BD%8E95%EF%BC%85%E7%BD%AE%E4%BF%A1%E5%8D%80%E9%96%93%E7%9A%84%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%E5%92%8C%E6%AF%8F%E6%AC%A1%E9%81%8B%E8%A1%8C%E7%9A%84%E8%BC%83%E9%AB%9895%EF%BC%85%E7%BD%AE%E4%BF%A1%E5%8D%80%E9%96%93%E7%9A%84%E8%BC%83%E9%AB%9895%EF%BC%85%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%E3%80%82%26nbsp%3B%20%E9%87%8D%E8%A4%8738%E6%AC%A1%EF%BC%8C%E9%87%8D%E8%A4%8737%E6%AC%A1...%20%E7%9B%B4%E5%88%B0%E5%8F%AA%E6%9C%892%E5%80%8B%E9%87%8D%E8%A4%87%E3%80%82%26nbsp%3B%20%E6%88%91%E6%83%B3%E5%9C%A8x%E8%BB%B8%E4%B8%8A%E7%B9%AA%E8%A3%BD%E9%87%8D%E8%A4%87%E6%AC%A1%E6%95%B8%EF%BC%8C%E4%B8%A6%E7%B9%AA%E8%A3%BD%E8%BC%83%E9%AB%98%E7%9A%8495%EF%BC%85%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%E5%92%8C%E8%BC%83%E4%BD%8E%E7%9A%8495%EF%BC%85%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%EF%BC%8C%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%EF%BC%9A%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%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BD%BF%E7%94%A8%E8%92%99%E7%89%B9%E5%8D%A1%E6%B4%9B%E6%A8%A1%E6%93%AC%E5%89%B5%E5%BB%BA%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%E6%88%91%E7%9B%B8%E4%BF%A1%E6%88%91%E6%9C%89%E4%B8%80%E5%80%8B%E7%AD%94%E6%A1%88%E3%80%82%26nbsp%3B%20%E5%AE%83%E5%88%A9%E7%94%A8%E4%BA%86%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%E4%B8%AD%E7%9A%84%E5%BC%95%E5%B0%8E%E5%8A%9F%E8%83%BD%3C%2FA%3E%20%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%83%85%E9%81%A9%E7%94%A8%E6%96%BCJMP%20Pro%E3%80%82%26nbsp%3B%20%E8%AB%8B%E7%9C%8B%E4%B8%80%E7%9C%8B%EF%BC%8C%E8%AE%93%E6%88%91%E7%9F%A5%E9%81%93%E5%AE%83%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E6%BB%BF%E8%B6%B3%E6%82%A8%E7%9A%84%E8%A6%81%E6%B1%82%E3%80%82%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%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BD%BF%E7%94%A8%E8%92%99%E7%89%B9%E5%8D%A1%E6%B4%9B%E6%A8%A1%E6%93%AC%E5%89%B5%E5%BB%BA%E9%A0%90%E6%B8%AC%E9%96%93%E9%9A%94%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267655%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E9%A0%86%E4%BE%BF%E8%AA%AA%E4%B8%80%E5%8F%A5%EF%BC%8C%E6%AD%A4%E8%A7%A3%E6%B1%BA%E6%96%B9%E6%A1%88%E5%88%A9%E7%94%A8%E4%BA%86%E4%BE%86%E8%87%AA%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%E5%9C%A82020%E5%B9%B4%E6%AD%90%E6%B4%B2JMP%E7%99%BC%E7%8F%BE%E5%B3%B0%E6%9C%83%E4%B8%8A%E5%B1%95%E7%A4%BA%E7%9A%84%E6%8F%92%E4%BB%B6%3C%2FA%3E%20%E3%80%82%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