BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
galactus3000

Community Trekker

Joined:

Nov 9, 2016

how do I access likelihood distributions for Life Distributions?

I would like to gain access to likelihood distributions for reliability life distributions, for example defective subpopulation weibull.  specifically I would like to run a monte carlo on a function of the distribution parameters alpha, beta and p.  Thanks in advance.

2 REPLIES 2
cwillden

Super User

Joined:

May 1, 2017

Re: how do I access likelihood distributions for Life Distributions?

Are you talking about accessing these values through JSL?LifeDist.PNG

 

 

If so, here's a script that will show you an example of how to extract those values:

//Create Data Table with random lognormal data
dt = New Table("Example Data");
dt << New Column("X",formula(random log normal()));
dt << Add Rows(300);

//Expression to fit Life Distribution with Log Normal fit & get parameter estimates
fit_and_get = Expr(
	LD = dt << Life Distribution(
		Y( :X ),
		<<Fit Lognormal,
		Confidence Interval Method( Wald ),
		<<Set Scale( Lognormal ),
		<<Suppress Plot( Nonparametric ),
		Interval Type( Simultaneous ),
		Show Event Plot Frequency Label( 0 ),
		<<Set Scriptables(
			{Probability Paper(
				Profiler(
					1,
					Confidence Intervals( 1 ),
					Term Value( X( 6.97984876476196, Lock( 0 ), Show( 1 ) ) )
				)
			), Lognormal Distribution(
				Profiler(
					1,
					Confidence Intervals( 1 ),
					Term Value( X( 6.98, Lock( 0 ), Show( 1 ) ) )
				)
			), Lognormal Quantile(
				Profiler(
					1,
					Confidence Intervals( 1 ),
					Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) )
				)
			), Lognormal Hazard(
				Profiler(
					1,
					Confidence Intervals( 1 ),
					Term Value( X( 6.98, Lock( 0 ), Show( 1 ) ) )
				)
			), Lognormal Density(
				Profiler(
					1,
					Confidence Intervals( 0 ),
					Term Value( X( 6.98, Lock( 0 ), Show( 1 ) ) )
				)
			), Custom Estimation( Lognormal, 0 )}
		),
		SendToReport(
			Dispatch(
				{"Compare Distributions"},
				"Life Distribution",
				FrameBox,
				{Grid Line Order( 2 ), Reference Line Order( 3 )}
			),
			Dispatch(
				{"Compare Distributions"},
				"Distribution Profiler",
				OutlineBox,
				{Set Summary Behavior( "Collapse" )}
			),
			Dispatch(
				{"Statistics"},
				"",
				ListBox,
				{Set Summary Behavior( "Collapse" )}
			)
		),
		Invisible
	);
	rprt_win = LD << Report; //get reference to window containing Life Distribution report
	params = rprt_win["Parametric Estimate - Lognormal"][TableBox(1)][Number Col Box(1)] << Get as Matrix; //navigate to number col box with parameter estimates & get the values
	likelihood = (rprt_win["Parametric Estimate - Lognormal"][TableBox(2)][Number Col Box(1)] << Get as Matrix)[1]; //get -2*likelihood
	rprt_win << Close Window;
);

//Sim 5 data sets and output values
for(i = 1, i<=5, i++,
	dt:X << Eval Formula;
	fit_and_get();
	Show(params, likelihood);
);

If you run it and look at the log, you'll see 5 different sets of parameter estimates and loglikelihood values

-- Cameron Willden
markbailey

Staff

Joined:

Jun 23, 2011

Re: how do I access likelihood distributions for Life Distributions?

If you want to access the distribution functions for the purpose of a simulation, see Help > Scripting Index > Functions > Probability. The PDF, CDF, and ICDF are available for the common reliability life distribution models.

Learn it once, use it forever!