Welcome to the Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿

COMFIT

COMFIT

The COMFIT function fits the paired data {xi, yi} to one of six common types of approximating models using a gradient-expansion least-squares method.

This routine is written in the IDL language. Its source code can be found in the file comfit.pro in the lib subdirectory of the IDL distribution.

Examples

`; Define two n-element vectors of paired data:X = [ 2.27, 15.01, 34.74, 36.01, 43.65, 50.02, 53.84, 58.30, \$     62.12, 64.66, 71.66, 79.94, 85.67, 114.95]Y = [ 5.16, 22.63, 34.36, 34.92, 37.98, 40.22, 41.46, 42.81, \$     43.91, 44.62, 46.44, 48.43, 49.70, 55.31]; Define a 3-element vector of initial estimates for the logsquare; model:A = [1.5, 1.5, 1.5]; Compute the model parameters of the logsquare model, A, A,; & A:result = COMFIT(X, Y, A, /LOGSQUARE)`

The result should be the 3-element vector: [1.42494, 7.21900, 9.18794].

Syntax

Result = COMFIT( X, Y, A [, /DOUBLE | , /EXPONENTIAL | , /GEOMETRIC | , /GOMPERTZ | , /HYPERBOLIC | , /ITMAX | , /LOGISTIC | , /LOGSQUARE | , TOL=value] [, CHISQ=variable] [, ITER=variable] [, SIGMA=variable] [, STATUS=variable] [, WEIGHTS=vector] [, YERROR=variable] [, YFIT=variable] )

Return Value

Results in a vector containing the model parameters a0, a1, a2, etc.

Arguments

X

An n-element vector containing the independent variable values. X may be of type integer, floating point, or double-precision floating-point.

Y

An n-element integer, single-, or double-precision floating-point vector.

A

A vector of initial estimates for each model parameter. The length of this vector depends upon the type of model selected.

Keywords

Note: One of the following keywords specifying a type of model must be set when using COMFIT. If you do not specify a model, IDL will display a warning message when COMFIT is called.

CHISQ

Set this keyword to a named variable that will contain the value of the reduced chi-square goodness-of-fit statistic.

EXPONENTIAL

Set this keyword to compute the parameters of the exponential model. DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

GEOMETRIC

Set this keyword to compute the parameters of the geometric model. GOMPERTZ

Set this keyword to compute the parameters of the Gompertz model. HYPERBOLIC

Set this keyword to compute the parameters of the hyperbolic model. ITER

Set this keyword equal to a named variable that will contain the number of iterations performed.

ITMAX

Set this keyword to specify the maximum number of iterations. The default value is 20.

LOGISTIC

Set this keyword to compute the parameters of the logistic model. LOGSQUARE

Set this keyword to compute the parameters of the logsquare model. SIGMA

Set this keyword to a named variable that will contain a vector of standard deviations for the computed model parameters.

STATUS

Set this keyword to a named variable that will contain an integer indicating the status of the computation. Possible return values are:

 0 The computation was successful. 1 The computation failed. Chi-square was increasing without bounds. 2 The computation failed to converge in ITMAX iterations.

TOL

Set this keyword to specify the desired convergence tolerance. The routine returns when the relative decrease in chi-squared is less than TOL in one iteration. The default value is 1 x 10-3.

WEIGHTS

Set this keyword equal to a vector of weights for Yi. This vector should be the same length as X and Y. The error for each term is weighted by WEIGHTSi when computing the fit. Frequently, WEIGHTSi = 1.0/σi2, where σ is the measurement error or standard deviation of Yi (Gaussian or instrumental weighting), or WEIGHTS = 1/Y (Poisson or statistical weighting). If WEIGHTS is not specified, WEIGHTSi is assumed to be 1.0.

YERROR

Set this keyword to a named variable that will contain the standard error between YFIT and Y.

YFIT

Set this keyword to a named variable that will contain an n-element vector of y-data corresponding to the computed model parameters.

Version History

 4 Introduced 6.4 Added CHISQ, DOUBLE, ITER, ITMAX, STATUS, TOL, and YERROR keywords.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6822874,"math_prob":0.9455888,"size":3925,"snap":"2019-26-2019-30","text_gpt3_token_len":1064,"char_repetition_ratio":0.16373374,"word_repetition_ratio":0.11912226,"special_character_ratio":0.26904458,"punctuation_ratio":0.19123021,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9929629,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12],"im_url_duplicate_count":[null,3,null,3,null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-06-18T06:56:16Z\",\"WARC-Record-ID\":\"<urn:uuid:8a5a4749-4f9a-4f8a-8d2a-14b7420083fb>\",\"Content-Length\":\"71053\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ea0441b3-4e9d-4392-a229-9d8e43e267d7>\",\"WARC-Concurrent-To\":\"<urn:uuid:399d87fe-2ec5-465e-bd93-0cfdb203ad81>\",\"WARC-IP-Address\":\"192.5.156.19\",\"WARC-Target-URI\":\"https://www.harrisgeospatial.com/docs/comfit.html\",\"WARC-Payload-Digest\":\"sha1:2RJ5XK7DZWZITGRLFD3M5LHWL4U5ZXIX\",\"WARC-Block-Digest\":\"sha1:HC34XVB4Q2SACSU4CD7HKP6MURGQP2RL\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-26/CC-MAIN-2019-26_segments_1560627998690.87_warc_CC-MAIN-20190618063322-20190618085322-00324.warc.gz\"}"}