\HeaderA{CAPM.beta}{calculate CAPM beta}{CAPM.beta}
\methaliasA{CAPM.beta.bear}{CAPM.beta}{CAPM.beta.bear}
\methaliasA{CAPM.beta.bull}{CAPM.beta}{CAPM.beta.bull}
\aliasA{TimingRatio}{CAPM.beta}{TimingRatio}
\keyword{ts}{CAPM.beta}
\keyword{multivariate}{CAPM.beta}
\keyword{distribution}{CAPM.beta}
\keyword{models}{CAPM.beta}
\begin{Description}\relax
CAPM Beta is the beta of an asset to the variance and covariance of an initial portfolio.  Used to determine diversification potential. 

This function uses a linear intercept model to achieve the same results as the symbolic model used by \code{\LinkA{BetaCoVariance}{BetaCoVariance}}
\end{Description}
\begin{Usage}
\begin{verbatim}
CAPM.beta(Ra, Rb, Rf = 0)
CAPM.beta.bull(Ra, Rb, Rf = 0)
CAPM.beta.bear(Ra, Rb, Rf = 0)
TimingRatio(Ra, Rb, Rf = 0)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Ra}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{Rb}] return vector of the benchmark asset 
\item[\code{Rf}] risk free rate, in same period as your returns 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\deqn{\beta_{a,b}=\frac{CoV_{a,b}}{\sigma_{a}}=\frac{\sum((R_{a}-\bar{R_{a}})(R_{b}-\bar{R_{b}}))}{\sum(R_{a}-\bar{R_{a}})^{2}}}{}

Ruppert(2004) reports that this equation will give the estimated slope of the linear regression of \eqn{R_{a}}{} on \eqn{R_{b}}{} and that this slope can be used to determine the risk premium or excess expected return (see Eq. 7.9 and 7.10, p. 230-231).

Two other functions apply the same notion of best fit to positive and negative market returns, separately.  The \code{CAPM.beta.bull} is a regression for only positive market returns, which can be used to understand the behavior of the asset or portfolio in positive or 'bull' markets.  Alternatively, \code{CAPM.beta.bear} provides the calculation on negative market returns.

The \code{TimingRatio} can help assess whether the manager is a good timer of asset allocation decisions.  The ratio, which is calculated as
\deqn{TimingRatio =\frac{\beta^{+}}{\beta^{-}}}{}
is best when greater than one in a rising market and less than one in a falling market.
\end{Details}
\begin{Value}
systematic beta of an asset to the index, perhaps conditioned on positive or negative returns.
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{References}\relax
Sharpe, W.F. Capital Asset Prices: A theory of market equilibrium under conditions of risk. \emph{Journal of finance}, vol 19, 1964, 425-442. \\
Ruppert, David. \emph{Statistics and Finance, an Introduction}. Springer. 2004. \\
Bacon, Carl. \emph{Practical portfolio performance measurement and attribution}. Wiley. 2004. \\
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{BetaCoVariance}{BetaCoVariance}}
\code{\LinkA{CAPM.alpha}{CAPM.alpha}}
\code{\LinkA{CAPM.utils}{CAPM.utils}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(managers)
    CAPM.alpha(managers[,1,drop=FALSE], managers[,8,drop=FALSE], Rf=.035/12) 
    CAPM.alpha(managers[,1,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
    CAPM.alpha(managers[,1:6], managers[,8,drop=FALSE], Rf=.035/12)
    CAPM.alpha(managers[,1:6], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
    CAPM.alpha(managers[,1:6], managers[,8:7,drop=FALSE], Rf=.035/12) 
    CAPM.alpha(managers[,1:6], managers[,8:7,drop=FALSE], Rf = managers[,10,drop=FALSE])
    CAPM.beta(managers[, "HAM2", drop=FALSE], managers[, "SP500 TR", drop=FALSE], Rf = managers[, "US 3m TR", drop=FALSE])
    CAPM.beta.bull(managers[, "HAM2", drop=FALSE], managers[, "SP500 TR", drop=FALSE], Rf = managers[, "US 3m TR", drop=FALSE])
    CAPM.beta.bear(managers[, "HAM2", drop=FALSE], managers[, "SP500 TR", drop=FALSE], Rf = managers[, "US 3m TR", drop=FALSE])
    TimingRatio(managers[, "HAM2", drop=FALSE], managers[, "SP500 TR", drop=FALSE], Rf = managers[, "US 3m TR", drop=FALSE])
    chart.Regression(managers[, "HAM2", drop=FALSE], managers[, "SP500 TR", drop=FALSE], Rf = managers[, "US 3m TR", drop=FALSE], fit="conditional", main="Conditional Beta")

\end{ExampleCode}
\end{Examples}

