Popular recipes tagged "meta:requires=scipy" but not "body"http://code.activestate.com/recipes/tags/meta:requires=scipy-body/2014-06-13T14:29:36-07:00ActiveState Code RecipesSimple model to predict UK Interest Rates (Python)
2014-06-13T14:29:36-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578891-simple-model-to-predict-uk-interest-rates/
<p style="color: grey">
Python
recipe 578891
by <a href="/recipes/users/4166679/">alexander baker</a>
.
</p>
<p>A common model used in the financial industry for modelling the short rate (think overnight rate, but actually an infinitesimally short amount of time) is the Vasicek model. #
Although it is unlikely to perfectly fit the yield curve, it has some nice properties that make it a good model to work with.
The dynamics of the Vasicek model are describe below.</p>
<p>In this model, the parameters are constants, and the random motion is generated by the Q measure Brownian motion .
An important property of the Vasicek model is that the interest rate is mean reverting to , and the tendency to revert is controlled by .
Also, this process is a diffusion process, hence Markovian, which will lead to some nice closed form formulas.
Finally, the future value of the interest rate is normally distributed with the distribution .</p>
Hartree Fock SCF (Python)
2013-04-30T09:09:20-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578515-hartree-fock-scf/
<p style="color: grey">
Python
recipe 578515
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/numpy/">numpy</a>, <a href="/recipes/tags/physics/">physics</a>).
Revision 4.
</p>
<p>Quantum Chemistry technique to calculate various interesting operators for HeH.</p>
Hierarchical Clustering Heatmap Python (Python)
2014-02-19T11:09:36-08:00xapplehttp://code.activestate.com/recipes/users/4189256/http://code.activestate.com/recipes/578834-hierarchical-clustering-heatmap-python/
<p style="color: grey">
Python
recipe 578834
by <a href="/recipes/users/4189256/">xapple</a>
(<a href="/recipes/tags/clustering/">clustering</a>, <a href="/recipes/tags/heatmap/">heatmap</a>, <a href="/recipes/tags/hierarchical/">hierarchical</a>, <a href="/recipes/tags/microarray/">microarray</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/rnaseq/">rnaseq</a>).
Revision 2.
</p>
<p>A python class that performs hierarchical clustering and displays a heatmap using scipy and matplotlib. Improved to be require only as input a pandas DataFrame.</p>
A simple KD Tree example with custom Euclidean distance ball query. (Python)
2013-01-24T10:28:24-08:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578434-a-simple-kd-tree-example-with-custom-euclidean-dis/
<p style="color: grey">
Python
recipe 578434
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>In computer science, a k-d tree (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space. k-d trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g. range searches and nearest neighbor searches). k-d trees are a special case of binary space partitioning trees.</p>
<p><a href="http://en.wikipedia.org/wiki/K-d_tree" rel="nofollow">http://en.wikipedia.org/wiki/K-d_tree</a></p>
Hierarchical Clustering Heatmap Python (Python)
2012-06-26T07:29:22-07:00Nathan Salomonishttp://code.activestate.com/recipes/users/4182587/http://code.activestate.com/recipes/578175-hierarchical-clustering-heatmap-python/
<p style="color: grey">
Python
recipe 578175
by <a href="/recipes/users/4182587/">Nathan Salomonis</a>
(<a href="/recipes/tags/clustering/">clustering</a>, <a href="/recipes/tags/heatmap/">heatmap</a>, <a href="/recipes/tags/hierarchical/">hierarchical</a>, <a href="/recipes/tags/microarray/">microarray</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/rnaseq/">rnaseq</a>).
</p>
<p>Python script that performs hierarchical clustering (scipy) on an input tab-delimited text file (command-line) along with optional column and row clustering parameters or color gradients for heatmap visualization (matplotlib). Designed particularly for transcriptome data clustering and data analyses (e.g., microarray or RNA-Seq). For example: $python hierarchical_clustering.py --i /Users/me/logfolds.txt</p>
Speeding up computations using a lookup table part I (Python)
2011-07-02T15:14:33-07:00Kaushik Ghosehttp://code.activestate.com/recipes/users/4166965/http://code.activestate.com/recipes/577776-speeding-up-computations-using-a-lookup-table-part/
<p style="color: grey">
Python
recipe 577776
by <a href="/recipes/users/4166965/">Kaushik Ghose</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/matplotlib/">matplotlib</a>, <a href="/recipes/tags/optimization/">optimization</a>).
</p>
<p>I needed to use the cumulative normal distribution and normal probability density functions repeatedly for some data analysis. I found that I could speed things up drastically by using a lookup table and matplotlib's builtin interpolation function.</p>
Convolving Gaussian (Python)
2009-05-19T05:23:48-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/576764-convolving-gaussian/
<p style="color: grey">
Python
recipe 576764
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/mathematics/">mathematics</a>).
</p>
<p>Convolving Gaussian</p>
Newton Raphson Root Finding (Python)
2009-05-19T05:18:00-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/576762-newton-raphson-root-finding/
<p style="color: grey">
Python
recipe 576762
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/numerical/">numerical</a>, <a href="/recipes/tags/scipy/">scipy</a>).
</p>
<p>Newton Raphson Root Finding</p>
Quick Numerical Integration (Python)
2009-05-19T05:24:37-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/576765-quick-numerical-integration/
<p style="color: grey">
Python
recipe 576765
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/integration/">integration</a>, <a href="/recipes/tags/scipy/">scipy</a>).
</p>
<p>Quick Numerical Integration</p>
Code to solve Smoluchowsky Equation (Python)
2008-10-31T06:25:13-07:00Lorenzo Isellahttp://code.activestate.com/recipes/users/4143130/http://code.activestate.com/recipes/576547-code-to-solve-smoluchowsky-equation/
<p style="color: grey">
Python
recipe 576547
by <a href="/recipes/users/4143130/">Lorenzo Isella</a>
(<a href="/recipes/tags/email_sending/">email_sending</a>, <a href="/recipes/tags/nonlinear/">nonlinear</a>, <a href="/recipes/tags/pylab/">pylab</a>, <a href="/recipes/tags/scipy/">scipy</a>, <a href="/recipes/tags/smoluchowski/">smoluchowski</a>).
</p>
<p>This is a research code which solves Smoluchowski equation for coalescing particles. It also can login into a gmail account (login data to be obviously provided by the user) and send an email with one of the generated output pdf files as an attachment.</p>
principal component analysis (Python)
2009-07-29T06:18:40-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/576459-principal-component-analysis/
<p style="color: grey">
Python
recipe 576459
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/eigenvectors/">eigenvectors</a>).
Revision 2.
</p>
<p>simple pca</p>
Calculate the distance matrix for n-dimensional point array (Python)
2006-11-11T22:56:49-08:00Willi Richerthttp://code.activestate.com/recipes/users/4003859/http://code.activestate.com/recipes/498246-calculate-the-distance-matrix-for-n-dimensional-po/
<p style="color: grey">
Python
recipe 498246
by <a href="/recipes/users/4003859/">Willi Richert</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>).
Revision 3.
</p>
<p>Three ways to calculate a distance matrix out of a list of n-dimensional points using scipy.</p>