Displaying 1 result from an estimated 1 matches for "mean_boot".
2009 Aug 14
1
Simulation Function - Save results
...working on a simulation... But I am having some troubles...
Suppose I have a function A which produces two results (mean and
variance)...
Then I would like to simulate this function A with a function B many times
using the results from function A
For example:
#Function A
boot<-function(a,b,c){
mean_boot<-(a+b)/2
var_boot<-c
#list(a=a,b=b,c=c)
return(a)
}
Then I would like to create 2 vectors with the mean and var results from S
simulations
#Function B
simul<-function(S){
teste<-rep(0,S)
for(i in 1:S){
teste[i]<-boot(10,12,15) #ACCORDING TO FUNCTION A I AM SAVING JUST THE
MEAN_BOO...