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%3ECr%C3%A9ation%20d'un%20intervalle%20de%20pr%C3%A9diction%20avec%20la%20simulation%20de%20Monte%20Carlo%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-264931%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJe%20me%20demandais%20si%20quelqu'un%20pouvait%20m'aider.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJ'ai%20un%20ensemble%20de%20donn%C3%A9es%20dans%20deux%20colonnes.%26nbsp%3B%20La%20colonne%201%20contient%20un%20ID%20d'ex%C3%A9cution%20tandis%20que%20la%20colonne%202%20contient%20les%20donn%C3%A9es%20g%C3%A9n%C3%A9r%C3%A9es%20par%20l'analyse.%26nbsp%3B%20Mon%20objectif%20final%20est%20de%20tracer%20l'intervalle%20de%20pr%C3%A9diction%20%C3%A0%2095%25%20des%20intervalles%20de%20confiance%20produits%20par%20N%2C%20N-1%2C%20N-2%2C%20N-3%20...%20jusqu'%C3%A0%20ce%20que%20vous%20n'ayez%20que%20deux%20points%20de%20donn%C3%A9es%20par%20ex%C3%A9cution%2C%20o%C3%B9%20N%20%3D%20nombre%20initial%20de%20r%C3%A9pliques.%26nbsp%3B%20Par%20cons%C3%A9quent%2C%20%C3%A9tape%20par%20%C3%A9tape%2C%20si%2C%20par%20exemple%2C%20j'avais%2040%20r%C3%A9pliques%20par%20cycle%2C%20j'aimerais%20que%20JMP%20s%C3%A9lectionne%20au%20hasard%2039%20r%C3%A9pliques%20pour%20chaque%20cycle%2C%20effectue%20un%20intervalle%20de%20confiance%20inf%C3%A9rieur%20%C3%A0%2095%25%20et%20sup%C3%A9rieur%20%C3%A0%2095%25%20pour%20chaque%20cycle%2C%20puis%20effectue%20un%20taux%20inf%C3%A9rieur%20%C3%A0%2095%25%20Intervalle%20de%20pr%C3%A9diction%20pour%20les%20intervalles%20de%20confiance%20inf%C3%A9rieurs%20%C3%A0%2095%25%20de%20chaque%20analyse%20et%20intervalle%20de%20pr%C3%A9diction%20sup%C3%A9rieur%20%C3%A0%2095%25%20pour%20les%20intervalles%20de%20confiance%20sup%C3%A9rieurs%20%C3%A0%2095%25%20de%20chaque%20analyse.%26nbsp%3B%20Cela%20se%20r%C3%A9p%C3%A9terait%20avec%2038%20r%C3%A9p%C3%A9titions%2C%2037%20r%C3%A9p%C3%A9titions%20...%20jusqu'%C3%A0%20ce%20qu'il%20n'y%20ait%20que%202%20r%C3%A9pliques.%26nbsp%3B%20Je%20voudrais%20repr%C3%A9senter%20graphiquement%20sur%20l'axe%20des%20x%20le%20nombre%20de%20r%C3%A9pliques%20et%20tracer%20%C3%A0%20la%20fois%20l'intervalle%20de%20pr%C3%A9diction%20sup%C3%A9rieur%20%C3%A0%2095%25%20et%20l'intervalle%20de%20pr%C3%A9diction%20inf%C3%A9rieur%20%C3%A0%2095%25%20similaire%20%C3%A0%20ce%20qui%20est%20illustr%C3%A9%20ci-dessous%3A%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%3ERe%3A%20Cr%C3%A9er%20un%20intervalle%20de%20pr%C3%A9diction%20avec%20la%20simulation%20de%20Monte%20Carlo%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3EJe%20crois%20que%20j'ai%20une%20r%C3%A9ponse%20pour%20vous.%26nbsp%3B%20Il%20utilise%20le%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%20Fonctionnalit%C3%A9%20d'amor%C3%A7age%20dans%20JMP%20Pro%20%3C%2FA%3E%20%2C%20et%20pour%20cette%20raison%2C%20ne%20fonctionnera%20qu'avec%20JMP%20Pro.%26nbsp%3B%20Veuillez%20jeter%20un%20coup%20d'%C5%93il%20et%20faites-moi%20savoir%20si%20cela%20fait%20ce%20que%20vous%20recherchez.%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%3ERe%3A%20Cr%C3%A9er%20un%20intervalle%20de%20pr%C3%A9diction%20avec%20la%20simulation%20de%20Monte%20Carlo%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-267655%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESoit%20dit%20en%20passant%2C%20cette%20solution%20utilise%20des%20bits%20d'un%20script%20%C3%A0%20partir%20d'un%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%20compl%C3%A9ment%20pr%C3%A9sent%C3%A9%20au%20JMP%20Discovery%20Summit%20Europe%202020%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