  We investigate the effects of stochasticity in the spatial and temporal
distribution of supernova remnants on the anisotropy of cosmic rays observed at
Earth. The calculations are carried out for different choices of the diffusion
coefficient D(E) for propagation in the Galaxy. The propagation and spallation
of nuclei are taken into account. At high energies we assume that
$D(E)\sim(E/Z)^{\delta}$, with $\delta=1/3$ and $\delta=0.6$ being the
reference scenarios. The large scale distribution of supernova remnants in the
Galaxy is modeled following the distribution of pulsars with and without
accounting for the spiral structure of the Galaxy. Our calculations allow us to
determine the contribution to anisotropy resulting from both the large scale
distribution of SNRs in the Galaxy and the random distribution of the nearest
remnants. The naive expectation that the anisotropy amplitude scales as D(E) is
shown to be an oversimplification which does not reflect in the predicted
anisotropy for any realistic distribution of the sources. The fluctuations in
the anisotropy pattern are dominated by nearby sources, so that predicting or
explaining the observed anisotropy amplitude and phase becomes close to
impossible. We find however that the very weak energy dependence of the
anisotropy amplitude below $10^{5}$ GeV and the rise at higher energies, can
best be explained if the diffusion coefficient is $D(E)\sim E^{1/3}$. Faster
diffusion, for instance with $\delta=0.6$, leads in general to an exceedingly
large anisotropy amplitude. The spiral structure introduces interesting trends
in the energy dependence of the anisotropy pattern, which qualitatively reflect
the trend seen in the data. For large values of the halo size we find that the
anisotropy becomes dominated by the large scale regular structure of the source
distribution, leading indeed to a monotonic increase of $\delta_A$ with energy.
