When I run this and look in the .log file I see
l.185 cat("μ
=", mu, "\n")
The document does not appear to be in UTF-8 encoding.
Try adding \UseRawInputEncoding as the first line of the file
or specify an encoding such as \usepackage [latin1]{inputenc}
in the document preamble.
Alternatively, save the file in UTF-8 using your editor or another tool
Replacing μ and σ fixes the problem