<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vector-average-calculation",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Vector average calculation"
}
-->

# Vector average calculation

Calculate the average value in a vector.

## Topics

### Calculating the mean value of a vector

[`static func mean<U>(U) -> Float`](/documentation/Accelerate/vDSP/mean(_:)-1lwak)

Returns the mean value of a single-precision vector.

[`static func mean<U>(U) -> Double`](/documentation/Accelerate/vDSP/mean(_:)-60g3p)

Returns the mean value of a double-precision vector.

[`extern void vDSP_meanv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_meanv)

Calculates the mean value of a single-precision vector.

[`extern void vDSP_meanvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_meanvD)

Calculates the mean value of a double-precision vector.

### Calculating the mean of magnitudes of a vector

[`static func meanMagnitude<U>(U) -> Float`](/documentation/Accelerate/vDSP/meanMagnitude(_:)-3fica)

Returns the mean of magnitudes of a single-precision vector.

[`static func meanMagnitude<U>(U) -> Double`](/documentation/Accelerate/vDSP/meanMagnitude(_:)-664b7)

Returns the mean of magnitudes of a double-precision vector.

[`extern void vDSP_meamgv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_meamgv)

Calculates the mean of magnitudes of a single-precision vector.

[`extern void vDSP_meamgvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_meamgvD)

Calculates the mean of magnitudes of a double-precision vector.

### Calculating the mean of squares of a vector

[`static func meanSquare<U>(U) -> Float`](/documentation/Accelerate/vDSP/meanSquare(_:)-751e5)

Returns the mean of squares of a single-precision vector.

[`static func meanSquare<U>(U) -> Double`](/documentation/Accelerate/vDSP/meanSquare(_:)-1gh6k)

Returns the mean of squares of a double-precision vector.

[`extern void vDSP_measqv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_measqv)

Calculates the mean of squares of a single-precision vector.

[`extern void vDSP_measqvD(const double *__A, vDSP_Stride __I, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_measqvD)

Calculates the mean of squares of a double-precision vector.

[`extern void vDSP_mvessq(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_mvessq)

Calculates the mean of signed squares of a single-precision vector.

[`extern void vDSP_mvessqD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_mvessqD)

Calculates the mean of signed squares of a double-precision vector.

### Calculating the root mean square of a vector

[`static func rootMeanSquare<U>(U) -> Float`](/documentation/Accelerate/vDSP/rootMeanSquare(_:)-9xkkk)

Returns the root mean square of a single-precision vector.

[`static func rootMeanSquare<U>(U) -> Double`](/documentation/Accelerate/vDSP/rootMeanSquare(_:)-4mwg7)

Returns the root mean square of a double-precision vector.

[`extern void vDSP_rmsqv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_rmsqv)

Calculates the root mean square of a single-precision vector.

[`extern void vDSP_rmsqvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_rmsqvD)

Calculates the root mean square of a double-precision vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)