Rank: 3277 based on 39 downloads (last 30 days) and 1 file submitted
photo

Dave

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Dave
Updated   File Tags Downloads
(last 30 days)
Comments Rating
14 Apr 2014 Screenshot Johnson Curve Toolbox Fit a Johnson distribution to non-normal data Author: Dave curve fitting, johnson distribution, fortran port, stat lib, nonnormal, toolbox 39 0
Comments and Ratings by Dave
Updated File Comments Rating
21 Mar 2014 Johnson curve fitting Fits a Johnson curve to data based on AS99, returns parameter estimates and curve type. Author: Benjamin Levy

#include <fintrf.h>
C JNSN_G.F - GATEWAY FUNCTION FOR JNSN.F
C
C MODIFIED BY DAVID L. JONES, MAR-2014
C
C NOTE: (POINTER) REPLACE INTEGER BY INTEGER*8 ON 64-BIT PLATFORMS

SUBROUTINE MEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
MWPOINTER PLHS(*), PRHS(*)
INTEGER NLHS, NRHS
MWPOINTER MXCREATEDOUBLEMATRIX, MXGETPR
MWSIZE MXGETM
INTEGER IFAULT, ITYPE
MWPOINTER XPR1, XPR2, XPR3, XPR4
MWSIZE M, N
REAL*8 XBAR, SD, RB1, BB2
REAL*8 GAMMA, DELTA, XLAM, XI, A1, A2
MWPOINTER YPR1, YPR2, YPR3, YPR4, YPR5, YPR6

C(1)---CHECK THE DIMENSIONS OF X:---
M = MXGETM(PRHS(1))

C(2)---CREATE A MATRIX FOR RETURN ARGUMENT:---
N = 1
PLHS(1) = MXCREATEDOUBLEMATRIX(M, N, 0)
PLHS(2) = MXCREATEDOUBLEMATRIX(M, N, 0)
PLHS(3) = MXCREATEDOUBLEMATRIX(M, N, 0)
PLHS(4) = MXCREATEDOUBLEMATRIX(M, N, 0)
PLHS(5) = MXCREATEDOUBLEMATRIX(M, N, 0)
PLHS(6) = MXCREATEDOUBLEMATRIX(M, N, 0)

C(3)---ASSIGN POINTERS TO THE VARIOUS PARAMETERS:---
YPR1 = MXGETPR(PLHS(1))
YPR2 = MXGETPR(PLHS(2))
YPR3 = MXGETPR(PLHS(3))
YPR4 = MXGETPR(PLHS(4))
YPR5 = MXGETPR(PLHS(5))
YPR6 = MXGETPR(PLHS(6))
XPR1 = MXGETPR(PRHS(1))
XPR2 = MXGETPR(PRHS(2))
XPR3 = MXGETPR(PRHS(3))
XPR4 = MXGETPR(PRHS(4))

C(4)---COPY RIGHT HAND ARGUMENTS TO LOCAL ARRAYS OR VARIABLES:---
CALL MXCOPYPTRTOREAL8(XPR1, XBAR, M)
CALL MXCOPYPTRTOREAL8(XPR2, SD, M)
CALL MXCOPYPTRTOREAL8(XPR3, RB1, M)
CALL MXCOPYPTRTOREAL8(XPR4, BB2, M)

C(5)---DO THE ACTUAL COMPUTATIONS IN A SUBROUTINE CREATED ARRAYS:---
CALL JNSN(XBAR, SD, RB1, BB2, ITYPE, GAMMA, DELTA,
$ XLAM, XI, IFAULT)

A1 = FLOAT(ITYPE)
A2 = FLOAT(IFAULT)

C(6)---COPY OUTPUT WHICH IS STORED IN LOCAL ARRAY TO MATRIX OUTPUT:---
CALL MXCOPYREAL8TOPTR(GAMMA, YPR1, M)
CALL MXCOPYREAL8TOPTR(DELTA, YPR2, M)
CALL MXCOPYREAL8TOPTR(XLAM, YPR3, M)
CALL MXCOPYREAL8TOPTR(XI, YPR4, M)
CALL MXCOPYREAL8TOPTR(A1, YPR5, M)
CALL MXCOPYREAL8TOPTR(A2, YPR6, M)

RETURN
END

Contact us