simulation

How many times should i run computer simulations to conclude one experiment in netlogo?

风格不统一 提交于 2019-12-13 11:04:46
问题 I am working on a model in netlogo which is a statistical physics based model. How many times should i run the simulation and average the results to conclude the study? 回答1: As Marzy points out in comments, there is no definitive answer. Many people will pick the magic numbers 20-30 out of a hat and go with that. A common choice is to do a small number (5-10) runs initially, estimate the variance from them, and then project how large a sample size you would need to bring the margin of error

Matlab - updating objects on a plot

◇◆丶佛笑我妖孽 提交于 2019-12-13 05:52:08
问题 I am trying to add a timer a simulation i am working on. At the moment i can get the timer to display in the location i want, however i cant make the numbers clear each other, i.e they all just stack on top of each other slowly creating a solid black mess. I have tried implementing a clf function but it just clears the entire figure. The code for the timer is: HH = 0; MM = 0; SS = 0; timer = sprintf('%02d:%02d:%02d',HH,MM,SS); text(-450,450,timer); %% adjust location of clock in graph using

How to generate random data set with predicted probability?

ぐ巨炮叔叔 提交于 2019-12-13 05:41:14
问题 I'm struggling to generate random data set with predicted probability of multinomial logistic regression. Let's take an example. I'll use nnet package for multinomial logistic regression. I will also use wine data set in rattle.data package. library("nnet") library("rattle.data") data(wine) multinom.fit<-multinom(Type~Alcohol+Color,data=wine) summary(multinom.fit) Call: multinom(formula = Type ~ Alcohol + Color - 1, data = wine) Coefficients: Alcohol Color 2 0.6258035 -1.9480658 3 -0.3457799

Parking randomly in Anylogic

谁说胖子不能爱 提交于 2019-12-13 03:36:42
问题 I am using AnyLogic's Traffic Road Library and I know it's possible in the car Source module to define the initial position of the car in a parking lot. I want the parking lot space to be randomly chosen. I know there is this function randomFreeSpaceIndex() that returns the index of randomly chosen free parking space. But I do not know how to call it on my car source or use it with the CarMoveTo tool. Here is my model so far. Any help is appreciated! 回答1: I'm pretty sure that you can't with

Error encountered while specifying events in deSolve R package

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:23:39
问题 Here is the sample R code: library(deSolve) d = c(5.29,4.16,2.49,1.53,0.7,0.41,0.21)*10^-4 rho = rep(1.27,7) dg = d * sqrt(1/rho) r0 = dg/2 Fr = c(0.188,0.297,0.274,0.181,0.032,0.013,0.015) X0 = Fr*200*10^-6 N0 = X0*(3/(4*3.14*r0^3*rho)) state <- c(X1=X0[1],X2=X0[2],X3=X0[3],X4=X0[4],X5=X0[5], X6=X0[6],X7=X0[7],S=0) parameters <- c(D=6.19*60*10^-6,rho=rho,N=N0,Cs=17*10^-6,V=1000) times <- seq(0,16,by=0.0005) func2 <- function(t,state,parameters){ n <- length(state) v <- 1:(n-1) grad <- rep(NA

how can i set a probability for each action?

眉间皱痕 提交于 2019-12-13 01:12:36
问题 I've got some turtles which are looking around themselves. For each neighbor they've got, they save the value of "output-heat". The patch with the highest value will get the highest probability and the lowest value the lowest probability. I want the turtle to move to another patch. The moving should be dependent on the probabilities. My code looks like this, but it doesn't work like it should: ask turtles-here[ let temp_ahead [(output-heat + 1)^ Freedom] of patch-at 0 1 let temp_right_ahead [

Convert columns in a list to a data frame in R

◇◆丶佛笑我妖孽 提交于 2019-12-12 18:05:17
问题 I have the following list that created using R, set.seed(326581) X1=rnorm(10,0,1) Y1=rnorm(10,0,2) data=data.frame(X1,Y1) lst <- replicate( 100, df.smpl <- data %>% sample_n(10, replace = T), simplify = FALSE) this list represents 100 samples where each sample has 2 columns (X,Y) with a sample size of 10. I need to separate all the X columns into one data frame and Y columns into one data frame. So finally i should have 2 data frames each have 100 columns and 10 rows. I tried this loop , new1

python: geometric brownian motion simulation [closed]

試著忘記壹切 提交于 2019-12-12 16:55:55
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . A basic simulation of GBM doesn't seem to work. What am I doing wrong? The following code always outputs values less than 1e-20, instead of something

GLSL How to retrieve vertex position after a shader process it?

谁说胖子不能爱 提交于 2019-12-12 16:45:01
问题 I wrote a program that simulates soft bodies using springs. It looks nice but the problem is it consumes a lot of CPU time. So I can not run it on my laptop or any not high end PC. I thought It would be a good idea to write a vertex shader and move the logic to the GPU. I've read some tutorials and made a toon shader so I thought (wrong) I was ready to go. The big problem I have is that I need to know the old position of a vertex to calculate the new one. I don't know how could I retrieve a

Can I have multiple independent random number generators in R like I can in C++?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:56:53
问题 I have many independent random processes (arrival processes say) that require me to generate random numbers. I want to use common random numbers for each of these processes that I can compare how different policies perform when controlling these policies. I want Process A to be governed by Generator A (using seed A) I want Process B to be governed by Generator B (using seed B) .. and so on. Is this possible to implement in R. I can't find anyone who has done it. I have tried. Forgive me if