Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a <- length(g)/(max(g)-min(g))
- i <- min(g)
- j <- max(g)
- e <- 10
- hh <- 0
- t <- 1
- c <- 0
- while(TRUE){
- c <- c+1
- j <- j-e
- h <- densty(i,j,g)
- print(paste("iteration: interval [",i,";",j,"] average: ",h,sep=""))
- if(h<hh & t==1){
- j <- j+e
- e <- e*2
- h <- hh
- t <- 2
- }
- if(h>hh & t>1){
- e <- 10
- t <- 1
- hh <- h
- }
- if(h<hh & t>1){
- j <- j+e
- if(t==2){
- e <- e/4
- }else{
- e <- round(e/2)
- }
- if(e==1){
- print(paste("i = ",i,sep=""))
- print(paste("j = ",j,sep=""))
- print(paste("c = ",c,sep=""))
- print(paste("h = ",hh,sep=""))
- print(paste("a = ",a,sep=""))
- high <- list(i,j,h)
- break
- }
- h <- hh
- t <- 3
- }
- if(h>hh & t==1){
- hh <- h
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment