Exemplo n.º 1
0
// BivariateGaussian generates a pair of correlated Gaussian variates,
// with mean zero, correlation coefficient rho and standard deviations
// sigma x and sigma y in the x and y directions. The correlation
// coefficient rho should lie between 1 and -1.
func BivariateGaussian(rng RngState, sigma_x, sigma_y, rho float64) (float64,
	float64) {
	var x, y float64
	C.gsl_ran_bivariate_gaussian(rng.state, C.double(sigma_x),
		C.double(sigma_y), C.double(rho), (*C.double)(&x), (*C.double)(&y))
	return x, y
}
Exemplo n.º 2
0
func BivariateGaussian(r *rng.GslRng, sigmaX float64, sigmaY float64, rho float64) (float64, float64) {
	var _outptr_4 C.double
	var _outptr_5 C.double
	C.gsl_ran_bivariate_gaussian((*C.gsl_rng)(unsafe.Pointer(r.Ptr())), C.double(sigmaX), C.double(sigmaY), C.double(rho), &_outptr_4, &_outptr_5)
	return *(*float64)(unsafe.Pointer(&_outptr_4)), *(*float64)(unsafe.Pointer(&_outptr_5))
}