tawny: deriving

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

tawny: deriving

rohan sadler
Hi All,

newbie question: I am interested in acquiring the value of Ledoit & Wolf's
(2003) optimal shrinkage estimate from the tawny package (or other). Having
read the paper, and then had a look at tawny, then I can derive the
shrinkage intensity (intensity.shrinkage, see below code). However, as the
value of the intensity is larger than one then I wanted to confirm whether
the L&W shrinkage parameter  is not tawny's intensity/T, where T is the
length of the time series (i.e., rows of the returns matrix). That is,
confirm whether tawny's shrinkage.intensity function returns what L&W
termed as the 'optimal constant' kappa (p611), rather than L&W's optimal
shrinkage intensity alpha.

  sample.vcov<-cov.sample(returns.zoo)
  F <- cov.prior.cc(sample.vcov)
  k <- shrinkage.intensity(returns.zoo, F, sample.vcov)
  shrunk.vcov<-cov.shrink(returns.zoo,prior.fun = cov.prior.cc)

The output from Brian's site:
http://nurometic.com/quantitative-finance/tawny/exploring-shrinkage-estimation
doesn't
seem
to hold for the latest R/tawny version. It would be nice to acquire that
information somehow, perhaps embedded in one of the shrunk objects, or at
least one or two more lines of documentation in the associated help pages
(apologies for being demanding!!). Packages fPortfolio and corpcor didn't
seem to provide any of this information either for the newbie crowd.

> S.hat <- cov.shrink(h)
Got intensity k = 146.8918 and coefficient d = 0.9792788


Regards
Rohan Sadler

--
Research Assistant Professor
School of Agricultural and Resource Economics, M089
The University of Western Australia
35 Stirling Highway,
Crawley, 6009

Office:  +61 8 6488 3491
Fax:     +61 8 6488 1098
Mobile:      0433 192 600

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: tawny: deriving

Patrick Burns-2
Rohan,

I'm a little confused about what you really
want, but perhaps 'var.shrink.eqcor' from
the 'BurStFin' package can help.

The package is not yet on CRAN (but it's
getting closer), get it from:

install.packages('BurStFin',
    repos="http://www.burns-stat.com/R")

(which doesn't work under 2.14.x because it
doesn't have a namespace).

'var.shrink.eqcor' returns the shrinkage that
it uses as an attribute.

To get estimates that are trying to mimic the
original Ledoit-Wolf code, you need to set the
weights to be all equal and the 'compatible'
argument to TRUE.

The shrinkage parameter is slightly different
from that estimated in 'tawny'.  I have a sample
size of one that suggests I get the value that
Ledoit and Wolf's Matlab code gets.  I couldn't
see where the difference comes from in the little
time I spent trying.

Pat

On 28/01/2012 05:42, Rohan Sadler wrote:

> Hi All,
>
> newbie question: I am interested in acquiring the value of Ledoit&  Wolf's
> (2003) optimal shrinkage estimate from the tawny package (or other). Having
> read the paper, and then had a look at tawny, then I can derive the
> shrinkage intensity (intensity.shrinkage, see below code). However, as the
> value of the intensity is larger than one then I wanted to confirm whether
> the L&W shrinkage parameter  is not tawny's intensity/T, where T is the
> length of the time series (i.e., rows of the returns matrix). That is,
> confirm whether tawny's shrinkage.intensity function returns what L&W
> termed as the 'optimal constant' kappa (p611), rather than L&W's optimal
> shrinkage intensity alpha.
>
>    sample.vcov<-cov.sample(returns.zoo)
>    F<- cov.prior.cc(sample.vcov)
>    k<- shrinkage.intensity(returns.zoo, F, sample.vcov)
>    shrunk.vcov<-cov.shrink(returns.zoo,prior.fun = cov.prior.cc)
>
> The output from Brian's site:
> http://nurometic.com/quantitative-finance/tawny/exploring-shrinkage-estimation
> doesn't
> seem
> to hold for the latest R/tawny version. It would be nice to acquire that
> information somehow, perhaps embedded in one of the shrunk objects, or at
> least one or two more lines of documentation in the associated help pages
> (apologies for being demanding!!). Packages fPortfolio and corpcor didn't
> seem to provide any of this information either for the newbie crowd.
>
>> S.hat<- cov.shrink(h)
> Got intensity k = 146.8918 and coefficient d = 0.9792788
>
>
> Regards
> Rohan Sadler
>

--
Patrick Burns
[hidden email]
http://www.burns-stat.com
http://www.portfolioprobe.com/blog
twitter: @portfolioprobe

_______________________________________________
[hidden email] 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.