File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1010 probs <- c(alpha / 2 , 1 - alpha / 2 )
1111
1212 lambda <- f * df
13+ init <- rep(ifelse(lambda < 2 , 2 , lambda / 2 ), 2 )
1314 ncp <- suppressWarnings(stats :: optim(
14- par = 1.1 * rep( lambda , 2 ) ,
15+ par = init ,
1516 fn = function (x ) {
1617 quan <- stats :: qf(p = probs , df , df_error , ncp = x )
1718 sum(abs(quan - f ))
3940
4041 alpha <- 1 - conf.level
4142 probs <- c(alpha / 2 , 1 - alpha / 2 )
42-
43+ init <- rep(ifelse(abs( t ) < 2 , sign( t ) * 2 , t / 2 ), 2 )
4344 ncp <- suppressWarnings(stats :: optim(
44- par = 1.1 * rep( t , 2 ) ,
45+ par = init ,
4546 fn = function (x ) {
4647 quan <- stats :: qt(p = probs , df = df_error , ncp = x )
4748 sum(abs(quan - t ))
6263
6364 alpha <- 1 - conf.level
6465 probs <- c(alpha / 2 , 1 - alpha / 2 )
65-
66+ init <- rep(ifelse( chisq < 2 , 2 , chisq / 2 ), 2 )
6667 ncp <- suppressWarnings(stats :: optim(
67- par = 1.1 * rep( chisq , 2 ) ,
68+ par = init ,
6869 fn = function (x ) {
6970 quan <- stats :: qchisq(p = probs , df , ncp = x )
7071 sum(abs(quan - chisq ))
You can’t perform that action at this time.
0 commit comments