  We give formulas for the spectral radius of weighted endomorphisms $a\alpha:
C(X,D)\to C(X,D)$, $a\in C(X,D)$, where $X$ is a compact Hausdorff space and
$D$ is a unital Banach algebra. Under the assumption that $\alpha$ generates a
partial dynamical system $(X,\varphi)$, we establish two kinds of variational
principles for $r(a\alpha)$: using linear extensions of $(X,\varphi)$ and using
Lyapunov exponents associated with ergodic measures for $(X,\varphi)$. This
requires considering (twisted) cocycles over $(X,\varphi)$ with values in an
arbitrary Banach algebra $D$, and thus our analysis can not be reduced to any
of mutliplicative ergodic theorems known so far.
  The established variational principles apply not only to weighted
endomorphisms but also to a vast class of operators acting on Banach spaces
that we call abstract weighted shifts associated with $\alpha: C(X,D)\to
C(X,D)$. In particular, they are far reaching generalizations of formulas
obtained by Kitover, Lebedev, Latushkin, Stepin and others. They are most
efficient when $D=\mathcal{B}(F)$, for a Banach space $F$, and endomorphisms of
$\mathcal{B}(F)$ induced by $\alpha$ are inner isometric. As a by product we
obtain a dynamical variational principle for an arbitrary operator $b\in
\mathcal{B}(F)$ and that it's spectral radius is always a Lyapunov exponent in
some direction $v\in F$, when $F$ is reflexive.
