Displaying 5 results from an estimated 5 matches for "pop_siz".
Did you mean:
pop_size
2011 Dec 13
2
Generating input population for microsimulation
...0
? [5,]????? 1?? 5????? 0
? [6,]????? 1?? 6????? 0
? [7,]????? 1?? 7????? 0
? [8,]????? 1?? 8????? 0
? [9,]????? 1?? 9????? 1
? [10,]??? 1?? 10?? 1
...
I came up with the following code, but am having some trouble getting it to populate my matrix the way I'd like.
world <- function(units, pop_size, unit_size){
??? pid <- rep(0,pop_size) #person ID
??? senior <- rep(0,pop_size) #senior in charge
??? unit_id <- rep(0,pop_size) #unit ID
???
??? ??? for (i in 1:pop_size){
??? ??? for (f in 1:units)??? {?
??? ??? senior[i] = sample(c(1,1,0,0,0,0,0,0,0,0), 1, replace = FALSE)
??? ??? p...
2009 Apr 26
3
3 questions regarding matrix copy/shuffle/compares
Hello all,
I have the following function call to create a matrix of POP_SIZE rows
and fill it with bit strings of size LEN:
pop=create_pop_2(POP_SIZE, LEN)
I have 3 questions:
(1) If I did
keep_pop[1:POP_SIZE] == pop[1:POP_SIZE]
to keep a copy of the original data structure before manipulating
'pop' potentially, would this make a deep copy o...
2019 Jan 16
2
optimizacion costos
Estimado Jesús Para Fernández
En teoría es ese material, lo vi muy rápido y en la parte genética tiene
cosas que biológicamente no son así, hay un libro de Falconer, Introducción
a la genética cuantitativa, que tiene escrita la parte matemática, hay un
abismo entre la biología y los ingenieros que se inspiran en la biología.
Yo pensaba en la resolución de un problema real, aunque relativamente
2011 Oct 12
2
How to transfer the variable into function in this code?
as shown in the code, four variables input: diff_expr,diff_coex, klist,
Pop_size, are included in the function. However, within the function,
another variable "vector" is utilized in some subfunction. How they get its
value?
thx
get_quantiles <-function(diff_expr,diff_coex,klist,pop_size){
##### The function to get the "node_score_term" and "edge...
2010 Mar 11
2
Comparing matrices
...me <- function(len)
{
sample(0:1, len, replace=T)
}
# create popsize members, each of length len
create_pop_2 <- function(popsize, len)
{
datasize=len*popsize
npop <- matrix(0, popsize, len, byrow=T)
for(i in 1:popsize)
npop[i,] = create_bin_Chromosome(len)
npop
}
POP_SIZE = 3
LEN = 8
pop = create_pop_2(POP_SIZE, LEN)
pop2 = pop
print(pop==pop2)
if (pop==pop2) { cat('equal\n') } else { cat('NOT equal\n') }
print(pop)
print(pop2)
pop[2,5] = 99
pop2[3,3] = 77
print(pop==pop2)
if (pop==pop2) { cat('equal\n') } else { cat('NOT equal\n...