08.02.2015 Views

Sage Reference Manual: Quantitative Finance - Mirrors

Sage Reference Manual: Quantitative Finance - Mirrors

Sage Reference Manual: Quantitative Finance - Mirrors

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Quantitative</strong> <strong>Finance</strong>, Release 6.1.1<br />

•normalize – (default: True) whether to normalize so the total area in the bars of the histogram is<br />

1.<br />

OUTPUT:<br />

A histogram plot.<br />

EXAMPLES:<br />

sage: v = finance.TimeSeries([1..50])<br />

sage: v.plot_histogram(bins=10)<br />

sage: v.plot_histogram(bins=3,normalize=False,aspect_ratio=1)<br />

pow(k)<br />

Return a new time series with every elements of self raised to the k-th power.<br />

INPUT:<br />

•k – a float.<br />

OUTPUT:<br />

A time series.<br />

EXAMPLES:<br />

sage: v = finance.TimeSeries([1,1,1,2,3]); v<br />

[1.0000, 1.0000, 1.0000, 2.0000, 3.0000]<br />

sage: v.pow(2)<br />

[1.0000, 1.0000, 1.0000, 4.0000, 9.0000]<br />

prod()<br />

Return the product of all the entries of self. If self has length 0, returns 1.<br />

OUTPUT:<br />

A double.<br />

EXAMPLES:<br />

sage: v = finance.TimeSeries([1,1,1,2,3]); v<br />

[1.0000, 1.0000, 1.0000, 2.0000, 3.0000]<br />

sage: v.prod()<br />

6.0<br />

randomize(distribution=’uniform’, loc=0, scale=1, **kwds)<br />

Randomize the entries in this time series, and return a reference to self. Thus this function both changes<br />

self in place, and returns a copy of self, for convenience.<br />

INPUT:<br />

•distribution – (default: "uniform"); supported values are:<br />

–’uniform’ – from loc to loc + scale<br />

–’normal’ – mean loc and standard deviation scale<br />

–’semicircle’ – with center at loc (scale is ignored)<br />

–’lognormal’ – mean loc and standard deviation scale<br />

•loc – float (default: 0)<br />

•scale – float (default: 1)<br />

14 Chapter 1. Time Series

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!