Реферат: Теорія імовірностей та математична статистика
s1:=t;
s2:=xi[i];
s3:=xi[i]+sx;
Memo1.lines[i]:=s1 + ', ' + s2 + '=<x<' + s3;
end;
s2:=xi[r-1];
Memo1.lines[r]:='1, x>=' + s2;
{serednie}
tx:=0;
for i:=1 to n do
tx:=tx+p[i];
ser:=tx/n;t:=ser;
Edit15.text:=t;
{Deviacia}
tx:=0;
for i:=1 to n do
tx:=tx+(p[i]-ser)*(p[i]-ser);
t:=tx;
Edit8.Text:=t;
{Variansa}
if n<>1 then dx:=tx/(n-1);t:=dx;
Edit9.Text:=t;
{momenty}
for i:=1 to n do {1}
dx:=dx+p[i]-ser;
dx:=dx/n;
t:=dx;
Edit7.Text:=t;
tx:=tx/n;t:=tx; {2}
Edit12.Text:=t;
dx:=0;
for i:=1 to n do {3}
dx:=dx+(p[i]-ser)*(p[i]-ser)*(p[i]-ser);
dx:=dx/n;
t:=dx;
Edit13.Text:=t;
{Assymetrija}
if tx<>0 then dx:=dx/(sqrt(tx)*sqrt(tx)*sqrt(tx));
t:=dx;
Edit10.Text:=t;
dx:=0;
for i:=1 to n do {4}
dx:=dx+(p[i]-ser)*(p[i]-ser)*(p[i]-ser)*(p[i]-ser);
dx:=dx/n;
t:=dx;
Edit14.Text:=t;
{Eksces}
dx:=dx/(tx*tx)-3;
t:=tx;
Edit11.Text:=t;
s:=ser;
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
Form3.ShowModal;
end;
end.
unit Unit3;
interface
uses main, unit2,
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, graphsv3;
type
TForm3 = class(TForm)
Graph1: TGraph;
Graph2: TGraph;
Graph3: TGraph;
Graph4: TGraph;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.DFM}
procedure TForm3.FormActivate(Sender: TObject);
var i,j:integer;dx:double;nxi,fi:variant;
begin
dx:=sx;
sx:=0;
if typ=true then begin
Graph1.RandomData:=0;
Graph1.GraphTitle:='Гістограма';
Graph1.GraphType:=3;
Graph1.NumPoints:=m;
for i:=1 to m do begin
Graph1.Data[i]:=ni[i];
Graph1.XPosData:=xi[i];
end;
Graph2.RandomData:=0;
Graph2.GraphTitle:='Полігон';
Graph2.GraphType:=6;
Graph2.NumPoints:=m;
for i:=1 to m do begin
Graph2.Data[i]:=ni[i];
Graph2.XPosData:=xi[i];
end;
Graph3.RandomData:=0;
Graph3.GraphTitle:='Діаграма';
Graph3.GraphType:=6;
Graph3.GraphStyle:=2;
Graph3.NumPoints:=m;
for i:=1 to m do begin
Graph3.XPosData:=xi[i];
Graph3.Data[i]:=ni[i];
end;
Graph4.RandomData:=0;
Graph4.GraphTitle:='Функція розподілу';
Graph4.GraphType:=6;
Graph4.NumPoints:=2*m+2;
fi := VarArrayCreate([0,2*m+2], varDouble);
nxi := VarArrayCreate([0,2*m+2], varDouble);
for i:=1 to m do begin
sx:=wi[i]+sx;
fi[2*i]:=sx-wi[i];
fi[2*i+1]:=sx;
nxi[2*i]:=xi[i];
nxi[2*i+1]:=xi[i];
end;
fi[2*m+2]:=1;
nxi[1]:=xi[1]-s;
nxi[2*m+2]:=xi[m]+s;
j:=0;
for i:=1 to 2*m+2 do begin
Graph4.Data[i]:=fi[i];
Graph4.XPosData:=nxi[i];
end;
end
else begin
Graph1.RandomData:=0;
Graph1.GraphTitle:='Гістограма';
Graph1.GraphType:=3;
Graph1.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph1.Data[i]:=ni[i];
Graph1.XPosData:=xi[i];
end;
Graph2.RandomData:=0;
Graph2.GraphTitle:='Полігон';
Graph2.GraphType:=6;
Graph2.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph2.Data[i]:=ni[i];
Graph2.XPosData:=xi[i]+dx/2;
end;
Graph3.RandomData:=0;
Graph3.GraphTitle:='Діаграма';
Graph3.GraphType:=6;
Graph3.GraphStyle:=2;
Graph3.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph3.XPosData:=xi[i]+dx/2;
Graph3.Data[i]:=ni[i];
end;
Graph4.RandomData:=0;
Graph4.GraphTitle:='Функція розподілу';
Graph4.GraphType:=6;
Graph4.NumPoints:=2*(r-1)+2;
fi := VarArrayCreate([0,2*(r-1)+2], varDouble);
nxi := VarArrayCreate([0,2*(r-1)+2], varDouble);
sx:=0;
for i:=1 to r-1 do begin
sx:=wi[i]+sx;
fi[2*i]:=sx-wi[i];
fi[2*i+1]:=sx;
nxi[2*i]:=xi[i];
nxi[2*i+1]:=xi[i];
end;
fi[2*(r-1)+2]:=1;
nxi[1]:=xi[1]-3;
nxi[2*(r-1)+2]:=xi[r-1]+3;
j:=0;
for i:=1 to 2*(r-1)+2 do begin
Graph4.Data[i]:=fi[i];
Graph4.XPosData:=nxi[i];
end;
end;
end;
end.
Список літератури
1. Крамер Гарольд. Математические методы статистики. М.: Мир, 1976.
2. Бух Арлей. Введение в теорию вероятностей и математическую статистику. М., 1951.