dim dispersal matrices

17 views
Skip to first unread message

Camilla Stefanini

unread,
Jul 18, 2024, 4:23:53 AM7/18/24
to nemo-simul
Hi all, 
I have some errors with my dispersal matrices I cannot fix. 
My number of patch of my matrix is 1628, and I have built my full dispersal matrices and reduced connectivity and rate matrices with this number of rows. Howver, as in some patches there are no trees, I have empty rows like this 
{{}
{}
{}
{}
{5,4 etc.
is this correct? I have the following errors when I try to run the simulation


# DISPERSAL
dispersal_matrix &NEMO_seed_dispersal_matrix.txt
 ***ERROR*** the size of the female dispersal matrix is not equal to patch_number X patch_number (2650384[1628,1628] != 40335201)!

# OR
dispersal_model 1
dispersal_connectivity_matrix  &NEMO_seed_connectivity_matrix.txt       
dispersal_reduced_matrix  &NEMO_seed_rate_matrix.txt              
***ERROR***  The female connectivity dispersal matrix must have as many rows as the number of patches in the population

But when I check the dimensions of my matrices, 
dim(connectivity and dispersal matrix) = 1628 x 1628 !!!

Is it a problem of handling empty rows perhaps? or else?
Attached my script and my matrices!!
thanks for any input!

Camilla
files.zip

Frederic Guillaume

unread,
Jul 18, 2024, 6:07:46 AM7/18/24
to nemo-simul
Hi Camilla,

indeed, you cannot have empty rows in the dispersal matrices (we'll add an error message in future versions)

the entries in the matrices are independent of the number of individuals that are or may be present in a patch, they only describe the probability to move between patches

the minimum size of a row of the two reduced dispersal matrices should be 1 (for instance, set the number in the connectivity matrix to the focal patch number and set the dispersal rate to 1 in the rate matrix so that individuals in that patch only stay in that patch)

note that the patches are initialized from information passed to the 'patch_capacity' or 'patch_nbfem/_nbmal' parameters -- use temporal arguments to change the patch capacity after initialization if only a couple patches hold individuals at the first generation but can hold more individuals after initialization

I hope this helps!

Best,
Fred

Camilla Stefanini

unread,
Jul 19, 2024, 1:06:27 PM7/19/24
to nemo-simul
Thank you Fred for the useful input, 
I have changed the matrices following your suggestions and tried again, but I still have an error message I cannot understand. 
***ERROR*** problem reading input file; line 386851 appears corrupted, skipping line

Could you please confirm that the matrices are correct now? 
Thanks, 
Camilla
NEMO_seed_rate_matrix.txt
NEMO_script_base_test.ini
NEMO_seed_connectivity_matrix.txt

Frederic Guillaume

unread,
Jul 22, 2024, 4:43:15 AM7/22/24
to nemo-simul
Hi Camilla,
add an empty line at the end of each of the external parameter files. That should solve the problem. 
Best,
Fred
Reply all
Reply to author
Forward
0 new messages