add.distribution | R Documentation |
Creates a distribution in paramset, where a distribution consists of the name of a variable in a strategy component plus a range of values for this variable.
add.distribution(
strategy,
paramset.label,
component.type,
component.label,
variable,
variable.dist = NULL,
weight = NULL,
label,
store = TRUE
)
strategy |
the name of the strategy object to add the distribution to |
paramset.label |
a label uniquely identifying the paramset within the strategy |
component.type |
one of c('indicator', 'signal', 'order', 'enter', 'exit', 'chain') |
component.label |
a label identifying the component. must be unique per component type |
variable |
the name of the variable in the component, and optionally, it's distribution |
variable.dist |
the distribution to be applied to variable |
weight |
vector |
label |
a label uniquely identifying the distribution within the paramset |
store |
indicates whether to store the strategy in the .strategy environment |
In the original version of this function 'variable' was defined as a named list that contained the distribution directly. e.g.
' variable = list(mVAR = 1:50)'
In order to more efficiently support equality constraints, we have optionally separated 'variable' and 'variable.dist':
‘variable = ’mVAR',' 'variable.dist = 1:50'
and for an equality-constrained distribution:
‘variable=c(’mVAR','mOtherVAR'),' 'variable.dist=1:50'
The old formulation is still supported for backwards compatibility if 'variable.dist=NULL', the default.
Variables that should be equal, or equality-constrained, should be defined by creating a vector of the same length for 'component.label' and 'variable'. There is currently no error checking for getting this wrong, please be careful, patches welcome. The equal-length vectors will then apply the same distribution to one or more 'variable's in the same 'component.type'. This is far more efficient than testing the constraints utilizing 'apply.constraints', and ensures the equality of the parameters.
Jan Humme, Brian Peterson
add.distribution.constraint
,
delete.paramset
,
apply.paramset
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.