Skip to content
Back to formatted view

Raw Message

Message-ID: <56F15A7F.3070908@vodafone.it>
Date: 2016-03-22T14:45:19Z
From: Diego Peroni
Subject: need apply.paramset logging
In-Reply-To: <56F10658.9000302@braverock.com>

Brain thanks for your answers!

My strategy take a long time to run because it is "minute" based and 
runs over 6 years.

I've just 100 combinations so it is not the best to reduce nsamples to 
find errors.

If I reduce time range (2 o 3 years) it doesn't fail.

If I run sequentially it take a very long time.

The best solution remains the last you have indicated: "custom .combine 
function that could trap errors".
Does exist some documentation or example to read?

Regards

Diego Peroni




On 22/03/2016 09:46, Brian G. Peterson wrote:
> On 03/22/2016 03:37 AM, Diego Peroni wrote:
>> I'm testing paramset combinations with:
>>
>> .....
>> library(doMC)
>> registerDoMC(cores=detectCores())
>> paramsetenv = new.env()
>> results = apply.paramset(qs.strategy, paramset.label = "MACDOPT",
>> verbose = TRUE,
>>                            portfolio=qs.strategy, account=qs.strategy,
>> nsamples=0, audit=paramsetenv)
>>
>> but the procedure returns NULL object with this message:
>>
>> error calling combine function:
>> <simpleError: $ operator is invalid for atomic vectors>
>>
>> Is there a way to log threads errors?
>>
>> Or how can I modify "apply.paramset" function to "catch" single
>> simultation error or void result and discard it?
>
> you're setting
>
> nsamples=0
>
> so you have zero results to combine.
>
> In this case, you told it to run no samples, but I can conceive of a 
> strategy using some MCMC sampler that could fail spontaneously in some 
> circumstances.
>
> In a more general sense, you could specify a custom .combine function 
> that could trap errors if there was some possibility that your 
> strategy would fail to return a viable result.
>
> A strategy that runs fine in a single core should run fine in 
> apply.paramset.  A reasonable way to start testing this beyond a 
> single parameterization would be to set a small number of samples, 
> like nsamples=50 and run it with registerDoSEQ() to run it sequentially.
>
> Regards,
>
> Brian
>