Генераторы случайных чисел STATISTICA Visual Basic

Option Base 1

Sub Main

Dim x (1 To
10) As Double

Dim y (1 To
10) As Double

Dim z (1 To
10) As Double

Dim i As
Integer

For i =1 To
10

x(i)=RndNormal(0.3)

y(i)=Round((RndNormal(1)+8)*10)

z(i)=Round(Rnd(150)*100)

Application.ActiveSpreadsheet.Cells(i,2)=x(i)

Application.ActiveSpreadsheet.Cells(i,3)=y(i)

Application.ActiveSpreadsheet.Cells(i,5)=z(i)

Application.ActiveSpreadsheet.Cells(i,7)=NGen(-8,2)

Application.ActiveSpreadsheet.Cells(i,9)=PGen(200)

Application.ActiveSpreadsheet.Cells(i,4)=Rnd

Application.ActiveSpreadsheet.Cells(i,6)=RGen(5,7)

Next i

End Sub

Function
NGen (um As Double, ud As Double) As Double ‘Генератор N(um,ud).

NGen=RndNormal(ud)+um

End
Function

Function
PGen (um As Double) As Double ‘Генератор Пуассона

PGen=RndPoisson(um)

End
Function

Function
RGen (a As Double, b As Double) As Double ‘Генераторо равномерного распределения на[a,b].

RGen=Rnd*(b-a)+a

End Function

- доцент
- кандидат юридических наук
- профессор кафедры

Оцените автора
Добавить комментарий