  Let $B^H$ be a fractional Brownian motion with Hurst index $0<H<1$ and the
weighted local time ${\mathscr L}^H(\cdot,t)$. In this paper, we consider the
integral functional $$ {\mathcal C}^H_t(a):=\lim_{\varepsilon\downarrow
0}\int_0^t1_{\{|B^H_s-a|>\varepsilon\}}\frac1{B^H_s-a}ds^{2H}\equiv
\frac1{\pi}{\mathscr H}{\mathscr L}^H(\cdot,t)(a) $$ in $L^2(\Omega)$ with $
a\in {\mathbb R}, t\geq 0$ and ${\mathscr H}$ denoting the Hilbert transform.
We show that $$ {\mathcal
C}^H_t(a)=2\left((B^H_t-a)\log|B^H_t-a|-B^H_t+a\log|a|
-\int_0^t\log|B^H_s-a|\delta B^H_s\right) $$ for all $a\in {\mathbb R}, t\geq
0$ which is the fractional version of Yamada's formula, where the integral is
the Skorohod integral. Moreover, we introduce the following {\it occupation
type formula}: $$ \int_{\mathbb R}{\mathcal
C}^H_t(a)g(a)da=2H\pi\int_0^t({\mathscr H}g)(B^H_s)s^{2H-1}ds $$ for all
continuous functions $g$ with compact support.
