Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function CAPM.jensenAlpha works weird when Rf is a vector #136

Open
lhloki opened this issue Nov 23, 2019 · 1 comment
Open

function CAPM.jensenAlpha works weird when Rf is a vector #136

lhloki opened this issue Nov 23, 2019 · 1 comment

Comments

@lhloki
Copy link

lhloki commented Nov 23, 2019

According the code, the Jensen's alpha is calculated with accumulated return in the following formula
result = Rp - Rf - CAPM.beta(Ra, Rb, Rf) * (Rpb - Rf)

Yet, if Rf is feed with a time series, which is normal in practical application, a same size of vector will be returned instead of a single value which is expected in general. Again if Rp is the accumulated return of Ra, we have the same reason to expect that Rf should be the the accumulated return of risk-free interest rate.

@lhloki
Copy link
Author

lhloki commented Nov 23, 2019

I believe the same issue exists in the MSquared function too. Either narrow down the acceptable Rf to a constant factor or replace Rf by its accumulated return should solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant