Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added terms and probability-distributions folders and file #5914

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved
Title: 'probability-distributions.md'
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved
Description: 'This entry provides an introduction to probability distributions, their syntax, and an example using SciPy.'
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved
Subjects:
- 'Bash/Shell'
- 'Data Visualization'
- 'Information Technology'
Tags:
- 'Data Structures'
- 'Functions'
- 'Probability'
CatalogContent:
- 'docs/content/scipy/concepts/scipy-stats/terms/probability-distributions/probability-distributions.md'
- 'Python:SciPy'
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved
---

The element of surprise. **Probability distributions** describe how the structure of random variables are allocated. In the context of SciPy, the scipy.stats module provides various functions for working with different probability distributions that deliver consistent information such as Cumulative Distribution Functions (CDF), Probability Density Functions (PDF), and other statistical metrics.They convey the probabilities of various outcomes, and are fundamental to statistics and data analysis;.
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved

## Syntax
from scipy.stats import distribution_name
rv = distribution_name(parameters)
cdf_value = rv.cdf(x)
pdf_value = rv.pdf(x)
pmf_value = rv.pmf(x)
mean_value = rv.mean()
variance_value = rv.var()
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved

## Example: Normal distribution using SciPy
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved
from scipy.stats import norm

rv = norm(loc=0, scale=1)

cdf_value = rv.cdf(1)

pdf_value = rv.pdf(1)

mean_value = rv.mean()

variance_value = rv.var()

print("CDF at x=1:", cdf_value)
print("PDF at x=1:", pdf_value)
print("Mean of the distribution:", mean_value)
print("Variance of the distribution:", variance_value)
PragatiVerma18 marked this conversation as resolved.
Show resolved Hide resolved