You mean analogRead(), not analogWrite()

I think it depends on the range of temperature you are looking at - the smaller the range the simpler

the curve needed to fit to the device's response over that range.

For a very small range a linear approximation might be enough, somewhat larger you could try a

quadratic curve or cubic.

For a large range of temperature the Steinhart-Hart equation will be best simply because it has the right

form and fewer parameters are needed to get a good fit - otherwise a polynomial or rational function

approximation with more parameters would be needed.