coe_gam: 'gam' smoothing of the fitted parameters(coefficients).

Description Usage Arguments Value See Also Examples

Description

gam smoothing of the fitted parameters(coefficients) returned by coe_lm. It returns two plots, one for gam smoothing of the parameters and one for checking the agreement in area-under-the-curve (integration) after parameter smoothing. It can also save the smoothing result.

Usage

1
2
3
coe_gam(data, dist = 3, trans = "log", output = TRUE, intg.length = 0, 
    func.name = "double.weibull.b", xlab = "Length", ylab = "Integral", 
    file.folder = getwd(), file.name, auto.smooth = TRUE)

Arguments

data

The nls_fitting_all object returned by coe_lm function.

dist

The criteria to judge if a fitted parameter is an outlier. dist=3 means 3 standard deviation from the mean would be considered as an outlier.

trans

The transformation requested before apply the gam smoothing.

output

If output files of the gam fitting results and the integration results are requested.

intg.length

The length of doing numerical integration. Default is 0, which means such integration will be done dynamically depending on STBS length. If STBS length is 300, then the integration will be done from 0-300 min. Otherwisely, all integration will be from 0 to the length you specified, regardless of the STBS length.

func.name

The name of the function you used in fitting the model. It should be a character string such as func.name="double.weibull.b".

xlab

The xlab for the gam and integration plot. If each fitting is done by STBS length, then the lable should be something like xlab="length"; if it's done by QH, then xlab="QH in day time".

ylab

The ylab for the integration plot.

file.folder

If output=T, you need to specify where should those files go

file.name

If output=T, you need to specify the name of the files to be saved.

auto.smooth

If you request auto gam smooth in the integration plot. Sometimes auto smooth doesn't make any sense.

Value

coe_smooth

data frame output after the gam fitting and re-fitting after geting rid of outliers

integer_fit

Date frame for the fitting of the area-under-curve (integration)

integer_plot

The ggplot2 object for the fitting of the integrals. Notice that the gam plot done by R basic graphics can not be returned as an object; instead it's printed.

See Also

coe_lm, coe_sum

Examples

1
2
3
4
5
6
library(mgcv)

coelm_FEB_5KS30_non_wkday <- coe_lm(mat=feb_5k_3d,picked=30:300,
                                    func=double.weibull.b, xlabel="Length")

coe_gam(data=coelm_FEB_5KS30_non_wkday$nls_fitting_all,output=FALSE)

fzwaeustc/pcrfn documentation built on May 16, 2019, 4:06 p.m.