Search This Blog

Tuesday, May 29, 2018

How to generate all combinations from two separate lists [Pivot Table Trick]

https://chandoo.org/wp/generate-all-combinations-from-two-lists-excel/

Time for a quick but very useful tip. Ever wanted to create all combinations from two (or more) lists? a la Cartesian product of both lists.
Here is a ridiculously simple way to do it.

Make Cartesian product of two tables in Excel

Note: You need Excel 2013 or above for this.
  1. Convert two lists to tables, if not already done.
  2. Select any cell in one of the tables and go to Insert > Pivot Table (Use ALT + NV shortcut)
  3. Make sure to check “Add this data to the Data Model” option before clicking ok.
    add-pivot-to-data-model
  4. From your pivot table field list, switch to ALL view.
    see-all-tables-pivot-table-field-list
  5. Add both (or all fields) to row label area.
  6. Now, change the pivot table layout to “Show in tabular form” and check “Repeat all item labels” option.
    pivot-table-layout-settings
  7. Turn off sub totals & grand totals.
  8. Viola, your cross product is ready. All combinations are generated by Excel for you. Use them as you see fit.
join-combinations-of-two-tables-excel

Thursday, May 24, 2018

Uniform Distribution

DEFINITION of 'Uniform Distribution'

In statistics, a type of probability distribution in which all outcomes are equally likely. A deck of cards has a uniform distribution because the likelihood of drawing a heart, a club, a diamond or a spade is equally likely. A coin also has a uniform distribution because the probability of getting either heads or tails in a coin toss is the same.

BREAKING DOWN 'Uniform Distribution'

There are two types of uniform distributions: discrete and continuous. The possible results of rolling a die provide an example of a discrete uniform distribution: it is possible to roll a 1, 2, 3, 4, 5 or 6, but it is not possible to roll a 2.3, 4.7 or 5.5.
Uniform distribution is a statistical probability definition whereby every variable has the same probable outcome. Distributions are simple ways to help statisticians, mathematicians and investors to organize, analyze and display variable probabilities.

Understanding Uniform Distributions

A distribution is a simple way to appear in a set of data, either in a graph or in a list of stating which random variables have lower or higher chances, or probability. There are many different types of probability distributions, yet uniform distributions are the simplest of them all. Many people understand the bell curve distribution, as it is often used in college grading systems. Usually, students in a class organically fall into a bell curve distribution, with most students achieving an average mark, with a few at either end achieving a very poor or a very good grade.
However, a uniform distribution is a set of variables that all have the exact same possibility of happening. This uniform distribution, when displayed as a bar graph, has the exact same height of each bar and a standard number of bars. In this way, it typically looks like a rectangle and therefore is often described as the rectangle distribution. If you think about the possibility of pulling each suit's face card from a deck of playing cards, there is a random yet equal chance of pulling the jack of hearts as there is for pulling the king of spades.

Continuous Uniform Distributions

The other type of uniform distributions is continuous. An idealized random number generator would be considered a continuous uniform distribution. With this type of distribution, every variable has an equal opportunity of appearing, yet there are a continuous or possibly infinite number of possibilities. There are four other important distributions among the infinite possible distributions: binomial distribution, chi-square, normal and Student's t distribution models.

Functions of Distributions

There are also multiple functions associated with distributions to help consider variables and their variance within a data set. These functions include probability density function, cumulative density and moment generating functions.


Read more: Uniform Distribution https://www.investopedia.com/terms/u/uniform-distribution.asp#ixzz5GUOVM8iX
Follow us: Investopedia on Facebook