This probably belongs in the chat forum, but

The thread about speed of matrix times vector, comparing MATLAB and J, 
has interesting and useful comments, but as an educator I am impatient 
with this type of comparison.

To a math professor, J's strength is its array point of view, its 
well-conceived array operations, and the pleasure of thinking in J.
 
MATLAB's strength is its linear algebra and differential equations 
routines and its competent interface to Maple's symbolic algebra.

I wish Jsoftware could afford to spend the level of effort on linear 
algebra and differential equations that it has put into plotting.  Then 
more professors and students might discover J as a tool for mathematical 
thought.

Kip Murray
Math, University of Houston, Retired


On Thu, 8 Nov 2007, Joey K Tuttle wrote:

  At 11:56  -0800 2007/11/08, Roger Hui wrote:
  >  > There isn't a built in function that
  > >  j uses to generate normal distributions, and writing an equivalent
  > >  to MatLab randn() would be an interesting exercise.
  > 
  >  >From http://www.jsoftware.com/jwiki/Essays/Normal_CDF
  > erf   =: (1 H. 1.5)@*: * 2p_0.5&* % ^@:*:
  > n01cdf=: -: @ >: @ erf @ %&(%:2)
  > 
  > Whence an approximation to randn:
  > ny=: n01cdf nx=: i:5j2000
  > randn=: nx {~ ny I. [EMAIL PROTECTED]&0
  > 
  
  Lovely! In praise for DOJ, erf and n01cdf are given on the
  H. page (although I didn't immediately think to look there :)
  
  There are a couple of subtle differences from the ones above,
  DOJ doesn't include the, apparently redundant, parens of your
  erf and n01cdf differs a bit, but their results are very close
  with no greater than 4.996e_16 difference in your example.
  
  In any case, thanks for the exposition -- certainly in the
  case of timing the original inner product, the generation of
  the random normal distributions should be excluded from the
  timing (as they were in MatLab).
  
  
  ----------------------------------------------------------------------
  For information about J forums see http://www.jsoftware.com/forums.htm
  

Kip Murray

[EMAIL PROTECTED]
http://www.math.uh.edu/~km
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to