<p>Hi.</p><p>I am attempting to create a method to forensically assign migratory birds to their geographic origins (on a GIS layer from <a href="http://wateriso.eas.purdue.edu/waterisotopes/pages/data_access/ArcGrids.html">http://wateriso.eas.purdue.edu/waterisotopes/pages/data_access/ArcGrids.html</a>) based on stable-istope analyses of the feathers.</p><p>I am trying to use Bayes' Theorem to assign birds, one at a time to the aforementioned surface (after calibration of the surface into values expected for bird feathers). I am having some success with the following script.....</p><p>#####ASSIGN BIRDS using Bayes' Theorem for a Normal Probability density##################################<br />birds<- c(-121.07,-112.56)<br />SD<-12.56587<br />for (i in 1:length(birds)){<br /> rsaga.grid.calculus(in.grids = c("wtspddf.sgrd"),<br /> out.grid = paste("wtspassignment",i,".sgrd",sep=""),<br /> formula = paste("(1/(sqrt(2*",pi,")*",SD,"))*exp(-(1/(2*(",SD,")^2))","*(",birds[i],"-a)^2)",sep=""))<br />}<br /> </p><p>However, I wish to multiply this with another surface representing prior probabilities, but the results from the above script have so many decimal places (e.g. max 0.03141 min 0.000006) that applying the prior probabilities appears to exceed the number of digits allowed for a grid, resulting in all zeros). I want to normalize the above by dividing by the maximum value of the result, but see no way to calculate the maximum value for a surface. Does anyone know of a way I could do this? Or is it possible to reset the number of digits? I suppose that ther disadvantage to changing the number of digits would expand the file sizes enormously....</p><p>I suppose I could also consider multiplying by an arbitrary amount first (before applying priors) as an alternative, but wanted to normalize by dividing by max. Suggestions would be most appreciated.</p><p> </p><p>Cheers</p><p> </p><p>-Steve</p><p> </p><p> </p>