# std

Standard deviation of probability distribution

## Syntax

``s = std(pd)``

## Description

example

````s = std(pd)` returns the standard deviation `s` of the probability distribution `pd`.```

## Examples

collapse all

Load the sample data. Create a vector containing the first column of students' exam grade data.

```load examgrades x = grades(:,1);```

Fit a normal distribution object to the data.

`pd = fitdist(x,'Normal')`
```pd = NormalDistribution Normal distribution mu = 75.0083 [73.4321, 76.5846] sigma = 8.7202 [7.7391, 9.98843] ```

Compute the standard deviation of the fitted distribution.

`s = std(pd)`
```s = 8.7202 ```

For a normal distribution, the standard deviation is equal to the parameter `sigma`.

Create a Weibull probability distribution object

`pd = makedist('Weibull','A',5,'B',2)`
```pd = WeibullDistribution Weibull distribution A = 5 B = 2 ```

Compute the standard deviation of the distribution.

`s = std(pd)`
```s = 2.3163 ```

Create a triangular distribution object.

`pd = makedist('Triangular','A',-3,'B',1,'C',3)`
```pd = TriangularDistribution A = -3, B = 1, C = 3 ```

Compute the standard deviation of the distribution.

`s = std(pd)`
```s = 1.2472 ```

Load the sample data. Create a vector containing the first column of students’ exam grade data.

```load examgrades; x = grades(:,1);```

Create a probability distribution object by fitting a kernel distribution to the data.

`pd = fitdist(x,'Kernel')`
```pd = KernelDistribution Kernel = normal Bandwidth = 3.61677 Support = unbounded ```

Compute the standard deviation of the fitted distribution.

`s = std(pd)`
```s = 9.4069 ```

## Input Arguments

collapse all

Probability distribution, specified as one of the probability distribution objects in the following table.

Distribution ObjectFunction or App Used to Create Probability Distribution Object
`BetaDistribution``makedist`, `fitdist`, Distribution Fitter
`BinomialDistribution``makedist`, `fitdist`, Distribution Fitter
`BirnbaumSaundersDistribution``makedist`, `fitdist`, Distribution Fitter
`BurrDistribution``makedist`, `fitdist`, Distribution Fitter
`ExponentialDistribution``makedist`, `fitdist`, Distribution Fitter
`ExtremeValueDistribution``makedist`, `fitdist`, Distribution Fitter
`GammaDistribution``makedist`, `fitdist`, Distribution Fitter
`GeneralizedExtremeValueDistribution``makedist`, `fitdist`, Distribution Fitter
`GeneralizedParetoDistribution``makedist`, `fitdist`, Distribution Fitter
`HalfNormalDistribution``makedist`, `fitdist`, Distribution Fitter
`InverseGaussianDistribution``makedist`, `fitdist`, Distribution Fitter
`KernelDistribution``fitdist`, Distribution Fitter
`LogisticDistribution``makedist`, `fitdist`, Distribution Fitter
`LoglogisticDistribution``makedist`, `fitdist`, Distribution Fitter
`LognormalDistribution``makedist`, `fitdist`, Distribution Fitter
`LoguniformDistribution``makedist`
`MultinomialDistribution``makedist`
`NakagamiDistribution``makedist`, `fitdist`, Distribution Fitter
`NegativeBinomialDistribution``makedist`, `fitdist`, Distribution Fitter
`NormalDistribution``makedist`, `fitdist`, Distribution Fitter
`PiecewiseLinearDistribution``makedist`
`PoissonDistribution``makedist`, `fitdist`, Distribution Fitter
`RayleighDistribution``makedist`, `fitdist`, Distribution Fitter
`RicianDistribution``makedist`, `fitdist`, Distribution Fitter
`StableDistribution``makedist`, `fitdist`, Distribution Fitter
`tLocationScaleDistribution``makedist`, `fitdist`, Distribution Fitter
`TriangularDistribution``makedist`
`UniformDistribution``makedist`
`WeibullDistribution``makedist`, `fitdist`, Distribution Fitter

## Output Arguments

collapse all

Standard deviation of the probability distribution, returned as a nonnegative scalar value.

## Version History

Introduced in R2013a