|
From: Dima <dim...@go...> - 2009-11-27 12:44:46
|
Would you please elaborate your point?
Can I do it by taking back what I said :)? I was more referring to the
calendar classes, which I think work well in QuantLib
and might not be the focus of the boost library. The simple date classes
can be taken from boost I think. In particular, because
they already have linked dates and times, see the code below
ptime now = second_clock::local_time();
date today = now.date();
date tommorrow = today + days(1);
ptime tommorrow_start(tommorrow); //midnight
time_duration remaining = tommorrow_start - now;
Regarding boost stats: I've seen the accumulator library, but found it
very painful/cryptic to use. Eg. to calculate the covariance
you need to setup a cummulator set with
accumulator_set<double, stats<tag::covariance<double, tag::covariate1>>> acc;
Or for a quantile calculation:
accumulator_set<double, stats<tag::tail_quantile<right>>> acc0(tag::tail<right>::cache_size = c);
Ferdinando Ametrano schrieb:
> On Fri, Nov 27, 2009 at 12:29 PM, Dima <dim...@go...> wrote:
>
>> I'm not sure whether we should switch to boost's date library.
>>
>
> Would you please elaborate your point ?
>
>
>> Also, I
>> haven't seen how signals could potentially
>> replace observer/observables.
>>
>
> I might be completely wrong here as I'm not familiar about boost
> signal/slot, anyway according to wikipedia it's one implementation of
> the observer pattern:
> http://en.wikipedia.org/wiki/Observer_pattern
>
>
>> As a first step, I'd really suggest
>> to replace the distribution functions with
>> the one in boost. This is I think easy to do and would be the first
>> boostification step.
>>
>
> and since I forgot in my first email, please let me add that also the
> boost stats classes might be an improvement.
> Maybe even a performance improvement in MC when you only need mean and
> variance and don't need the higher moments which are calculate in QL
> stat classes
>
> ciao -- Nando
>
>
|