fit_functions: Fit Functions for Johnson Curves

Description Usage Arguments Details Value

Description

Fit functions for three Johnson Curves.

Usage

1
2
3
4
5
6
7
fit_sb(x, q)

fit_su(x, q)

fit_sl(x, q)

qtls(x, z)

Arguments

x

the non-normal numerical data.

q

the quantiles and some statistics generated by quantiles, it must be the return value of qtls function.

z

a single z value for model fitting. It's returned by jtrans

Details

Three types of transformations are SB, SL and SU. Their forms are described below:

S_B: Z = γ + η * ln((X-ε) / (λ + ε - X))

S_L: Z = γ + η * ln(X - ε)

S_U: Z = γ + η * asinh((X-ε) / λ)

in whihc Z is the standard normal varible, and X is the non-normal original data, all the necessary parameters will be returned. Before fitting these curves, sample quantiles should be calculated according to z values. the qtls function here is to provide every useful parameters for Johnson curve fitting.

These functions could also be used for predicting new values when you have already fitted a model and obtained a jtrans object. This could be done by set the newx parameter. See examples for details.

Note that when predicting new data, the new data should be from the same distribution as the original data used for fitting the model. All fits have certain restrictions on data range, if the new data is outside the range of the model, the prediction will return NA for all the values. Try to exclude some out-of-range values and predict again may fix this problem.

Value

return NA when the prediction failed, return a list with 2 component when fit succeeded. The first component trans is the transformed value and the second component params is the parameters used in the transformation.


wangyuchen/jtrans documentation built on May 4, 2019, 12:58 a.m.