<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/meanSquare(_:)-751e5",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO10meanSquareySfxAA0A6BufferRzSf7ElementRtzlFZ"
  },
  "title" : "meanSquare(_:)"
}
-->

# meanSquare(_:)

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

```
static func meanSquare<U>(_ vector: U) -> Float where U : AccelerateBuffer, U.Element == Float
```

## Parameters

`vector`

The source vector.

## Discussion

This function calculates and returns the mean square of a supplied vector.

The following is an example of using [`meanSquare(_:)`](/documentation/Accelerate/vDSP/meanSquare(_:)-751e5):

```swift
    let a: [Float] = [-8, -4, -2, 0, 2, 4, 8]

    let mean = vDSP.meanSquare(a)
    
    print(mean) // Prints "24.0".
```

---

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)