1. An oscillator device comprising:an oscillating unit that includes a crystal resonator to output a frequency signal based on a frequency setting value;
a frequency difference detector that obtains a difference value corresponding to a frequency difference between an external clock signal obtained from outside and a frequency signal output from the oscillating unit;
a temperature detector that detects a temperature of an atmosphere where the crystal resonator is disposed;
a correction value calculator that calculates a frequency correction value to be added to the frequency setting value in order to equalize a frequency of the frequency signal to the frequency corresponding to the frequency setting value;
an addition unit that adds the frequency correction value obtained from the correction value calculator to the frequency setting value input to the oscillating unit; and
a correction coefficient calculator that calculates an aging coefficient and a temperature characteristic coefficient based on a secular change of the difference value obtained in the frequency difference detector and a secular change of the detected temperature detected in the temperature detector, the aging coefficient indicating a changing rate of the frequency correction value per unit time, the temperature characteristic coefficient indicating a changing rate of the frequency correction value per unit temperature, wherein
the correction value calculator calculates the frequency correction value based on the difference value detected in the frequency difference detector during a period where the external clock signal is obtained, and calculates the frequency correction value using the aging coefficient and the temperature characteristic coefficient during a period where the external clock signal is interrupted.