PDL::Gaussian

PDL::Gaussian provides a set of standard routines to handle sets gaussian distributions.
Download

PDL::Gaussian Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tuomas J. Lukka
  • Publisher web site:
  • http://search.cpan.org/~lukka/WeakRef-0.01/WeakRef.pm

PDL::Gaussian Tags


PDL::Gaussian Description

PDL::Gaussian provides a set of standard routines to handle sets gaussian distributions. PDL::Gaussian provides a set of standard routines to handle sets gaussian distributions.SYNOPSIS $a = new PDL::Gaussian(,); $a->set_covariance(...)A new set of gaussians is initialized by $a = new PDL::Gaussian(xdims,gdims);Where xdims is a reference to an array containing the dimensions in the space the gaussian is in and gdimslist is a reference to an array containing the dimensionality of the gaussian space. For example, after $a = new PDL::Gaussian(,); $b = new PDL::Gaussian([],[]);The variable $a contains set of 12 (=3*4) 2-Dimensional gaussians and $b is the simplest form: one 1D gaussian. Currently, xdims may containe either zero or one dimensions due to limitations of PDL::PP.To set the distribution parameters, you can use the routines $a->set_covariance($cv); # covariance matrices $a->set_icovariance($icv); # inverse covariance matrices $a->set_mu($mu); # centersThe dimensions of $cv and $icv must be (@xdims,@xdims,@gdims) and the dimensions of $mu must be (@xdims,@gdims).Alternatively you can use the routines $cv = $a->get_covariance(); # cv = reference to covariance matrix ... # Fuzz around with cv $a->upd_covariance(); # updateand similarly for icovariance (inverse covariance). The last sub call is important to update the other parts of the object.To get a string representation of the gaussians (most useful for debugging) use the routine $string = $a->asstr();It is possible to calculate the probability or logarithm of probability of each of the distributions at some points. $a->calc_value($x,$p); $a->calc_lnvalue($x,$p);Here, $x must have dimensions (ndims,...) and $p must have dimensions (gdimslist, ...) where the elipsis represents the same dimensions in both variables. It is usually advisable to work with the logarithms of probabilities to avoid numerical problems.It is possible to generate the parameters for the gaussians from data. The function $a->fromweighteddata($data,$wt,$small_covariance);where $data is of dimensions (ndims,npoints) and $wt is of dimensions (npoints,gdimslist), analyzes the data statistically and gives a corresponding gaussian distribution. The parameter $small_covariance is the smallest allowed covariance in any direction: if one or more of the eigenvalues of the covariance matrix are smaller than this, they are automatically set to $small_covariance to avoid singularities.Requirements:· Perl


PDL::Gaussian Related Software