Package parsimony :: Package datasets :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Created on Wed Aug 7 10:35:12 2013

Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.


Author: Edouard Duchesnay

License: BSD 3-clause.

Classes [hide private]
  ObjImage
Parameters: ----------- mask: ???
  Square
  Dot
  Dimaond
Functions [hide private]
 
corr_to_coef(v_x, v_e, cov_xe, cor)
In a linear model y = bx + e.
source code
 
get_objects_edges(objects) source code
 
spatial_smoothing(Xim, sigma, mu_e=None, sigma_pix=None) source code
Variables [hide private]
  __package__ = 'parsimony.datasets'
Function Details [hide private]

corr_to_coef(v_x, v_e, cov_xe, cor)

source code 
In a linear model y = bx + e. Calculate b such cor(bx + e, x) = cor.

Parameters
----------
v_x: Float. The variance of x, var(x).

v_e: Float. The variance of e, var(e).

cov_xe: Float. The covariance between x and e, cov(x, e).

cor: Float. The desired correlation.

Examples
--------
>>> corr_to_coef(1, 1, 0, .5)
0.57735026918962573