Class PortfolioSupport.Covariance
Class encapsulating calculation of covariance matrix.
Inheritance
object
PortfolioSupport.Covariance
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TuringTrader.Support
Assembly: TuringTrader.Simulator.dll
Syntax
public class PortfolioSupport.Covariance
Constructors
| Improve this Doc View SourceCovariance(IEnumerable<Instrument>, int, int, Func<Instrument, ITimeSeries<double>>)
Create new covariance object. Subsample the instrument bars, to create bars with a larger size, if desired. https://en.wikipedia.org/wiki/Covariance
Declaration
public Covariance(IEnumerable<Instrument> universe, int numBars, int barSize, Func<Instrument, ITimeSeries<double>> priceFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><Instrument> | universe | universe of instruments |
int | numBars | of bars to calculate |
int | barSize | of bars between points, default = 1 |
System.Func<T, TResult><Instrument, ITimeSeries<double>> | priceFunc | predicate |
Covariance(IEnumerable<Instrument>, int, int)
Create new covariance object. Subsample the instrument bars, to create bars with a larger size, if desired. https://en.wikipedia.org/wiki/Covariance
Declaration
public Covariance(IEnumerable<Instrument> universe, int numBars, int barSize = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><Instrument> | universe | universe of instruments |
int | numBars | of bars to calculate |
int | barSize | of bars between points, default = 1 |
Properties
| Improve this Doc View SourceBarSize
Size of bars, as the number of bars from the instruments being subsampled, in order to calculate co-variance. Default is 1.
Declaration
public int BarSize { get; }
Property Value
Type | Description |
---|---|
int |
this[Instrument, Instrument]
Retrieve covariance.
Declaration
public double this[Instrument instrument1, Instrument instrument2] { get; }
Parameters
Type | Name | Description |
---|---|---|
Instrument | instrument1 | instrument #1 |
Instrument | instrument2 | instrument #2 |
Property Value
Type | Description |
---|---|
double | covariance |
NumBars
Number of bars used to calculate covariance
Declaration
public int NumBars { get; }
Property Value
Type | Description |
---|---|
int |