No BSD License  

Highlights from
Johnson curve fitting

1.5

1.5 | 2 ratings Rate this file 16 Downloads (last 30 days) File Size: 6.36 KB File ID: #4595

Johnson curve fitting

by

 

08 Mar 2004 (Updated )

Fits a Johnson curve to data based on AS99, returns parameter estimates and curve type.

| Watch this File

File Information
Description

Implements Carnegie-Mellon STATLIB/Applied Statistics AS-99 for fitting Johnson curve pdfs and developed by:

Hill, I.D., R. Hill, and R.L. Holder, 1976. Algorithm AS 99: Fitting Johnson Curves by Moments, Applied Statistics, Vol. 25, No. 2, 180-189.

[gamma,delta,lambda,xi,jctype,fault_msg]=cmu_as99_johnson_pdf_off_line(x)

Input:
x vector of sample observations

Output:
Parameter names as in AS-99.
Johnson curve parameters:
AS-99 Hahn-Shapiro
gamma gamma
delta eta
xi epsilon
lambda lambda

Johnson curve type and error state: jctype, fault_msg

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
21 Mar 2014 Dave

#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

03 Oct 2010 Oleg Nazarevych

cmu_as99_johnson_pdf.dll': Не
найдена указанная процедура.

.

Error in ==> cmu_as99_johnson_pdf_off_line at 77
[gamma,delta,lambda,xi,itype,ifault] =
cmu_as99_johnson_pdf(xbar,sd,rb1,bb2);

22 Apr 2009 Benjamin

For Howard Schoeberlein, I recently learned from Matlab that the reason for the error that you received is due to the fact that the dll was compiled with Compaq fortran, not now supported in current (2008b) matlab vesion. I just found it myself. I'd provide you the source file if you write.

06 Feb 2008 Howard Schoeberlein

This doesn't work in MATLAB V2007a and 2007b. The problem seems to be in the dll file. I get the following error message:

??? Invalid MEX-file 'C:\My MATLAB Work\Johnson
Curves\cmu_as99_johnson_pdf.dll': The specified procedure could not be found.

.

Error in ==> johnson_fit at 42
[gamma,delta,lambda,xi,itype,ifault] = cmu_as99_johnson_pdf(xbar,sd,rb1,bb2);

Note that it seems to be complaining about a proceudre called ".", strange as that is.

21 Sep 2006 yanling tian

The updated file can not work without 'cmu_as99_johnson_pdf.m' could you upload other files in time

Updates
06 Sep 2006

Bug fix; needs to deal with negative skew data, not just positive skew data as in first version.

Contact us