Yosemite Retail DVD?
It seems that Apple doesn't supply OSX on a retail DVD anymore, since all modern Macs have a recovery partition, which contains the installer and is updateable. However, there are ways to create an installer USB drive, and here is Apple's own solution.

Before you're able to create a bootable OS X installer, you'll need to do the following first:

Download the OS X Installer app from the Mac App Store.

Mount the volume you want to convert into a bootable installer. This could be removable media such as a USB flash drive, or a secondary internal partition.

You can then use the createinstallmedia tool to convert the volume from step two into a bootable installer based off the installer app from step one. To learn how to use createinstallmedia, use the following command in Terminal:


OS X Yosemite
/Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia
OS X Mavericks
/Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia
Examples
For example, assuming you have a volume mounted at /Volumes/MyVolume and the OS X installer app is at /Applications/Install\ OS\ X\ Mavericks.app you could erase /Volumes/MyVolume and convert it into a bootable installer with this command:
OS X Yosemite
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ OS\ X\ Yosemite.app
OS X Mavericks
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ OS\ X\ Mavericks.app
Notes
You may need to adjust the path to the OS X installer app and/or your removable media device's name in the command. createinstallmedia is an advanced option for system administrators and as such, requires some knowledge of the command line in order to be used properly. It is only intended to be used with the version of the OS X Installer app it came with.