nateosher / DIMPLE

MIT License
2 stars 1 forks source link

pat.density can return negative values #38

Closed mariamasotti1 closed 1 year ago

mariamasotti1 commented 1 year ago

it looks like there is an option in the spatstat.explore::pat.density() function to force all density values to be positive. it defaults to FALSE. petition to change the default in our package to TRUE? or at least pass it as an option? it messes up computation of jsd downstream.

mariamasotti1 commented 1 year ago

code to replicate the issue

ppp<-SimulateGrid(
  list(
    GridRect(100, 100, 0, 0, 50, 50, .1),GridRect(100, 100, 50,50,100,100,.05)
  )
)
obj<-new_MltplxExperiment(x = ppp$x,
                          y = ppp$y,
                          marks = factor(ppp$marks),
                          slide_id =rep(1,length(ppp$x)),ps=1,bw=2)
any(which(obj$mltplx_objects[[1]]$mltplx_intensity$intensities<0)) 
update_dist(obj,jsd) #causes error
nateosher commented 1 year ago

Very weird. I vote to change.

mariamasotti1 commented 1 year ago

agree- not sure why we would ever want negative values. will make a pr and link it.