[Blotter-commits] r725 - pkg/quantstrat/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 10 18:58:06 CEST 2011


Author: braverock
Date: 2011-08-10 18:58:05 +0200 (Wed, 10 Aug 2011)
New Revision: 725

Added:
   pkg/quantstrat/man/applyParameter.Rd
   pkg/quantstrat/man/getParameterTable.Rd
   pkg/quantstrat/man/paramConstraint.Rd
   pkg/quantstrat/man/setParameterConstraint.Rd
   pkg/quantstrat/man/setParameterDistribution.Rd
Log:
- add roxygen docs for parameter testing 

Added: pkg/quantstrat/man/applyParameter.Rd
===================================================================
--- pkg/quantstrat/man/applyParameter.Rd	                        (rev 0)
+++ pkg/quantstrat/man/applyParameter.Rd	2011-08-10 16:58:05 UTC (rev 725)
@@ -0,0 +1,48 @@
+\name{applyParameter}
+\alias{applyParameter}
+\title{Test different parameter sets on a strategy.}
+\usage{
+  applyParameter(strategy, portfolios, parameterPool,
+  parameterConstrains, method, sampleSize)
+}
+\arguments{
+  \item{strategy}{name of the strategy to apply paramters
+  to.}
+
+  \item{portfolios}{name of the portfolio to apply to.}
+
+  \item{parameterPool}{a paramter distribution object that
+  created by setParameterDistribution function, which
+  includes all the parameter legal values and
+  distribution/weights.}
+
+  \item{parameterConstrains}{the object created by
+  setParameterConstraint function that specifies the
+  constrains between each parameters,}
+
+  \item{method}{takes string 'expand' or 'random', specify
+  how to generate samples of parameters. 'expand' will do
+  all possible combinations of the parameter sets,}
+
+  \item{sampleSize}{used when method=='random', specify how
+  many parameter sets to generate and run test of.}
+}
+\description{
+  Given a parameter distribution object generated by
+  setParameterDistribution function, generate parameter
+  sets and test each set on specified strategy.
+}
+\details{
+  In the returned Object$: eachRun contains the details of
+  test run with each parameter set. paramTable is parameter
+  samples used, in a table for print. paramConstrainTable
+  is the constraints apply to the parameters, in a table
+  for print. parameterDistribution is the parameter
+  distribution passed in as argument. parameterConstrains
+  is the constraints apply to the parameters, passed in as
+  argument.
+}
+\author{
+  Yu Chen
+}
+

Added: pkg/quantstrat/man/getParameterTable.Rd
===================================================================
--- pkg/quantstrat/man/getParameterTable.Rd	                        (rev 0)
+++ pkg/quantstrat/man/getParameterTable.Rd	2011-08-10 16:58:05 UTC (rev 725)
@@ -0,0 +1,27 @@
+\name{getParameterTable}
+\alias{getParameterTable}
+\title{Extract the parameter structure from a strategy object.}
+\usage{
+  getParameterTable(strategy)
+}
+\arguments{
+  \item{strategy}{The name of the strategy}
+}
+\description{
+  This function is not required for user to specify the
+  distribution of parameters, Users can use this function
+  to extract the parameters used in a strategy, and as a
+  reminder/ cheatsheet when they create the parameter
+  distribution.
+}
+\details{
+  In the returned object: $paramNameList is the list of
+  parameters used in the strategy, easy for print and view
+  as a table. $strategyName is the name of the strategy
+  itself. $structure is the detailed paramter structure,
+  can be ignored.
+}
+\author{
+  Yu Chen
+}
+

Added: pkg/quantstrat/man/paramConstraint.Rd
===================================================================
--- pkg/quantstrat/man/paramConstraint.Rd	                        (rev 0)
+++ pkg/quantstrat/man/paramConstraint.Rd	2011-08-10 16:58:05 UTC (rev 725)
@@ -0,0 +1,31 @@
+\name{paramConstraint}
+\alias{paramConstraint}
+\title{Basicly is the same as sigComparison function in signal.R wrote by Brian, with miner change.}
+\usage{
+  paramConstraint(label, data = mktdata, columns,
+  relationship = c("gt", "lt", "eq", "gte", "lte"))
+}
+\arguments{
+  \item{label}{text label to apply to the output}
+
+  \item{data}{data to apply comparison to}
+
+  \item{columns}{named columns to apply comparison to}
+
+  \item{relationship}{one of
+  c("gt","lt","eq","gte","lte","op") or reasonable
+  alternatives}
+}
+\description{
+  Currently, this function compares two columns. Patches to
+  compare an arbitrary number of columns would be gladly
+  accepted.
+}
+\details{
+  Comparison will be applied from the first to the second
+  column in the \code{columns} vector.
+
+  Relationship 'op' means 'opposite' side.  Reasonable
+  attempt will be made to match.
+}
+

Added: pkg/quantstrat/man/setParameterConstraint.Rd
===================================================================
--- pkg/quantstrat/man/setParameterConstraint.Rd	                        (rev 0)
+++ pkg/quantstrat/man/setParameterConstraint.Rd	2011-08-10 16:58:05 UTC (rev 725)
@@ -0,0 +1,24 @@
+\name{setParameterConstraint}
+\alias{setParameterConstraint}
+\title{Function to construct parameter constraint object.}
+\usage{
+  setParameterConstraint(paramConstraintObj = list(),
+  constraintLabel, paramList, relationship)
+}
+\arguments{
+  \item{constrainlabel}{give a label to the constraint.}
+
+  \item{paramList}{the two name of the prameters as a list
+  contains two strings.}
+
+  \item{relationship}{relationship between the 1st
+  parameter and 2nd one. ('gt' means 1st parameter > 2nd
+  parameter)}
+}
+\description{
+  Function to construct parameter constraint object.
+}
+\author{
+  Yu Chen
+}
+

Added: pkg/quantstrat/man/setParameterDistribution.Rd
===================================================================
--- pkg/quantstrat/man/setParameterDistribution.Rd	                        (rev 0)
+++ pkg/quantstrat/man/setParameterDistribution.Rd	2011-08-10 16:58:05 UTC (rev 725)
@@ -0,0 +1,38 @@
+\name{setParameterDistribution}
+\alias{setParameterDistribution}
+\title{Function used to set distribution of a parameter in a strategy.}
+\usage{
+  setParameterDistribution(paramDist = NULL, type = NULL,
+  indexnum = 0, distribution = NULL, weight, label, psindex
+  = NULL)
+}
+\arguments{
+  \item{paramDist}{the object name that store the parameter
+  list}
+
+  \item{type}{indicator/signal/enter/exit/order}
+
+  \item{indexnum}{tells the sequence within the type, (if
+  the type is signal, indexnum =2 means the 2nd signal in
+  the strategy)}
+
+  \item{distribution}{distribution of the parameter, can be
+  any function that return a vector. (example: 1:10 or
+  sample(1:20,6)}
+
+  \item{weight}{the weight of each value in the
+  distribution, default value will be all equally
+  weighted.}
+
+  \item{psindex}{specify the index within the parameter
+  distribution object, it is used to make change/ repalce a
+  parameter distribution in the object.}
+}
+\description{
+  Function used to set distribution of a parameter in a
+  strategy.
+}
+\author{
+  Yu Chen
+}
+



More information about the Blotter-commits mailing list