R Under development (unstable) (2024-07-29 r86934 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(longmemo) > > options(digits = 5) # since we want to "R CMD Rdiff" the output > data(NileMin) > fF <- FEXPest(NileMin, order.poly=3, pvalmax= .5, verbose=TRUE) glm() [0]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.6596 0.0544 122 <2e-16 *** xlong -0.8109 0.0625 -13 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.98001) Null deviance: 713.99 on 330 degrees of freedom Residual deviance: 394.88 on 329 degrees of freedom AIC: 5076 Number of Fisher Scoring iterations: 6 P-val[eta]: <2e-16 glm() [1]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.7895 0.1784 38.06 < 2e-16 *** xlong -0.7436 0.1128 -6.59 1.7e-10 *** ffr -0.0836 0.1085 -0.77 0.44 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.99118) Null deviance: 713.99 on 330 degrees of freedom Residual deviance: 394.27 on 328 degrees of freedom AIC: 5077 Number of Fisher Scoring iterations: 6 P-val[eta]: 1.73e-10, 0.442 glm() [2]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.657 0.055 120.97 < 2e-16 *** xlong -0.910 0.193 -4.72 3.6e-06 *** poly(ffr, j)1 0.861 2.730 0.32 0.75 poly(ffr, j)2 -1.958 1.703 -1.15 0.25 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 1.0013) Null deviance: 713.99 on 330 degrees of freedom Residual deviance: 392.85 on 327 degrees of freedom AIC: 5078 Number of Fisher Scoring iterations: 6 P-val[eta]: 3.56e-06, 0.753, 0.251 > fF 'FEXP' estimator, call: FEXPest(x = NileMin, order.poly = 3, pvalmax = 0.5, verbose = TRUE) polynomial order 1 - selected by stopping early (P = 0.753 > pvalmax); H = 0.87178 coefficients 'theta' = Estimate Std. Error t value Pr(>|t|) (Intercept) 6.789501 0.178383 38.0614 < 2.2e-16 1 - 2*H -0.743568 0.112790 -6.5925 1.729e-10 ffr -0.083562 0.108507 -0.7701 0.4418 ==> H = 0.87 (0.06) <==> d := H - 1/2 = 0.37 (0.06) $ early.stop: logi TRUE $ maxPv : num 0.753 $ yper : num [1:331] 56564 5379 52555 1098 2916 ... $ spec : num [1:331] 28365 16928 12512 10095 8545 ... > plot(fF) > > data(videoVBR) > for(max.poly in 0:2) { + cat("-------------------------------------------\n", + "max.poly= ", max.poly,":\n------------\n",sep='') + fv <- FEXPest(videoVBR, order.poly=max.poly, pvalmax= .5, verbose=TRUE) + print(fv["H"]) + } ------------------------------------------- max.poly= 0: ------------ glm() [0]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.9654 0.0534 74.2 <2e-16 *** xlong -2.6269 0.0607 -43.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 1.4247) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 701.23 on 497 degrees of freedom AIC: 4943 Number of Fisher Scoring iterations: 11 P-val[eta]: <2e-16 used full 'order.poly' $H [1] 1.8135 ------------------------------------------- max.poly= 1: ------------ glm() [0]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.9654 0.0534 74.2 <2e-16 *** xlong -2.6269 0.0607 -43.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 1.4247) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 701.23 on 497 degrees of freedom AIC: 4943 Number of Fisher Scoring iterations: 11 P-val[eta]: <2e-16 glm() [1]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.6377 0.1434 39.3 <2e-16 *** xlong -1.3650 0.0895 -15.2 <2e-16 *** ffr -1.1554 0.0871 -13.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.97997) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 566.85 on 496 degrees of freedom AIC: 4819 Number of Fisher Scoring iterations: 8 P-val[eta]: <2e-16, <2e-16 used full 'order.poly' $H [1] 1.1825 ------------------------------------------- max.poly= 2: ------------ glm() [0]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.9654 0.0534 74.2 <2e-16 *** xlong -2.6269 0.0607 -43.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 1.4247) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 701.23 on 497 degrees of freedom AIC: 4943 Number of Fisher Scoring iterations: 11 P-val[eta]: <2e-16 glm() [1]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.6377 0.1434 39.3 <2e-16 *** xlong -1.3650 0.0895 -15.2 <2e-16 *** ffr -1.1554 0.0871 -13.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.97997) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 566.85 on 496 degrees of freedom AIC: 4819 Number of Fisher Scoring iterations: 8 P-val[eta]: <2e-16, <2e-16 glm() [2]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.799 0.044 86.37 < 2e-16 *** xlong -0.713 0.149 -4.79 2.2e-06 *** poly(ffr, j)1 -33.864 2.610 -12.97 < 2e-16 *** poly(ffr, j)2 8.177 1.644 4.97 9.1e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.96466) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 546.61 on 495 degrees of freedom AIC: 4800 Number of Fisher Scoring iterations: 7 P-val[eta]: 2.18e-06, < 2e-16, 9.10e-07 used full 'order.poly' $H [1] 0.85633 > max.poly <- 3 > cat("-------------------------------------------\n", + "max.poly= ", max.poly,":\n------------\n",sep='') ------------------------------------------- max.poly= 3: ------------ > ## IGNORE_RDIFF_BEGIN > (fv <- FEXPest(videoVBR, order.poly=max.poly, pvalmax= .5, verbose=TRUE)) glm() [0]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.9654 0.0534 74.2 <2e-16 *** xlong -2.6269 0.0607 -43.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 1.4247) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 701.23 on 497 degrees of freedom AIC: 4943 Number of Fisher Scoring iterations: 11 P-val[eta]: <2e-16 glm() [1]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.6377 0.1434 39.3 <2e-16 *** xlong -1.3650 0.0895 -15.2 <2e-16 *** ffr -1.1554 0.0871 -13.3 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.97997) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 566.85 on 496 degrees of freedom AIC: 4819 Number of Fisher Scoring iterations: 8 P-val[eta]: <2e-16, <2e-16 glm() [2]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.799 0.044 86.37 < 2e-16 *** xlong -0.713 0.149 -4.79 2.2e-06 *** poly(ffr, j)1 -33.864 2.610 -12.97 < 2e-16 *** poly(ffr, j)2 8.177 1.644 4.97 9.1e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.96466) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 546.61 on 495 degrees of freedom AIC: 4800 Number of Fisher Scoring iterations: 7 P-val[eta]: 2.18e-06, < 2e-16, 9.10e-07 glm() [3]: Call: glm(formula = frml, family = Gamma(link = "log")) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.79852 0.04403 86.27 < 2e-16 *** xlong -0.71379 0.20852 -3.42 0.00067 *** poly(ffr, j)1 -33.84546 3.53106 -9.59 < 2e-16 *** poly(ffr, j)2 8.16767 2.09431 3.90 0.00011 *** poly(ffr, j)3 0.00946 1.37726 0.01 0.99452 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for Gamma family taken to be 0.96664) Null deviance: 3280.63 on 498 degrees of freedom Residual deviance: 546.61 on 494 degrees of freedom AIC: 4802 Number of Fisher Scoring iterations: 7 P-val[eta]: 0.00067, < 2e-16, 0.00011, 0.99452 'FEXP' estimator, call: FEXPest(x = videoVBR, order.poly = max.poly, pvalmax = 0.5, verbose = TRUE) polynomial order 2 - selected by stopping early (P = 0.995 > pvalmax); H = 0.85633 coefficients 'theta' = Estimate Std. Error t value Pr(>|t|) (Intercept) 3.798516 0.043978 86.3733 < 2.2e-16 1 - 2*H -0.712654 0.148702 -4.7925 2.181e-06 poly(ffr, j)1 -33.864487 2.610367 -12.9731 < 2.2e-16 poly(ffr, j)2 8.177403 1.644290 4.9732 9.096e-07 ==> H = 0.86 (0.07) <==> d := H - 1/2 = 0.36 (0.07) $ early.stop: logi TRUE $ maxPv : num 0.995 $ yper : num [1:499] 5145 22812 40031 7476 33737 ... $ spec : num [1:499] 51315 30682 22521 17979 15029 ... > ## IGNORE_RDIFF_END > plot(fv, type = "o", cex = 0.5) > > cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons'' Time elapsed: 0.45 0.09 0.51 NA NA > > proc.time() user system elapsed 0.45 0.09 0.51