Joint Probability Table

Description

Create a joint probability table for a series of trades

Usage

1
  jointProbTable(x, n=3, FUN=median, ...)

Arguments

x

A vector, data.frame, or matrix.

n

A number of bins to create for each column in x. You can use a vector of length NCOL(x) to specify a different number of bins for each column.

FUN

The function used to assign a value to each bin.

...

Parameters to be passed to FUN.

Value

A lsp object.

Author(s)

Joshua Ulrich

References

Vince, Ralph (2007) The Handbook of Portfolio Mathematics. New York: John Wiley & Sons, Inc.
Vince, Ralph (2009) The Leverage Space Trading Model. New York: John Wiley & Sons, Inc.

Examples

1
2
3
4
5
6
  
  df <- data.frame(x=rnorm(10),y=rnorm(10))
  jptMedian <- jointProbTable(df, n=c(2,3))
  jptMean <- jointProbTable(df, FUN=mean)
  jptMin  <- jointProbTable(df, FUN=min)
  jptMax  <- jointProbTable(df, FUN=max)