Java programming to sample or sample code for beta distribution, javabeta

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.