# sensitivity analysis, input factors Classic List Threaded 5 messages Open this post in threaded view
|

## sensitivity analysis, input factors

 Hi, I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can’t succeed. The definition of input factors can be the problem. library(sensitivity) #A simple model with 4 input factor to test the morris function: model01=function(a1,a2,a3,a4)             { Z<-numeric(10) Z<-runif(1) Z<-runif(1,a1,30) Z<-6*runif(1,min(a1,a2),max(a1,a3)) Z<-runif(1,2,5)*runif(1,min(a2,a4),max(a2,a4)) Z<-0.5*runif(1,min(a3,a4),max(a3,a4)) Z<-2*runif(1,min(a1,a4),max(a1,a4)) Z<-runif(1) Z<-2*runif(1,min(2*a1,5*a4),max(10*a1,100*a4)) Z<-2.5*runif(1,min(a2,a3),max(a2,a3)) Z<-rnorm(1,10*a1,1) mean(Z) } xx=morris(model = model01, factors=c("a1","a2","a3","a4"), r=4,               design=list(type="oat", levels = 5, grid.jump = 3), binf =1,bsup=20, scale=F) Error message suggests that the second input factor is not used How should I define the input factors? Thanks in advance, Mark ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: sensitivity analysis, input factors

 Hi Szalai I had used only "src" function, and on that case you need to have a vector with your Y variable, and a data-frame with all your X (i.e. explanatory) variables. I have interest on stay in touch with others that have been using sensitivity package! bests milton On Tue, Apr 13, 2010 at 11:08 AM, "Szalai Márk" <[hidden email]>wrote: > Hi, > > > I'm trying to conduct sensitivity analysis in R using the 'sensitivity' > package. Although the description of functions seem straightforward, I cant > succeed. The definition of input factors can be the problem. > > library(sensitivity) > #A simple model with 4 input factor to test the morris function: > model01=function(a1,a2,a3,a4) > { > Z<-numeric(10) > Z<-runif(1) > Z<-runif(1,a1,30) > Z<-6*runif(1,min(a1,a2),max(a1,a3)) > Z<-runif(1,2,5)*runif(1,min(a2,a4),max(a2,a4)) > Z<-0.5*runif(1,min(a3,a4),max(a3,a4)) > Z<-2*runif(1,min(a1,a4),max(a1,a4)) > Z<-runif(1) > Z<-2*runif(1,min(2*a1,5*a4),max(10*a1,100*a4)) > Z<-2.5*runif(1,min(a2,a3),max(a2,a3)) > Z<-rnorm(1,10*a1,1) > mean(Z) > } > > xx=morris(model = model01, factors=c("a1","a2","a3","a4"), r=4, > design=list(type="oat", levels = 5, grid.jump = 3), binf =1,bsup=20, > scale=F) > > > Error message suggests that the second input factor is not used > How should I define the input factors? > > > Thanks in advance, > Mark > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|