  The oxygen-deficient (double) perovskite YBaMn$_2$O$_5$, containing
corner-linked MnO$_5$ square pyramids, is found to exhibit ferrimagnetic
ordering in its ground state. In the present work we report
generalized-gradient-corrected, relativistic first-principles full-potential
density-functional calculations performed on YBaMn$_2$O$_5$ in the nonmagnetic,
ferromagnetic and ferrimagnetic states. The charge, orbital and spin orderings
are explained with site-, angular momentum- and orbital-projected density of
states, charge-density plots, electronic structure and total energy studies.
YBaMn$_2$O$_5$ is found to stabilize in a G-type ferrimagnetic state in
accordance with experimental results. The experimentally observed insulating
behavior appears only when we include ferrimagnetic ordering in our
calculation. We observed significant optical anisotropy in this material
originating from the combined effect of ferrimagnetic ordering and crystal
field splitting. In order to gain knowledge about the presence of different
valence states for Mn in YBaMn$_2$O$_5$ we have calculated $K$-edge x-ray
absorption near-edge spectra for the Mn and O atoms. The presence of the
different valence states for Mn is clearly established from the x-ray
absorption near-edge spectra, hyperfine field parameters and the magnetic
properties study. Among the experimentally proposed structures, the recently
reported description based on $P$4/$nmm$ is found to represent the stable
structure.
