Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviours of a selected physical or abstract system.
Questions tagged [simulation]
5194 questions
1
vote
1 answer
Monte Carlo Simulation of a date based on another date
I have a dataset like this. The date_e was accurate for status= "1". I want to simulate date_e based on age. Therefore, new_date_e will be changed for status="0", will be same for status="1". Also, status=1 has higher risk, so df= date_e-age should…

Ali Roghani
- 495
- 2
- 7
1
vote
0 answers
Fitting decays in R
I have a data like that I want to fit decay.
library(tidyverse)
library(broom)
t = 1:100
x=1:80
y1=sample(seq(from = 20, to = 50), size = 100, replace = TRUE)
y1<-y1 %>% jitter()
y2 = 24 + (60 - 24) * -0.01 * x %>% jitter(10)
df1 <- tibble(t = t,…

Ali Roghani
- 495
- 2
- 7
1
vote
0 answers
Feedback loop in OpenModelica
I am currently working on a two zone combustion model in OpenModelica and I want to simulate the loop presented in the next picture volume calculation. With this way OpenModelica always gives me singular matrix error. Is it even possible to this…

Paladin2805
- 11
- 1
1
vote
1 answer
How to easily generate/simulate example data with different groups for modelling
How to easily generate/simulate meaningful example data for modelling: e.g. telling that give me n rows of data, for 2 groups, their sex distributions and mean age should differ by X and Y units, respectively? Is there a simple way for doing it…

st4co4
- 445
- 3
- 10
1
vote
1 answer
Simulating Bayesian data using R
I'm trying to generate a dataset generated from 3 distributions and then plot it with the groups colored differently. The outcome is distributed with mean that is a linear regression of time and the errors follow a standard normal distribution. I…

Emma N
- 129
- 6
1
vote
2 answers
I need to define 3 kinds of messages in omnet
I want to define 3 kinds of messages in omnet
I know I have to use messagekind but I couldnt
please help me
I want help message, control message and jobs, which jobs should be processed
thank you so much

Fatimah Faraji
- 13
- 3
1
vote
1 answer
Problem with making Circle properly appear on screen in Pygame
I think my understanding of Pygame is a little bit weak. I would appreciate any help in general about the intricacies of the code (since this was given by the teacher) or simply how I can at least make the obstacle visible.
def draw(screen,…

jbg05
- 51
- 7
1
vote
1 answer
Creating a "Prisoner's Dilemma Table" in R
I am working with the R programming language. I created the following "game" in R which involves two players flipping coins (the result of each coin is associated with a "score") to see who gets the highest score:
score_coin_1 =…

stats_noob
- 5,401
- 4
- 27
- 83
1
vote
0 answers
How to repeatedly insert arguments from a list into a function until the list is empty?
Using R, I am working with simulating the outcome from an experiment where participants choose between two options (A or B) defined by their outcomes (x) and probabilities of winning the outcome (p). I have a function "f" that collects its arguments…

Mattias
- 11
- 1
1
vote
1 answer
KeyError: [....] not found in index
For a project that I am working on, I created a linear regression model. After fitting that line, I wanted to simulate the data over and over again using np.random.choice on my data to see the variability in the regression line say the data be…

Jensen_ray
- 81
- 2
- 10
1
vote
1 answer
Issues while running tutorials of Drake programs, in Underactuated Robotics document, in Deepnote?
I am trying to build and simulate a pendulum in drake. I have created a urdf file(still don't know how to add the inertia tags) and am trying to simulate it, but I don't know how to? So, I was looking at the simple pendulum tutorial in…

Raviverma Chamarti
- 63
- 3
1
vote
1 answer
How to fix incorrect energy conservation problem in mass-spring-system simulation using RK4 method
I am making a simulation where you create different balls of certain mass, connected by springs which you can define (in the program below all springs have natural length L and spring constant k). How I do it is I created a function accel(b,BALLS),…

Simon
- 43
- 4
1
vote
1 answer
Simulate Nested Logit Errors
I'm trying to simulate data that can be estimated using a nested logit model. If epsilon is distributed nested logit with a nesting structure $B_1, ..., B_K $, and nesting parameters $\lambda_1, ... \lambda_K$ then the CDF of epsilon is
I am…

EB727
- 43
- 5
1
vote
1 answer
Simulating a random walk in R
How do I simulate a sequence of random variables Xn with probability distribution P(Xn=1)=1/2, P(Xn=-1)=1/2 in R? (To be used to simulate a random walk).

fran
- 43
- 4
1
vote
1 answer
tidyverse: Simulating random sample with nested factor
I want to simulate random sample with nested factor. Factor Dept has two levels A & B. Level A has two nested levels A1 and A2. Level B has three nested levels B1, B2 and B3. Want to simulate random sample from 2022-01-01 to 2022-01-31 using some R…

MYaseen208
- 22,666
- 37
- 165
- 309