This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

truncate

Truncate probability distribution object

Syntax

t = truncate(pd,lower,upper)

Description

example

t = truncate(pd,lower,upper) returns a probability distribution t, which is the probability distribution pd truncated to the specified interval with lower limit, lower, and upper limit, upper.

Examples

collapse all

Create a default normal probability distribution object.

pd = makedist('Normal')
pd = 
  NormalDistribution

  Normal distribution
       mu = 0
    sigma = 1

Truncate the distribution to have a lower limit of -2 and an upper limit of 2.

t = truncate(pd,-2,2)
t = 
  NormalDistribution

  Normal distribution
       mu = 0
    sigma = 1
  Truncated to the interval [-2, 2]

The probability distribution function of t is 0 outside the truncation interval (-2,2).

Input Arguments

collapse all

Probability distribution, specified as a probability distribution object. Create a probability distribution object with specified parameter values using makedist.

Lower truncation limit, specified as a scalar value.

Data Types: single | double

Upper truncation limit, specified as a scalar value.

Data Types: single | double

Output Arguments

collapse all

Truncated distribution, returned as a probability distribution object. The probability distribution function (pdf) of t is 0 outside the truncation interval. Inside the truncation interval, the pdf of t is equal to the pdf of pd, but divided by the probability assigned to that interval by pd.

See Also

Introduced in R2016b