Stochastic mechanics of metamaterials