similar to: how to make simulation faster

Displaying 20 results from an estimated 7000 matches similar to: "how to make simulation faster"

2012 Oct 20
4
Error in integrate(integrand, 0, Inf) : non-finite function value
Dear R users, When I run the code below, I get the error "Error in integrate(integrand, 0, Inf) : non-finite function value". The code works if the function returns only "sum(integ)". However, I want to add "cmh" to it. When I add "cmh" I get that error. I can't figure out why this is happening because my integrate function has nothing to do with
2012 Oct 17
1
for loop output
Dear R users, In the code below, I am trying to print the result of my loop function. The output first gives me the result for k=1, and then for k=1 and k=2. I only want the last output which is [,1] [,2] [1,] 0.1700065 0.5002659 [2,] 0.3080273 0.4954731 [3,] 0.4844886 0.4544306 [4,] 0.5062987 0.1868154 [5,] 0.5846982 0.4353522 [6,] 0.4332621 0.2202922 [7,] 0.4391985
2003 Oct 28
1
error message in simulation
Dear R-users, I am a dentist (so forgive me if my question looks stupid) and came across a problem when I did simulations to compare a few single level and two level regressions. The simulations were interrupted and an error message came out like 'Error in MEestimate(lmeSt, grps) : Singularity in backsolve at level 0, block 1'. My collegue suggested that this might be due to my codes
2009 Aug 26
2
Statistical question about logistic regression simulation
Hi R help list I'm simulating logistic regression data with a specified odds ratio (beta) and have a problem/unexpected behaviour that occurs. The datasets includes a lognormal exposure and diseased and healthy subjects. Here is my loop: ors <- vector() for(i in 1:200){ # First, I create a vector with a lognormally distributed exposure: n <- 10000 # number of study subjects
2005 Aug 04
1
Counterintuitive Simulation Results
I wonder if someone can help me understand some counterintuitive simulation results. Below please find 12 lines of R code that theoretically, to the best of my understanding, should produce essentially a flat line with no discernable pattern. Instead, I see an initial dramatic drop followed by a slow rise to an asymptote. The simulation computes the mean of 20,000 simulated trajectories
2011 Dec 16
1
simulation
I'm using an R program (which I did not write) to simulate multilevel data (subjects in locations) used in power calculations. It uses lmer to fit a mixed logistic model to the simulated data based on inputs of means, variances, slopes and proportions: ? (fitmodel <- lmer(modelformula,data,family=binomial(link=logit),nAGQ=1)) where modelformula is set up in another part of the program.?
2011 Nov 22
1
Generate Simulation
Hallo everybody, I'm new in r and I"ll appreciate some help! I have a matrix of nrow=30 and ncoll=54,and I would like to generate 50 simulations with tha same size of the matrix!!!That is to say that I want to generate 50 matrices -for my 50 simulations - with the same dimensions! I took my 1st matrix according to the formula that I want to implement: D<-mean_m + U_i*mat_DELTA
2003 Aug 20
2
question about simulation.
I am running a 1000 simulations, it works for 2 simulations. However, I get the following error message whenever I run it more than 3 times: "The instruction at '0*11044080' referenced memory at "o*3ff00000". The memory could not be "written". and, I can also get something like "exception: access violation (0*c0000005). Address:0*11044080". Anybody
2013 Aug 30
0
ddply for comparing simulation results
This might do it: > lhs=c('a','a','a','b') > rhs=c('a','b','b','b') > > > # function to determine differences > f_diff <- function(l, r){ + t_l <- table(l) + t_r <- table(r) + # compare 'l' to 'r' + sapply(names(t_l), function(x){ + if (is.na(t_r[x])) return(t_l[x])
2009 May 18
2
Simulation from a multivariate normal distribution
I must to create an array with dimensions 120x8x500. Better I have to make 500 simulations of 8 series of return from a multivariate normal distribution. there's the command "mvrnorm" but how I can do this repeating the simulation 500 times?" [[alternative HTML version deleted]]
2013 Feb 20
2
Why R simulation gives same random results?
Hi, list I am doing 100,000 iterations of Bayesian simulations. What I did is I split it into 4 different R sessions, each one runs 25,000 iteration. But two of the sessions gave the simulation result. I did not use any set.seed(). What is going on here? Thanks, Mike [[alternative HTML version deleted]]
2011 Mar 01
2
Simulation
I tried looking for help but I couldn't locate the exact solution. I have data that has several variables. I want to do several sample simulations using only two of the variables (eg: say you have data between people and properties owned. You only want to check how many in the samples will come up with bicycles) to estimate probabilities and that sort of thing. Now, I can only do a simulation
2011 Nov 25
3
counting values with some conditions in a simulation
Dear R users, I am running simulations (1000), and in my simulation I am looking at specific sums. For example, if the sum is >=4 then count this, if say <3, then don't count, if the sum=3, then generate a random number from uniform distribution, if this number is say less than 0.5, then count this sum, if greater than 0.5, then don't count. I am having trouble with introducing this
2016 Apr 20
0
simulation in R
I realized that there was a typo error. I mean "Monte Carlo Simulation" ________________________________________ From: R-help <r-help-bounces at r-project.org> on behalf of Kristi Glover <kristi.glover at hotmail.com> Sent: April 19, 2016 11:48 PM To: R-help Subject: [R] simulation in R Hi R user, Would you mind to help me to find the range with stochastic events? For
2009 Feb 24
0
Wavelet Bootstrap Size Simulation
I have written a short script to estimate the size of a test of non-constant mean in an AR(1) time series. When I run the simulation on my PC (R version 2.7.1), I get the expected result: an empirical size much larger than the nominal size. On the Red Hat machine (R version 2.7.2) in my department, however, I get p-values > .45 for every simulated test. Below is my simulation code (uses
2005 Mar 04
11
R: simulation
hi all a simple question i want to run simulations in r. i however want the experiments to be repeated at a later time with exactly the same numbers by other users. can i set the random number seed for rnorm in some way? e.g. is there some arguement that goes with rnorm? please supply an example regards Allan
2016 Apr 20
2
simulation in R
Hi R user, Would you mind to help me to find the range with stochastic events? For example, daT<-structure(list(sn = 1:14, growthrate = c(0.5, 0.6, 0.7, 0.99, 0.1, 0.3, 0.4, 0.5, 0.5, 0.2, 0.1, 0.4, 0.3, 0.43)), .Names = c("sn", "growthrate"), class = "data.frame", row.names = c(NA, -14L)) I want to find the ranges of growth rate of the above data using Mote
2012 Dec 01
1
Simulation in R
Hello! How can I do 100 simulations of length 17 from bivariate bivariate normal distribution, if I know all 5 parameters? -- View this message in context: http://r.789695.n4.nabble.com/Simulation-in-R-tp4651578.html Sent from the R help mailing list archive at Nabble.com.
2012 Nov 21
2
plotting 1000 simulations, error message: plot.new has not been called yet
Hi, I know this is not a mailing list for r, but I posted my question on several help pages and did not get any help. I really don't know how to solve my problem, maybe you could help me? want to simulate stock paths. I have simulated 1000 paths with 22 trading days (1 starting value). Now I want to include it into my presentation, but animated, so I need the png files. I want to create 1000
2006 Oct 04
2
Suitability of R for Algorithm simulations
Greetings, Sorry for the basic question, but I am trying to find out if R is a suitable platform for what I want to do... I am interested in creating simulations of distributed algorithms (i.e. team formation, Byzantine Generals , P2P communication modeling, mobile networks) that would be represented in GUIs. I would like to be able to instantiate an object for each node in my simulated