[R-sig-Geo] Monte Carlo simulation and random habitat selection

Turner Rolf r.turner at auckland.ac.nz
Thu Aug 26 02:28:02 CEST 2010



Elaine Kuo wrote:

Dear List,

I am trying to predict species distributions using MADIFA (Calenge et al.
2008).
However, the codes (Monte Carlo simulation) are not familiar to me,
and they seem unavailable in package adehabitat.
(similar to the response from the authors)

Please kindly help and thank you in advance.

Elaine

In this paper, it says that

1. At  each  step  of  the  process,  we  simulated  a
random  habitat  use  by  the  chamois  by  generating  a
uniform distribution of 400 points over the study area.

=> Please kindly suggest any code or package that can perform the
randomization.

     The runifpoint() function in the spatstat package will do this for you.

2.  We repeated this simulation
500 times to derive a distribution of eigenvalues under
the  hypothesis  of  random  habitat  use.

=> Please kindly suggest any code or package that can perform the
repetition.

     Just use  a for-loop!

     E.g.
     result <- numeric(500) 
     for(i in 1:500) {
           X <- runifpoint(500,win=W) # Where W is an object of class "owin" specifying the habitat area.
           <code from the adehabitat package>
           result[i] <- <largest eigenvalue of the MADIFA for X>
    }


3. We  finally
compared the first eigenvalue of the MADIFA of the
observed 400 chamois groups to this simulated distri-
bution to derive a P value.

=> Is this a chi-square test ? Or any other suitable tests ?

      No this is ***NOT*** a chi-squared test!  It is a Monte Carlo test!!!

      Compare the observed statistic with the simulated statistics.  The p-value is
      
      (1 + sum(result >= Stat))/501

      where "Stat" is the largest eignenvalue of the MADIFA for the real data set.

      Note that if you want a "nice round p-value" you should do 99 or 999 simulations
      rather than 500 such.  But this is a bit anal-compulsive!

      Note also that I have no idea what the adehabitat package does what "MADIFA"
      means, so I may have got the jargon a bit wrong in the foregoing --- but the general
      idea is there.

                cheers,

                      Rolf Turner
######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################



More information about the R-sig-Geo mailing list