multiple regression

From: Mike Notaro (mnotaro AT wisc.edu)
Date: Fri May 27 2005 - 13:50:29 MDT

  • Next message: Dennis Shea: "Re: multiple regression"

    Li,

    I previously asked Dennis Shea about this and this is his reply:
    (I attached the fortran code for wrapit)

    To all.

    I provided Mike with a fortran subroutine to perform
    the multiple linear regression. Hopefully,
    this will be made available in the next release of NCL [v032].
    If anyone wants to use this now, I can send the fotran code.
    It is implemented as follows

    [1] WRAPIT zregr_ncl.f

    [2] external MLR "./zregr_ncl.so"

    [3] let N be the number of, say, time pts
             M number of variables
           
         X(N) is the dependent variable

         Y = new ((/M,N/), typeof(X), 1.e20) ; independent variables
         Y(0,:) = A ; T is of length N
         Y(1,:) = B ; B N
               etc
        
         C = new ( M, typeof(X) ) ; coefficients
         RESID = new ( N, typeof(X) )
        
         MLR::ZREGR1(N,M,X,X@_FillValue,Y,Y@_FillValue,C,RESID)
        
         print(C) ; desired coef
         print(RESID) ; residuals [=X-XMLR]

    ----------

    Mike




    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Fri May 27 2005 - 14:12:01 MDT