Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Tolkamas · Jul 28, 2021 at 08:33 PM · randommathrandomizerandomizing

Multinomial Distribution in Unity?

Hi all,

I'm relatively new to Unity, but with a good deal of programming experience (though not in C#).

I was surprised to find that the Unity scripter only had a built in Uniform distribution, in the form of Random.Range. My question is regarding what the best way is to gain the use of other distributions. I've seen that some people have packaged up some in the Asset store; Gaussian, Exponential, but it's the Multinomial I really want to be able to use.

Surely there must be a way to import other general C# packages? A bit of google-sleuthing suggested something called NuGet might be the way to go?

Very appreciative of any help anyone can provide. Many thanks, Thom

P.S. I'm only doing a few draws at a time so I can't do a multivariate-normal approximation!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by elenzil · Jul 29, 2021 at 08:40 PM

yep, NuGet is a popular package management system for Windows. It's a .zip file at core, and can package up source or binaries. I've used it in unity via NugetForUnity, I believe.

.

This project seems to have specific non-nuget instructions in the README for Unity.

.

That said, a little web-searching suggests the MultiNomial isn't that involved, and you might consider just implementing it yourself. That way you live to put off package management another day.

.

Another option, if you find a concise implementation in a git repository is to pull the repository in as a git submodule.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tolkamas · Jul 29, 2021 at 10:20 PM 0
Share

Thank you for the fab answer. Indeed, looking today on even just the multinomial wikipedia page, there are some very compact ways to impose a multinomial on the standard uniform.

If I could just ask a little more on your final suggestion, you mean a git repo already configured for Unity3D specifically?

avatar image elenzil Tolkamas · Jul 29, 2021 at 10:32 PM 0
Share

Glad that's looking promising. I was thinking maybe just a general C# repo with a small amount of code, but I didn't find any likely candidates tbh.

avatar image
0

Answer by Captain_Pineapple · Jul 29, 2021 at 06:52 AM

Not sure how the underlying distibution looks but Unity offers functions like Random.insideUnitCircle and Random.insideUnitSphere.


Other then that:

What exactly stops you from doing 2 consecutive drafts from a (for example) Gaussian Distribution to get a multidimensional value?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tolkamas · Jul 29, 2021 at 08:29 AM 0
Share

Random.insideUnitCircle and Random.insideUnitSphereare from co-opted Uniform distributions unfortunately.

It's not multi-dimensional I'm after, it's multinomial, i.e. the n-dimensional generalisation of the Binomial distribution.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

183 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Randomness based on time passed 2 Answers

Random colors? 0 Answers

Randomly display an asset from Selection of assets 0 Answers

Random colors? 0 Answers

Getting A Random Between Two Doubles 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges