Java programming to sample or sample code for beta distribution, javabeta
This article focuses on the sampling or sampling of beta distribution through Java programming. The details are as follows.
This article uses the Toolkit provided by math3 to sample the beta distribution. The following program samples the beta distribution functions of alpha = 81, beta = 219 and samples 10000 times.
Package function;/*** @ author: School of Management, Hefei University of Technology Qian Yang * @ email: 1563178220@qq.com * @ here the main use of gamma related functions in math3 */import org. apache. commons. math3.distribution. betaDistribution; import org. apache. commons. math3.special. gamma; public class dergamma {public static void main (String [] args) {// sample 1000 times for (int I = 0; I <10000; I ++) {System. out. println (betasampler (81,219) ;}// beta distribution sampling public static double betasampler (double alpha, double beta) {BetaDistribution beta = new BetaDistribution (alpha, beta ); return beta. sample ();}}
Some output results after sampling are as follows:
Summary
The above is all the content of this article on Java Programming to Implement beta distribution sampling or sample instance code, I hope to help you. If you are interested, you can continue to refer to other related topics on this site. If you have any shortcomings, please leave a message. Thank you for your support!