Displaying 4 results from an estimated 4 matches for "simresult".
2005 Oct 13
1
problems with loop and plot function
...function(k, n){
conc <- seq(0,100,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i] <- (k + conc[i])^n/((k+conc[i])^n + (k+1)^n)
}
#return(data.frame(choixg, conc))
return(list(choixg=choixg, conc = conc))
}
#cbind(simResult$conc, simResult$choixg, format(Sys.time(),"%H:%M:%S"))
for( n in c(1,3,5)) {
x <- NULL; y <- NULL
simResult <- simulation (5,n)
conc <- simResult$conc
choixg <- simResult$choixg
prin("n"); print(c(k=5, n))
points(conc, log10(1-choixg), main ="fonction...
2005 Oct 12
0
loop for plot function
...xg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i] <- (k + conc[i])^n/((k+conc[i])^n + (k+1)^n)
}
#return(data.frame(choixg, conc))
return(list(choixg=choixg, conc = conc))
}
#choixg <- simulation(5,2)
#mydf<-simulation(5,1)
simResult <- simulation (5,5)
#plot(mydf$conc, log10(1-mydf$choixg), main ="fonction de choix", col=
#"blue", pch=20,
#xlab = " concentration", ylab="proba de choisir la gauche")
plot(simResult$conc, log10(1-simResult$choixg), main ="fonction de choix",
c...
2003 Sep 10
4
recording and taking mean of a set of matrices
...s to me the results could go to a 3
dimensional array; I suppose it would be good to make the last index
vary with the simulation.
Neither of these approaches seems ideal, because I would need to
handle the matrix separately from the other data I want to store. I'm
hoping to do something like simresults <- rbind(simresults, r$coeff,
r$var).
The result also needs to be amenable to calculations. If m1 and m2
are matrices (same dimension for each) mean(list(m1, m2)) doesn't
work, so even though list will record the data it isn't a great form
for analysis. (But I suppose some apply vari...
2005 Oct 11
2
Problems with plot function
Hello all R users,
My simulation function works correctly, but I have problems with plot
function. You will find the following code using it.
Thank you for your help
##################################################"
simulation <- function(k, n){
conc <- seq(0,10,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i]