[R-SIG-Finance] style.fit by month
julien cuisinier
J_Cuisinier at hotmail.com
Tue Mar 16 07:27:31 CET 2010
Hi René,
For quad prog algo, look for solve.QP from quadprog package in R. It
should allow you to do what you want (if I understood well). Please
note I am not too familiar with the PerformanceAnalytics package & its
capabilities (but suspect its style analysis function is a wrapper for
solve.QP). Building a rolling window analysis is quite trivial from
there.
On another note, using 1 month data is probably too small to have
stable results (depending on how many factors in your style analysis -
personal rule of thumb is 10 times the number of factors gives you a
benchmark of nbr of data points needed) , I would look to include more
returns in your linear regression. One could look into applying some
sort of weighting to your regression to improve forecasting power
(e.g. exponential weighting). I guess you are also looking into the
residuals for autocorrelation & heteroskedasticity which will impact
the hypothesis testing of your betas/coefficients.
& Finally, always best to make a question as concise as possible,
include a piece of reproducible code of what you are trying to do &
some system information (what R version, what OS) ... that often makes
easier for list member to help & follow (more or less) the posting
guide.
HTH
Julien
On Mar 16, 2010, at 12:04 AM, René Naarmann wrote:
> Hi R-users,
>
> it is the first time for me writing to this group. I would be
> grateful if somebody could help me to find
> a solution to my problem.
>
> I am working on my final thesis and I would like to analyse the
> impact of return frequency
> using return-based style analysis. Specifically I would like to
> calculate attributable returns. An attributalbe return
> is the difference between the realised return of a fund and the
> forecast from using the estimated style coefficients
> multiplied by the respective indexseries.
>
> I am using the implemented functions for style analysis in the
> PerformanceAnalytics Package.
> I would like to use the quadratic programming algorithm just for
> each day in a specific month, i.e.
> use the daily returns from january to calculate the style weigths.
> This should be done month by month.
> In the next step the calculation should include two months of data
> and calculate the style weigths month by month.
>
> So far I tried to usw apply.month in combination with style.fit.
> This returns the same results for each month.
> In the next step I tried to use some code out of chart.RollingStyle.
> I change it for my purpose and
> receive the style weights in a rolling calculation and could enable
> the by option. So I get styleweights
> over a specific width and could shift the calculation by a specified
> block, i.e. calculate styleweigths
> for 20 days shifting this calculation by the next 20 days. What I
> would like to have is a shifting by month
> to use the last month realised daily returns to forecast the style
> weigths for the next month.
>
> Has somebody an idea how to handle this problem?
> Thank you in advance
>
> René Naarmann
>
> --
> E-Mail: rene.naarmann at mnet-online.de
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R
> questions should go.
>
More information about the R-SIG-Finance
mailing list