The following program displays 5 observations from a multivariate normal population with covariance matrix and mean given by
.
Imports System.Diagnostics
Module MainModule
Sub Main()
Dim arand As New AMOSRANDOMLib6.AmosRanGen
Dim Cov(2) As Double
Dim Mean(1) As Double
Cov(0) = 3
Cov(1) = 1
Cov(2) = 2
Mean(0) = 4
Mean(1) = 5
Dim Rank As Integer
Dim sqrdet As Double
Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)
Dim rx(1) As Double
Dim i As Long
For i = 1 To 5
Call arand.InstantRandomVector(2, rx(0), Mean(0), Cov(0))
Debug.WriteLine(rx(0) & rx(1))
Next
End Sub
End Module