Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15443


Ignore:
Timestamp:
11/01/17 18:05:36 (7 years ago)
Author:
gkronber
Message:

#2789 added interface to CUBGCV using DllImport of Fortran library

Location:
branches/MathNetNumerics-Exploration-2789
Files:
11 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/MathNetNumerics-Exploration-2789/HeuristicLab.Algorithms.DataAnalysis.Experimental/642.f

    r15442 r15443  
     1       MODULE MODCUBGCV
     2       CONTAINS
    13C     ALGORITHM 642 COLLECTED ALGORITHMS FROM ACM.
    24C     ALGORITHM APPEARED IN ACM-TRANS. MATH. SOFTWARE, VOL.12, NO. 2,
     
    128130C-----------------------------------------------------------------------
    129131C
    130       SUBROUTINE CUBGCV(X,F,DF,N,Y,C,IC,VAR,JOB,SE,WK,IER)
     132       SUBROUTINE CUBGCV(X,F,DF,N,Y,C,IC,VAR,JOB,SE,WK,IER)
     133     . BIND(C, NAME='cubgcv')
     134      USE ISO_C_BINDING
    131135C
    132136C---SPECIFICATIONS FOR ARGUMENTS---
     
    247251  150 RETURN
    248252      END
     253C     *******************************************************
    249254      SUBROUTINE SPINT1(X,AVH,Y,DY,AVDY,N,A,C,IC,R,T,IER)
    250255C
     
    529534      RETURN
    530535      END
    531 C CUBGCV TEST DRIVER
    532 C ------------------
    533 C
    534 C AUTHOR          - M.F.HUTCHINSON
    535 C                   CSIRO DIVISION OF WATER AND LAND RESOURCES
    536 C                   GPO BOX 1666
    537 C                   CANBERRA ACT 2601
    538 C                   AUSTRALIA
    539 C
    540 C LATEST REVISION - 7 AUGUST 1986
    541 C
    542 C COMPUTER        - VAX/DOUBLE
    543 C
    544 C USAGE           - MAIN PROGRAM
    545 C
    546 C REQUIRED ROUTINES - CUBGCV,SPINT1,SPFIT1,SPCOF1,SPERR1,GGRAND
    547 C
    548 C REMARKS   USES SUBROUTINE CUBGCV TO FIT A CUBIC SMOOTHING SPLINE
    549 C           TO 50 DATA POINTS WHICH ARE GENERATED BY ADDING A RANDOM
    550 C           VARIABLE WITH UNIFORM DENSITY IN THE INTERVAL [-0.3,0.3]
    551 C           TO 50 POINTS SAMPLED FROM THE CURVE  Y=SIN(3*PI*X/2).
    552 C           RANDOM DEVIATES IN THE INTERVAL [0,1] ARE GENERATED BY THE
    553 C           DOUBLE PRECISION FUNCTION GGRAND (SIMILAR TO IMSL FUNCTION
    554 C           GGUBFS).  THE ABSCISSAE ARE UNEQUALLY SPACED IN [0,1].
    555 C
    556 C           POINT STANDARD ERROR ESTIMATES ARE RETURNED IN SE BY
    557 C           SETTING JOB=1.  THE ERROR VARIANCE ESTIMATE IS RETURNED
    558 C           IN VAR.  IT COMPARES FAVOURABLY WITH THE TRUE VALUE OF 0.03.
    559 C           SUMMARY STATISTICS FROM THE ARRAY WK ARE WRITTEN TO
    560 C           UNIT 6.  DATA VALUES AND FITTED VALUES WITH ESTIMATED
    561 C           STANDARD ERRORS ARE ALSO WRITTEN TO UNIT 6.
    562 C
    563       PARAMETER (N=50, IC=49)
    564 C
    565       INTEGER            JOB,IER
    566       DOUBLE PRECISION   X(N),F(N),Y(N),DF(N),C(IC,3),WK(7*(N+2)),
    567      *                   VAR,SE(N)
    568       DOUBLE PRECISION   GGRAND,DSEED
    569 C
    570 C---INITIALIZE---
    571       DSEED=1.2345D4
    572       JOB=1
    573       VAR=-1.0D0
    574 C
    575 C---CALCULATE DATA POINTS---
    576       DO 10 I=1,N
    577       X(I)=(I - 0.5)/N + (2.0*GGRAND(DSEED) - 1.0)/(3.0*N)
    578       F(I)=DSIN(4.71238*X(I)) + (2.0*GGRAND(DSEED) - 1.0)*0.3
    579       DF(I)=1.0D0
    580   10  CONTINUE
    581 C
    582 C---FIT CUBIC SPLINE---
    583       CALL CUBGCV(X,F,DF,N,Y,C,IC,VAR,JOB,SE,WK,IER)
    584 C
    585 C---WRITE OUT RESULTS---
    586       WRITE(6,20)
    587   20  FORMAT(' CUBGCV TEST DRIVER RESULTS:')
    588       WRITE(6,30) IER,VAR,WK(3),WK(4),WK(2)
    589   30  FORMAT(/' IER =',I4/' VAR =',F7.4/
    590      *        ' GENERALIZED CROSS VALIDATION =',F7.4/
    591      *        ' MEAN SQUARE RESIDUAL         =',F7.4/
    592      *        ' RESIDUAL DEGREES OF FREEDOM  =',F7.2)
    593       WRITE(6,40)
    594   40  FORMAT(/' INPUT DATA',17X,'OUTPUT RESULTS'//
    595      *         '   I    X(I)    F(I)',6X,'    Y(I)   SE(I)',
    596      *          '      C(I,1)      C(I,2)      C(I,3)')
    597       DO 60 I=1,N-1
    598       WRITE(6,50) I,X(I),F(I),Y(I),SE(I),(C(I,J),J=1,3)
    599   50  FORMAT(I4,2F8.4,6X,2F8.4,3E12.4)
    600   60  CONTINUE
    601       WRITE(6,50) N,X(N),F(N),Y(N),SE(N)
    602       STOP
    603       END
    604       DOUBLE PRECISION FUNCTION GGRAND(DSEED)
    605 C
    606 C DOUBLE PRECISION UNIFORM RANDOM NUMBER GENERATOR
    607 C
    608 C CONSTANTS: A = 7**5
    609 C            B = 2**31 - 1
    610 C            C = 2**31
    611 C
    612 C REFERENCE: IMSL MANUAL, CHAPTER G - GENERATION AND TESTING OF
    613 C                                     RANDOM NUMBERS
    614 C
    615 C---SPECIFICATIONS FOR ARGUMENTS---
    616       DOUBLE PRECISION DSEED
    617 C
    618 C---SPECIFICATIONS FOR LOCAL VARIABLES---
    619       DOUBLE PRECISION A,B,C,S
    620 C
    621       DATA A,B,C/16807.0D0, 2147483647.0D0, 2147483648.0D0/
    622 C
    623       S=DSEED
    624       S=DMOD(A*S, B)
    625       GGRAND=S/C
    626       DSEED=S
    627       RETURN
    628       END
    629 
    630 CUBGCV TEST DRIVER RESULTS:
    631 
    632 IER =   0
    633 VAR = 0.0279
    634 GENERALIZED CROSS VALIDATION = 0.0318
    635 MEAN SQUARE RESIDUAL         = 0.0246
    636 RESIDUAL DEGREES OF FREEDOM  =  43.97
    637 
    638 INPUT DATA                 OUTPUT RESULTS
    639 
    640   I    X(I)    F(I)          Y(I)   SE(I)      C(I,1)      C(I,2)      C(I,3)
    641   1  0.0046  0.2222        0.0342  0.1004  0.3630E+01  0.0000E+00  0.2542E+02
    642   2  0.0360 -0.1098        0.1488  0.0750  0.3705E+01  0.2391E+01 -0.9537E+01
    643   3  0.0435 -0.0658        0.1767  0.0707  0.3740E+01  0.2175E+01 -0.4233E+02
    644   4  0.0735  0.3906        0.2900  0.0594  0.3756E+01 -0.1642E+01 -0.2872E+02
    645   5  0.0955  0.6054        0.3714  0.0558  0.3642E+01 -0.3535E+01  0.2911E+01
    646   6  0.1078  0.3034        0.4155  0.0549  0.3557E+01 -0.3428E+01 -0.1225E+02
    647   7  0.1269  0.7386        0.4822  0.0544  0.3412E+01 -0.4131E+01  0.2242E+02
    648   8  0.1565  0.4616        0.5800  0.0543  0.3227E+01 -0.2143E+01  0.6415E+01
    649   9  0.1679  0.4315        0.6165  0.0543  0.3180E+01 -0.1923E+01 -0.1860E+02
    650  10  0.1869  0.5716        0.6762  0.0544  0.3087E+01 -0.2985E+01 -0.3274E+02
    651  11  0.2149  0.6736        0.7595  0.0542  0.2843E+01 -0.5733E+01 -0.4435E+02
    652  12  0.2356  0.7388        0.8155  0.0539  0.2549E+01 -0.8486E+01 -0.5472E+02
    653  13  0.2557  1.1953        0.8630  0.0537  0.2139E+01 -0.1180E+02 -0.9784E+01
    654  14  0.2674  1.0299        0.8864  0.0536  0.1860E+01 -0.1214E+02  0.9619E+01
    655  15  0.2902  0.7981        0.9225  0.0534  0.1322E+01 -0.1149E+02 -0.7202E+01
    656  16  0.3155  0.8973        0.9485  0.0532  0.7269E+00 -0.1203E+02 -0.1412E+02
    657  17  0.3364  1.2695        0.9583  0.0530  0.2040E+00 -0.1292E+02  0.2796E+02
    658  18  0.3557  0.7253        0.9577  0.0527 -0.2638E+00 -0.1130E+02 -0.3453E+01
    659  19  0.3756  1.2127        0.9479  0.0526 -0.7176E+00 -0.1151E+02  0.3235E+02
    660  20  0.3881  0.7304        0.9373  0.0525 -0.9889E+00 -0.1030E+02  0.4381E+01
    661  21  0.4126  0.9810        0.9069  0.0525 -0.1486E+01 -0.9977E+01  0.1440E+02
    662  22  0.4266  0.7117        0.8842  0.0525 -0.1756E+01 -0.9373E+01 -0.8925E+01
    663  23  0.4566  0.7203        0.8227  0.0524 -0.2344E+01 -0.1018E+02 -0.2278E+02
    664  24  0.4704  0.9242        0.7884  0.0524 -0.2637E+01 -0.1112E+02 -0.4419E+01
    665  25  0.4914  0.7345        0.7281  0.0523 -0.3110E+01 -0.1140E+02 -0.3562E+01
    666  26  0.5084  0.7378        0.6720  0.0524 -0.3500E+01 -0.1158E+02  0.5336E+01
    667  27  0.5277  0.7441        0.6002  0.0525 -0.3941E+01 -0.1127E+02  0.2479E+02
    668  28  0.5450  0.5612        0.5286  0.0527 -0.4310E+01 -0.9980E+01  0.2920E+02
    669  29  0.5641  0.5049        0.4429  0.0529 -0.4659E+01 -0.8309E+01  0.3758E+02
    670  30  0.5857  0.4725        0.3390  0.0531 -0.4964E+01 -0.5878E+01  0.5563E+02
    671  31  0.6159  0.1380        0.1850  0.0531 -0.5167E+01 -0.8307E+00  0.4928E+02
    672  32  0.6317  0.1412        0.1036  0.0531 -0.5157E+01  0.1499E+01  0.5437E+02
    673  33  0.6446 -0.1110        0.0371  0.0531 -0.5091E+01  0.3614E+01  0.3434E+02
    674  34  0.6707 -0.2605       -0.0927  0.0532 -0.4832E+01  0.6302E+01  0.1164E+02
    675  35  0.6853 -0.1284       -0.1619  0.0533 -0.4640E+01  0.6812E+01  0.1617E+02
    676  36  0.7064 -0.3452       -0.2564  0.0536 -0.4332E+01  0.7834E+01  0.4164E+01
    677  37  0.7310 -0.5527       -0.3582  0.0538 -0.3939E+01  0.8141E+01 -0.2214E+02
    678  38  0.7531 -0.3459       -0.4415  0.0540 -0.3611E+01  0.6674E+01 -0.9205E+01
    679  39  0.7686 -0.5902       -0.4961  0.0541 -0.3410E+01  0.6245E+01 -0.2193E+02
    680  40  0.7952 -0.7644       -0.5828  0.0541 -0.3125E+01  0.4494E+01 -0.4649E+02
    681  41  0.8087 -0.5392       -0.6242  0.0541 -0.3029E+01  0.2614E+01 -0.3499E+02
    682  42  0.8352 -0.4247       -0.7031  0.0539 -0.2964E+01 -0.1603E+00  0.2646E+01
    683  43  0.8501 -0.6327       -0.7476  0.0538 -0.2967E+01 -0.4132E-01  0.1817E+02
    684  44  0.8726 -0.9983       -0.8139  0.0538 -0.2942E+01  0.1180E+01 -0.6774E+01
    685  45  0.8874 -0.9082       -0.8574  0.0542 -0.2911E+01  0.8778E+00 -0.1364E+02
    686  46  0.9139 -0.8930       -0.9340  0.0566 -0.2893E+01 -0.2044E+00 -0.8094E+01
    687  47  0.9271 -1.0233       -0.9723  0.0593 -0.2903E+01 -0.5258E+00 -0.1498E+02
    688  48  0.9473 -0.8839       -1.0313  0.0665 -0.2942E+01 -0.1433E+01  0.4945E+01
    689  49  0.9652 -1.0172       -1.0843  0.0766 -0.2989E+01 -0.1168E+01  0.1401E+02
    690  50  0.9930 -1.2715       -1.1679  0.0998
    691 Documentation:
    692 C   COMPUTER            - VAX/DOUBLE
    693 C
    694 C   AUTHOR              - M.F.HUTCHINSON
    695 C                         CSIRO DIVISION OF MATHEMATICS AND STATISTICS
    696 C                         P.O. BOX 1965
    697 C                         CANBERRA, ACT 2601
    698 C                         AUSTRALIA
    699 C
    700 C   LATEST REVISION     - 15 AUGUST 1985
    701 C
    702 C   PURPOSE             - CUBIC SPLINE DATA SMOOTHER
    703 C
    704 C   USAGE               - CALL CUBGCV (X,F,DF,N,Y,C,IC,VAR,JOB,SE,WK,IER)
    705 C
    706 C   ARGUMENTS    X      - VECTOR OF LENGTH N CONTAINING THE
    707 C                           ABSCISSAE OF THE N DATA POINTS
    708 C                           (X(I),F(I)) I=1..N. (INPUT) X
    709 C                           MUST BE ORDERED SO THAT
    710 C                           X(I) .LT. X(I+1).
    711 C                F      - VECTOR OF LENGTH N CONTAINING THE
    712 C                           ORDINATES (OR FUNCTION VALUES)
    713 C                           OF THE N DATA POINTS (INPUT).
    714 C                DF     - VECTOR OF LENGTH N. (INPUT/OUTPUT)
    715 C                           DF(I) IS THE RELATIVE STANDARD DEVIATION
    716 C                           OF THE ERROR ASSOCIATED WITH DATA POINT I.
    717 C                           EACH DF(I) MUST BE POSITIVE.  THE VALUES IN
    718 C                           DF ARE SCALED BY THE SUBROUTINE SO THAT
    719 C                           THEIR MEAN SQUARE VALUE IS 1, AND UNSCALED
    720 C                           AGAIN ON NORMAL EXIT.
    721 C                           THE MEAN SQUARE VALUE OF THE DF(I) IS RETURNED
    722 C                           IN WK(7) ON NORMAL EXIT.
    723 C                           IF THE ABSOLUTE STANDARD DEVIATIONS ARE KNOWN,
    724 C                           THESE SHOULD BE PROVIDED IN DF AND THE ERROR
    725 C                           VARIANCE PARAMETER VAR (SEE BELOW) SHOULD THEN
    726 C                           BE SET TO 1.
    727 C                           IF THE RELATIVE STANDARD DEVIATIONS ARE UNKNOWN,
    728 C                           SET EACH DF(I)=1.
    729 C                N      - NUMBER OF DATA POINTS (INPUT).
    730 C                           N MUST BE .GE. 3.
    731 C                Y,C    - SPLINE COEFFICIENTS. (OUTPUT) Y
    732 C                           IS A VECTOR OF LENGTH N. C IS
    733 C                           AN N-1 BY 3 MATRIX. THE VALUE
    734 C                           OF THE SPLINE APPROXIMATION AT T IS
    735 C                           S(T)=((C(I,3)*D+C(I,2))*D+C(I,1))*D+Y(I)
    736 C                           WHERE X(I).LE.T.LT.X(I+1) AND
    737 C                           D = T-X(I).
    738 C                IC     - ROW DIMENSION OF MATRIX C EXACTLY
    739 C                           AS SPECIFIED IN THE DIMENSION
    740 C                           STATEMENT IN THE CALLING PROGRAM. (INPUT)
    741 C                VAR    - ERROR VARIANCE. (INPUT/OUTPUT)
    742 C                           IF VAR IS NEGATIVE (I.E. UNKNOWN) THEN
    743 C                           THE SMOOTHING PARAMETER IS DETERMINED
    744 C                           BY MINIMIZING THE GENERALIZED CROSS VALIDATION
    745 C                           AND AN ESTIMATE OF THE ERROR VARIANCE IS
    746 C                           RETURNED IN VAR.
    747 C                           IF VAR IS NON-NEGATIVE (I.E. KNOWN) THEN THE
    748 C                           SMOOTHING PARAMETER IS DETERMINED TO MINIMIZE
    749 C                           AN ESTIMATE, WHICH DEPENDS ON VAR, OF THE TRUE
    750 C                           MEAN SQUARE ERROR, AND VAR IS UNCHANGED.
    751 C                           IN PARTICULAR, IF VAR IS ZERO, THEN AN
    752 C                           INTERPOLATING NATURAL CUBIC SPLINE IS CALCULATED.
    753 C                           VAR SHOULD BE SET TO 1 IF ABSOLUTE STANDARD
    754 C                           DEVIATIONS HAVE BEEN PROVIDED IN DF (SEE ABOVE).
    755 C                JOB    - JOB SELECTION PARAMETER. (INPUT)
    756 C                         JOB = 0 SHOULD BE SELECTED IF POINT STANDARD ERROR
    757 C                           ESTIMATES ARE NOT REQUIRED IN SE.
    758 C                         JOB = 1 SHOULD BE SELECTED IF POINT STANDARD ERROR
    759 C                           ESTIMATES ARE REQUIRED IN SE.
    760 C                SE     - VECTOR OF LENGTH N CONTAINING BAYESIAN STANDARD
    761 C                           ERROR ESTIMATES OF THE FITTED SPLINE VALUES IN Y.
    762 C                           SE IS NOT REFERENCED IF JOB=0. (OUTPUT)
    763 C                WK     - WORK VECTOR OF LENGTH 7*(N + 2). ON NORMAL EXIT THE
    764 C                           FIRST 7 VALUES OF WK ARE ASSIGNED AS FOLLOWS:-
    765 C
    766 C                           WK(1) = SMOOTHING PARAMETER (= RHO/(RHO + 1))
    767 C                           WK(2) = ESTIMATE OF THE NUMBER OF DEGREES OF
    768 C                                   FREEDOM OF THE RESIDUAL SUM OF SQUARES
    769 C                           WK(3) = GENERALIZED CROSS VALIDATION
    770 C                           WK(4) = MEAN SQUARE RESIDUAL
    771 C                           WK(5) = ESTIMATE OF THE TRUE MEAN SQUARE ERROR
    772 C                                   AT THE DATA POINTS
    773 C                           WK(6) = ESTIMATE OF THE ERROR VARIANCE
    774 C                           WK(7) = MEAN SQUARE VALUE OF THE DF(I)
    775 C
    776 C                           IF WK(1)=0 (RHO=0) AN INTERPOLATING NATURAL CUBIC
    777 C                           SPLINE HAS BEEN CALCULATED.
    778 C                           IF WK(1)=1 (RHO=INFINITE) A LEAST SQUARES
    779 C                           REGRESSION LINE HAS BEEN CALCULATED.
    780 C                           WK(2) IS AN ESTIMATE OF THE NUMBER OF DEGREES OF
    781 C                           FREEDOM OF THE RESIDUAL WHICH REDUCES TO THE
    782 C                           USUAL VALUE OF N-2 WHEN A LEAST SQUARES REGRESSION
    783 C                           LINE IS CALCULATED.
    784 C                           WK(3),WK(4),WK(5) ARE CALCULATED WITH THE DF(I)
    785 C                           SCALED TO HAVE MEAN SQUARE VALUE 1.  THE
    786 C                           UNSCALED VALUES OF WK(3),WK(4),WK(5) MAY BE
    787 C                           CALCULATED BY DIVIDING BY WK(7).
    788 C                           WK(6) COINCIDES WITH THE OUTPUT VALUE OF VAR IF
    789 C                           VAR IS NEGATIVE ON INPUT.  IT IS CALCULATED WITH
    790 C                           THE UNSCALED VALUES OF THE DF(I) TO FACILITATE
    791 C                           COMPARISONS WITH A PRIORI VARIANCE ESTIMATES.
    792 C
    793 C                IER    - ERROR PARAMETER. (OUTPUT)
    794 C                         TERMINAL ERROR
    795 C                           IER = 129, IC IS LESS THAN N-1.
    796 C                           IER = 130, N IS LESS THAN 3.
    797 C                           IER = 131, INPUT ABSCISSAE ARE NOT
    798 C                             ORDERED SO THAT X(I).LT.X(I+1).
    799 C                           IER = 132, DF(I) IS NOT POSITIVE FOR SOME I.
    800 C                           IER = 133, JOB IS NOT 0 OR 1.
    801 C
    802 C   PRECISION/HARDWARE  - DOUBLE
    803 C
    804 C   REQUIRED ROUTINES   - SPINT1,SPFIT1,SPCOF1,SPERR1
    805 C
    806 C   REMARKS      THE NUMBER OF ARITHMETIC OPERATIONS REQUIRED BY THE
    807 C                SUBROUTINE IS PROPORTIONAL TO N.  THE SUBROUTINE
    808 C                USES AN ALGORITHM DEVELOPED BY M.F. HUTCHINSON AND
    809 C                F.R. DE HOOG, 'SMOOTHING NOISY DATA WITH SPLINE
    810 C                FUNCTIONS', NUMER. MATH. (IN PRESS)
    811 C
    812 C-----------------------------------------------------------------------
    813 C
    814 
    815 
    816 ALGORITHM
    817 
    818 CUBGCV calculates a natural cubic spline curve which smoothes a given set
    819 of data points, using statistical considerations to determine the amount
    820 of smoothing required, as described in reference 2.  If the error variance
    821 is known, it should be supplied to the routine in VAR.  The degree of
    822 smoothing is then determined by minimizing an unbiased estimate of the true
    823 mean square error.  On the other hand, if the error variance is not known, VAR
    824 should be set to -1.0.  The routine then determines the degree of smoothing
    825 by minimizing the generalized cross validation.  This is asymptotically the
    826 same as minimizing the true mean square error (see reference 1).  In this
    827 case, an estimate of the error variance is returned in VAR which may be
    828 compared with any a priori approximate estimates.  In either case, an
    829 estimate of the true mean square error is returned in WK(5).  This estimate,
    830 however, depends on the error variance estimate, and should only be accepted
    831 if the error variance estimate is reckoned to be correct.
    832 
    833 If job is set to 1, bayesian estimates of the standard error of each
    834 smoothed data value are returned in the array SE.  These also depend on
    835 the error variance estimate and should only be accepted if the error
    836 variance estimate is reckoned to be correct.  See reference 4.
    837 
    838 The number of arithmetic operations and the amount of storage required by
    839 the routine are both proportional to N, so that very large data sets may be
    840 analysed.  The data points do not have to be equally spaced or uniformly
    841 weighted.  The residual and the spline coefficients are calculated in the
    842 manner described in reference 3, while the trace and various statistics,
    843 including the generalized cross validation, are calculated in the manner
    844 described in reference 2.
    845 
    846 When VAR is known, any value of N greater than 2 is acceptable.  It is
    847 advisable, however, for N to be greater than about 20 when VAR is unknown.
    848 If the degree of smoothing done by CUBGCV when VAR is unknown is not
    849 satisfactory, the user should try specifying the degree of smoothing by
    850 setting VAR to a reasonable value.
    851 
    852 References:
    853 
    854 1.  Craven, Peter and Wahba, Grace, "Smoothing noisy data with spline
    855     functions", Numer. Math. 31, 377-403 (1979).
    856 2.  Hutchinson, M.F. and de Hoog, F.R., "Smoothing noisy data with spline
    857     functions", Numer. Math. (in press).
    858 3.  Reinsch, C.H., "Smoothing by spline functions", Numer. Math. 10,
    859     177-183 (1967).
    860 4.  Wahba, Grace, "Bayesian 'confidence intervals' for the cross-validated
    861     smoothing spline", J.R.Statist. Soc. B 45, 133-150 (1983).
    862 
    863 
    864 Example
    865 
    866 A sequence of 50 data points are generated by adding a random variable with
    867 uniform density in the interval [-0.3,0.3] to the curve y=sin(3*pi*x/2).
    868 The abscissae are unequally spaced in [0,1].  Point standard error estimates
    869 are returned in SE by setting JOB to 1.  The error variance estimate is
    870 returned in VAR.  It compares favourably with the true value of 0.03.
    871 The IMSL function GGUBFS is used to generate sample values of a uniform
    872 variable on [0,1].
    873 
    874 
    875 INPUT:
    876 
    877       INTEGER          N,IC,JOB,IER
    878       DOUBLE PRECISION X(50),F(50),Y(50),DF(50),C(49,3),WK(400),
    879      *                 VAR,SE(50)
    880       DOUBLE PRECISION GGUBFS,DSEED,DN
    881       DATA DSEED/1.2345D4/
    882 C
    883       N=50
    884       IC=49
    885       JOB=1
    886       VAR=-1.0D0
    887       DN=N
    888 C
    889       DO 10 I=1,N
    890       X(I)=(I - 0.5)/DN + (2.0*GGUBFS(DSEED) - 1.0)/(3.0*DN)
    891       F(I)=DSIN(4.71238*X(I)) + (2.0*GGUBFS(DSEED) - 1.0)*0.3
    892       DF(I)=1.0D0
    893   10  CONTINUE
    894       CALL CUBGCV(X,F,DF,N,Y,C,IC,VAR,JOB,SE,WK,IER)
    895        .
    896        .
    897        .
    898       END
    899 
    900 OUTPUT:
    901 
    902 IER = 0
    903 VAR = 0.0279
    904 GENERALIZED CROSS VALIDATION = 0.0318
    905 MEAN SQUARE RESIDUAL = 0.0246
    906 RESIDUAL DEGREES OF FREEDOM = 43.97
    907 FOR CHECKING PURPOSES THE FOLLOWING OUTPUT IS GIVEN:
    908 
    909 X(1)  = 0.0046    F(1)  =  0.2222     Y(1)  =  0.0342     SE(1)  = 0.1004
    910 X(21) = 0.4126    F(21) =  0.9810     Y(21) =  0.9069     SE(21) = 0.0525
    911 X(41) = 0.8087    F(41) = -0.5392     Y(41) = -0.6242     SE(41) = 0.0541
    912 
     536      END MODULE
  • branches/MathNetNumerics-Exploration-2789/HeuristicLab.Algorithms.DataAnalysis.Experimental/HeuristicLab.Algorithms.DataAnalysis.Experimental.csproj

    r15364 r15443  
    3333    <WarningLevel>4</WarningLevel>
    3434  </PropertyGroup>
     35  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     36    <DebugSymbols>true</DebugSymbols>
     37    <OutputPath>bin\x86\Debug\</OutputPath>
     38    <DefineConstants>DEBUG;TRACE</DefineConstants>
     39    <DebugType>full</DebugType>
     40    <PlatformTarget>x86</PlatformTarget>
     41    <ErrorReport>prompt</ErrorReport>
     42    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     43  </PropertyGroup>
     44  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     45    <OutputPath>bin\x86\Release\</OutputPath>
     46    <DefineConstants>TRACE</DefineConstants>
     47    <Optimize>true</Optimize>
     48    <DebugType>pdbonly</DebugType>
     49    <PlatformTarget>x86</PlatformTarget>
     50    <ErrorReport>prompt</ErrorReport>
     51    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     52  </PropertyGroup>
    3553  <ItemGroup>
    3654    <Reference Include="alglibnet2, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
     
    133151  </ItemGroup>
    134152  <ItemGroup>
     153    <Compile Include="CubicSplineGCV.cs" />
    135154    <Compile Include="ForwardSelection.cs" />
    136155    <Compile Include="GAM.cs" />
     
    150169  </ItemGroup>
    151170  <ItemGroup>
     171    <Content Include="642_x86.dll">
     172      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     173    </Content>
    152174    <Content Include="alglibnet2.dll">
    153175      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  • branches/MathNetNumerics-Exploration-2789/HeuristicLab.ExtLibs.MathNetNumerics/HeuristicLab.ExtLibs.MathNetNumerics.csproj

    r14991 r15443  
    3232    <ErrorReport>prompt</ErrorReport>
    3333    <WarningLevel>4</WarningLevel>
     34  </PropertyGroup>
     35  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     36    <DebugSymbols>true</DebugSymbols>
     37    <OutputPath>bin\x86\Debug\</OutputPath>
     38    <DefineConstants>DEBUG;TRACE</DefineConstants>
     39    <DebugType>full</DebugType>
     40    <PlatformTarget>x86</PlatformTarget>
     41    <ErrorReport>prompt</ErrorReport>
     42    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     43  </PropertyGroup>
     44  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     45    <OutputPath>bin\x86\Release\</OutputPath>
     46    <DefineConstants>TRACE</DefineConstants>
     47    <Optimize>true</Optimize>
     48    <DebugType>pdbonly</DebugType>
     49    <PlatformTarget>x86</PlatformTarget>
     50    <ErrorReport>prompt</ErrorReport>
     51    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    3452  </PropertyGroup>
    3553  <ItemGroup>
  • branches/MathNetNumerics-Exploration-2789/MathNetNumerics-Exploration.sln

    r15313 r15443  
    1010Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{F5F7CF4D-F560-4B26-9552-21F2DE441F1F}"
    1111EndProject
     12Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main", "Main\Main.csproj", "{2A18146C-C727-4B58-AD69-D175275FE97F}"
     13EndProject
    1214Global
    1315  GlobalSection(SolutionConfigurationPlatforms) = preSolution
    1416    Debug|Any CPU = Debug|Any CPU
     17    Debug|x86 = Debug|x86
    1518    Release|Any CPU = Release|Any CPU
     19    Release|x86 = Release|x86
    1620  EndGlobalSection
    1721  GlobalSection(ProjectConfigurationPlatforms) = postSolution
    1822    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    1923    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
     24    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Debug|x86.ActiveCfg = Debug|x86
     25    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Debug|x86.Build.0 = Debug|x86
    2026    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2127    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Release|Any CPU.Build.0 = Release|Any CPU
     28    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Release|x86.ActiveCfg = Release|x86
     29    {FBD82EAE-0D8A-41FA-A8FD-EC3D1574EED5}.Release|x86.Build.0 = Release|x86
    2230    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2331    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
     32    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Debug|x86.ActiveCfg = Debug|x86
     33    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Debug|x86.Build.0 = Debug|x86
    2434    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2535    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Release|Any CPU.Build.0 = Release|Any CPU
     36    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Release|x86.ActiveCfg = Release|x86
     37    {D97F91B5-B71B-412D-90A5-177EED948A3A}.Release|x86.Build.0 = Release|x86
    2638    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2739    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
     40    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Debug|x86.ActiveCfg = Debug|x86
     41    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Debug|x86.Build.0 = Debug|x86
    2842    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2943    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Release|Any CPU.Build.0 = Release|Any CPU
     44    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Release|x86.ActiveCfg = Release|x86
     45    {F5F7CF4D-F560-4B26-9552-21F2DE441F1F}.Release|x86.Build.0 = Release|x86
     46    {2A18146C-C727-4B58-AD69-D175275FE97F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     47    {2A18146C-C727-4B58-AD69-D175275FE97F}.Debug|Any CPU.Build.0 = Debug|Any CPU
     48    {2A18146C-C727-4B58-AD69-D175275FE97F}.Debug|x86.ActiveCfg = Debug|Any CPU
     49    {2A18146C-C727-4B58-AD69-D175275FE97F}.Debug|x86.Build.0 = Debug|Any CPU
     50    {2A18146C-C727-4B58-AD69-D175275FE97F}.Release|Any CPU.ActiveCfg = Release|Any CPU
     51    {2A18146C-C727-4B58-AD69-D175275FE97F}.Release|Any CPU.Build.0 = Release|Any CPU
     52    {2A18146C-C727-4B58-AD69-D175275FE97F}.Release|x86.ActiveCfg = Release|Any CPU
     53    {2A18146C-C727-4B58-AD69-D175275FE97F}.Release|x86.Build.0 = Release|Any CPU
    3054  EndGlobalSection
    3155  GlobalSection(SolutionProperties) = preSolution
  • branches/MathNetNumerics-Exploration-2789/Test/Test.csproj

    r15442 r15443  
    3434    <ErrorReport>prompt</ErrorReport>
    3535    <WarningLevel>4</WarningLevel>
     36  </PropertyGroup>
     37  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     38    <DebugSymbols>true</DebugSymbols>
     39    <OutputPath>bin\x86\Debug\</OutputPath>
     40    <DefineConstants>DEBUG;TRACE</DefineConstants>
     41    <DebugType>full</DebugType>
     42    <PlatformTarget>x86</PlatformTarget>
     43    <ErrorReport>prompt</ErrorReport>
     44    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     45  </PropertyGroup>
     46  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     47    <OutputPath>bin\x86\Release\</OutputPath>
     48    <DefineConstants>TRACE</DefineConstants>
     49    <Optimize>true</Optimize>
     50    <DebugType>pdbonly</DebugType>
     51    <PlatformTarget>x86</PlatformTarget>
     52    <ErrorReport>prompt</ErrorReport>
     53    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    3654  </PropertyGroup>
    3755  <ItemGroup>
  • branches/MathNetNumerics-Exploration-2789/Test/UnitTest1.cs

    r15442 r15443  
    112112
    113113    }
     114     
    114115  }
    115116}
Note: See TracChangeset for help on using the changeset viewer.