Displaying 20 results from an estimated 2000 matches similar to: "model simulation"
2010 Jun 07
1
Desolve package: How to pass thousand of parameters to C compiled code?
Hi,
I have used DeSolve package for my ODE problem regarding infectious disease transmission and currently am trying to pass lots (roughly a thousand) of model parameters to the C compiled model (I have to use C compiled code instead of R code purely because of the speed).
I can't go define it one by one as it gonna take ages to finish and also quite difficult to revise. I have read the
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs,
I want to plot the following barplot with lines instead of bars. Is there a way?
data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)))
d <- t(data[,2:4])
barplot(d, beside=TRUE)
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo
2010 Apr 26
1
finite difference scheme for 2D differential equations
Hello everyone,
I am trying to solve 2D differential equations using finite difference
scheme in R. I have been able to work with the equations with only one
spatial dimensions but I want to extend it to the two dimensional problem.
For example i can simulate one dimensional diffusion using a code like the
following. But I want to write a similar code for,say, a two dimensional
diffusion
2009 Aug 19
2
line plot
Dear useRs,
How can I draw a barplot, but instead of bars, I'd get lines?
Thanks,
Kind regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
2009 Aug 20
3
categorized barplot
Dear useRs,
I can't seem to find out how to categorize my histogram.
I have the following dataset:
Time??????????? First.day? Second.day
08:00-10:00??????? 9?????????? ? 8
10:00-12:00?????? 13???????? ? 15
12:00-14:00??????? 9?????????? ? 9
14:00-16:00???????10????????? ? 9
I attached a jpeg file to this e-mail containing the sketches.
What I'd like to do is a barplot (or histogram),
2010 Jan 29
2
Create matrix with subset from unlist
Hello all,
I'm trying to create a 2x2 matrix, 32 times after unlist() so that I can
convert the list to matrix. I've looked through the R archive but
couldn't find the answer. There is what I've done.
> f <- system("ls *.txt", intern=TRUE)
> x <- lapply(f, read.table)
> x
[[1]]
V1 V2
1 -27.3 14.4
2 29.0 -38.1
[[2]]
V1 V2
1 14.4
2004 Jul 24
3
Population simulation.
Hello,
can anyone tell me if R has any special function for simulating the structure
of human populations? Something like the genetic algorithm?
I need to simulate a sample of a population with a specific structure. Is
there something on R that can help me?
Thanks to everyone.
__________________________________________________________
2010 Jan 02
2
help with for loop
Dear useRs,
I want to write a function that generates all the possible combinations of diff().
Example:
If my vector has length 5, I need the diff() until lag=4 ->
c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3), diff(my.vec, lag=4))
If it has length 4, I need until lag=3 ->
c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3))
So, it must be until lag=(length(my.vec)-1).
2010 Apr 06
1
estimating the starting value within a ODE using nls and lsoda
All-
I am interested in estimating a parameter that is the starting value for an ODE model.
That is, in the typical combined fitting procedure using nls and lsoda (alternatively rk4), I first defined the ODE model:
minmod <- function(t, y, parms) {
G <- y[1]
X <- y[2]
with(as.list(parms),{
I_t <- approx(time, I.input, t)$y
dG <- -1*(p1 + X)*G +p1*G_b
dX <-
2009 Feb 02
1
Getting 'LinkingTo' to find the right library
I am experimenting with exporting pointers to some of the functions in
deSolve so that other packages may import them, using the
'R_RegisterCCallable' mechanism. I have added a header file and some
other C code in inst/include of the deSolve source package that need to
be accessible to other packages. I have a site-library set up in
Rprofile.site where all installed packages go, and as
2003 Sep 30
2
FW: error predicting values from the LME
HI all,
I might add some more information in order to possibly solve my problem. I'm
really stuck and no obvious solutions do the trick.
I'm using R 1.7.1 on Windows 2000 with the packages regurarly updated.
I'm using hypothetical data constructed as a pseudo population conforming to
a certain Var-Cov structure.
I might add that just
> predict(level2)
works. But when I add the
2009 Mar 12
8
help with loop
Dear useRs,
I'm trying to write a loop to sum my data in the following way:
(the second - the first) + (the third - the second) + (the fourth - the third) + ...
for each column.
So, I wrote something like this:
c <- list()
for(i in 1:ncol(mydata)) {
for(j in 2:nrow(mydata)) {
c[[i]] <- sum(yc[j,i] - yc[(j-1),i])
}}}
As for the columns it works pretty fine, but it only
2009 Jun 12
2
External signal in ODE written in C (using deSolve and approx1?)
Dear list
The deSolve package allows you to specify the model code in C or Fortran.
Thanks to the excellent vignette this works fine. However I have not yet
managed to use forcing functions in C code.
In pure R code this works very well with approxfun() specified outside the
model:
###############################################
#Model
lvml <- function(t, x, parms) {
2011 Jan 25
1
deSolve: Problem solving ODE including modulo-operator
I have a problem integrating the 'standard map' (
http://en.wikipedia.org/wiki/Standard_map
http://en.wikipedia.org/wiki/Standard_map ) with deSolve:
By using the modulo-operator '%%' with 2*pi in the ODEs (standardmap1), the
resulting values of P and Theta, should not be greater than 2pi. Because
this was not the case, i was thinking that the function 'ode' has some
2005 Oct 26
2
changing memory limits to speed up lsoda
Hi All,
I am running R 2.2.0 on Mac OS 10.4.2, dual G5 processors with 8 Gig
RAM.
I am running a simulation with lsoda that requires ~378 s to complete
one set of time intervals. I need to optimize the parameters, and so
need to considerably speed up the simulation.
I have tried to figure out how to change the appropriate memory
allocation and have search R help and Introductory
2012 Dec 17
2
Transport endpoint
Hi,
I've got Gluster error: Transport endpoint not connected.
It came up twice after trying to rsync 2 TB filesystem over; it reached about 1.8 TB and got the error.
Logs on the server side (on reverse time order):
[2012-12-15 00:53:24.747934] I [server-helpers.c:629:server_connection_destroy] 0-RedhawkShared-server: destroyed connection of
2010 Nov 28
3
non-linear fourth-order differential equations
I need to solve a system of non-linear fourth-order differential
equations. Is there a command which solves this system?
Thanks in advance.
2005 Jul 01
2
Simple indexing conundrum
My apologies in advance for my thickness but I can't seem to solve the
following, seemingly simple, data manipulation problem:
I have a data frame that contains multiple factors and multiple
continuous response variables, but duplicates of some factor
combinations. The duplicates contain bad data, so I would like to
eliminate the duplicates. I would like to retain the entire rows
2007 May 31
2
Different fonts on different axes
Hi Folks,
How do I get red bold font on my y axis and black standard font on my
x axis?
plot(runif(10), ylab="Red, Bold?", xlab="Black, standard?")
Any pointers or examples would be great.
Thanks!
Hank
Dr. Hank Stevens, Assistant Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056
Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
2018 Apr 18
2
Event-triggered change in value with a time-delay
Hello,
I am solving a set of ODEs using deSolve and have run into a problem I
would appreciate some advice on. One of the parameters (m) in the ODEs
changes between two states when one of the variables (D) crosses a
threshold (D_T) for the first time in either direction. Additionally, when
the variable crosses the threshold (either by increasing or decreasing),
there is a time delay (delay)