Lindo Systems
! Graphing of Univariate functions in LINGO,
Normal distribution vs. Student t (ChartPdfNormVsStudT);
! Keywords: @CHARTPCURVE, Chart, @FORMAT, Function, Graph, LINGO,
Normal curve, Procedure, Student t distribution, Univariate;
PROCEDURE PDFcompute:
y1 = @PNORMPDF( 0, sigma, x);
y2 = @PSTUTPDF( df, x);
ENDPROCEDURE
calc:
sigma = 1.2; ! Standard deviation for the Normal distribution;
df = 2; ! Degrees of freedom for the Student t distribution;
LB = -5; ! Lower bound for x;
UB = 5; ! Upper bound for x;
@CHARTPCURVE(
'Sample PDF Curve Chart', ! Chart title;
'x', ! Title for X axis;
'Frequency', ! Title for Y axis;
PDFcompute, ! Name of function procedure;
x, LB, UB, ! X variable, LB and UB;
! Title for curves, output variables;
'y = Normal( 0, '+@format(sigma,'3.1f')+')', y1,
'y = Student t, df= '+@format(df,'3.1f'), y2);
endcalc