* This routine creates a spherical prototype data structure to * approximate the samples in the specified cluster. * Spherical prototypes have a single variance which is * common across all dimensions. All dimensions are normally * distributed and independent. * @param N number of dimensions * @param Cluster cluster to be made into a spherical prototype * @param Statistics statistical inf
| 1503 | * @note History: 6/19/89, DSJ, Created. |
| 1504 | */ |
| 1505 | PROTOTYPE *NewSphericalProto(uinT16 N, |
| 1506 | CLUSTER *Cluster, |
| 1507 | STATISTICS *Statistics) { |
| 1508 | PROTOTYPE *Proto; |
| 1509 | |
| 1510 | Proto = NewSimpleProto (N, Cluster); |
| 1511 | |
| 1512 | Proto->Variance.Spherical = Statistics->AvgVariance; |
| 1513 | if (Proto->Variance.Spherical < MINVARIANCE) |
| 1514 | Proto->Variance.Spherical = MINVARIANCE; |
| 1515 | |
| 1516 | Proto->Magnitude.Spherical = |
| 1517 | 1.0 / sqrt ((double) (2.0 * PI * Proto->Variance.Spherical)); |
| 1518 | Proto->TotalMagnitude = (float)pow((double)Proto->Magnitude.Spherical, |
| 1519 | (double) N); |
| 1520 | Proto->Weight.Spherical = 1.0 / Proto->Variance.Spherical; |
| 1521 | Proto->LogMagnitude = log ((double) Proto->TotalMagnitude); |
| 1522 | |
| 1523 | return (Proto); |
| 1524 | } // NewSphericalProto |
| 1525 | |
| 1526 | /** |
| 1527 | * This routine creates an elliptical prototype data structure to |
no test coverage detected