search for: d_0

Displaying 4 results from an estimated 4 matches for "d_0".

Did you mean: d0
2019 Sep 14
0
'==' operator: inconsistency in data.frame(...) == NULL
...erated in those cases. There is a simple fix (see also below). There are other issues with the S4 class example (i.e. data.frame() == <s4_object with representation as list>) which fails for different reasons. ############################################################################## d_0 = data.frame(a = numeric(0)) # zero length data.frame d_00 = data.frame(numeric(0)) # zero length data.frame without names names(d_00) <- NULL # remove names to obtain value being an empty list() at the end of Ops.data.frame d_3 = data.frame(a=1:3) # non-empty data.frame m_0 = matrix(logical(0...
2018 Apr 18
2
Event-triggered change in value with a time-delay
...rection. Additionally, when the variable crosses the threshold (either by increasing or decreasing), there is a time delay (delay) before the parameter shifts values. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Toy model: # define parameters P <- c(m = 10, R_1 = 0.5, R_2 = 0.1, D_0 = 50, D_T = 5, delay = 3 ) # set initial values y_0 <- c(D = 0, Y = 1) # set timesteps times <- seq(0, 100, length = 101) # define function bit <- function(t,y,parms){ with(as.list(c(parms,y)),{ # How I would implement the change if there was no time delay # m &...
2019 Sep 11
2
'==' operator: inconsistency in data.frame(...) == NULL
Sorry, I can't reproduce the example below even on the same machine. However, the following example produces the same error as NULL values in prior examples: > setClass("FOOCLASS", +????????? representation("list") + ) > ma = new("FOOCLASS", list(M=matrix(rnorm(300), 30,10))) > isS4(ma) [1] TRUE > data.frame(a=1:3) == ma Error in
2018 Apr 18
0
Event-triggered change in value with a time-delay
...: very lightly tested in your toy example, which did generate a result where D cross that threshold without blowing up. -- David. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Toy model: > # define parameters > P <- c(m = 10, > R_1 = 0.5, > R_2 = 0.1, > D_0 = 50, > D_T = 5, > delay = 3 > ) > # set initial values > y_0 <- c(D = 0, Y = 1) > > # set timesteps > times <- seq(0, 100, length = 101) > > # define function > bit <- function(t,y,parms){ > with(as.list(c(parms,y)),{ > > >...