Solar and stellar flares are interpreted so far as an instability of a
large scale magnetic neutral sheet. In this article, however, we assu
me that the active region is highly inhomogeneous: a large number of m
agnetic loops are simultaneously present interacting and randomly form
ing discontinuities in many independent points in space. These magneti
c discontinuities release energy and force weaker discontinuities in t
heir neighbourhood to release energy as well. This complex dynamical s
ystem releases constantly energy in the form of small and large scale
explosions. Clustering of many discontinuities in the same area has th
e effect of larger scale explosions (flares). This type of flare with
spatiotemporal fragmentation and clustering in small and large scale s
tructures will be called here the statistical flare. The statistical f
lare is simulated using avalanche models originally introduced by Bak
et al. (1988). Avalanche models applied so far to solar flares (Lu & H
amilton 1991) were isotropic (the field was distributed equally to the
closest neighbours of an unstable point). These models simulate relat
ively large events (microflares and flares). Here we introduce a more
refined isotropic avalanche model as well as an anisotropic avalanche
model (energy is distributed only among the unstable point and those n
eighbours that develop gradients higher than a critical value). The an
isotropic model simulates better the smaller events (nanoflares): in c
ontrast to the well-known results of the isotropic model (a power law
with index similar to -1.8 in the peak-luminosity distribution), the a
nisotropic model produces a much steeper power law with index similar
to -3.5. Finally, we introduce a mixed model (a combination of isotrop
ic and anisotropic models) which gives rise to two distinct power-law
regions in the peak-luminosity distribution, one with index similar to
-3.5 accounting for the small events, and one with index similar to -
1.8 accounting for large events. This last model therefore explains co
ronal heating as well as flaring. The three models introduced in this
paper show length-scale invariant behaviour. Model-dependent memory ef
fects are detected in the peak-luminosity time series produced by thes
e models.