Variational analysis for the multifractal spectra of local entropies and Lyapunov exponents