Description Usage Arguments Value See Also Examples
nls_1d_fit
fit the requested non-linear models, such as double weibull model.
coe_lm
basically fit linear models to the fitted parameters produced by nls_1d_fit
.
coe_sum
wraps coe_lm
and coe_gam
together. It save the numerical results into files and save all the plots into a single pdf file if requested. All the arugments are directly copied from those two functions, which a few new ones explained as below. Note that read_3d
is called inside.
1 2 3 4 5 6 7 8 9 10 11 12 13 | nls_1d_fit(mat, picked, func,
para.initials = list(a1 = 0.03, b1 = 1, a2 = 0.3, b2 = 0.6))
coe_lm(mat, weights, picked, func, xlabel,
para.initials = list(a1 = 0.03, b1 = 1, a2 = 0.3, b2 = 0.6))
coe_sum(data.name, data,
data.folder="I:/Dropbox/1_STB Project/R scripts/Output 3D",
weights, picked, selected, func,
para.initials = list(a1 = 0.03, b1 = 1, a2 = 0.3, b2 = 0.6),
dist = 3, trans = "log", output = TRUE, intg.length = 0,
func.name, xlab, ylab = "Integral", file.folder = getwd(),
file.name, auto.smooth = TRUE, pdf = TRUE)
|
mat |
The big data frame generated by the 3D macro in SAS, after changing all 0 values to |
data |
You can also supplied the data.frame already loaded in R. |
data.name |
It's a character string, the name of the csv file (not includeing ".csv") you saved by SAS in directory data.folder. |
data.folder |
Where you put the CSV SAS output. |
weights |
The weights used in weighted linear regression. But it's not recommended to use weighted linear regression. |
picked |
The cases of different lengthes you want to fit the model. Suppose you want to fit double weibull models for all lengthes ranging from 20-1040 min, then |
func |
The function you used in |
xlabel |
You have to be conscious of what kind of data you're dealing with. If the columns of |
para.initials |
The initial values of the parameters in doing |
selected |
If you want to present the model fitting of some specific or questionable cases in the pdf plot, you should specify those cases here as |
dist |
The criteria to judge if a fitted parameter is an outlier. |
trans |
The transformation requested before apply the |
output |
If output files of the |
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 |
xlab |
The |
ylab |
The |
file.folder |
If |
file.name |
If |
auto.smooth |
If you request auto |
pdf |
If you want the pdf output or not. |
coe_sum
return all the three major fitting result entirely during fitting, the coe_lm
, coe_gam
and the selected nls_1d_fit
object. Thus it's a list of 3 futher list.
You can also check coe_gam
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(ggplot2); library(mgcv)
#data
feb_5k_3d[1:5, 1:20]
#nls_1d_fit
nls_1d_fit(mat=feb_5k_3d, picked=seq(30, 360, by=40),
func=double.weibull.b)
#coe_lm
coelm_FEB_5KS30_non_wkday <- coe_lm(mat=feb_5k_3d,picked=30:300,
func=double.weibull.b, xlabel="Length")
#coe_gam
coe_gam(data=coelm_FEB_5KS30_non_wkday$nls_fitting_all,output=FALSE)
#coe_sum
coesum_FEB_5KS30_non_wkday <-
coe_sum(data=feb_5k_3d, picked=30:300,
selected=seq(30, 300, by=40),
xlab="STBS Length",
func=double.weibull.b,
func.name="double.weibull.b", intg.length=0,
file.name="coesum_FEB_5KS30_non_wkday")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.