[R-sig-Geo] Problems with Kcross.inhom

David Villalobos avi3187 at gmail.com
Tue Oct 22 14:37:12 CEST 2013


Hi Rolf and Julia


Many thanks for your help, I appreciate that. I am sorry for the
inconvenient, I am new in these things.


Just to clarify, my window is complex because is created from a "shapefile"
that delimit my study area.  This study area (called "W" in the analysis)
have the spatial locations of my data ("ficus" and "tienda").


With the purpose of reproduce the analysis and try to find the problem, in
the attachment documents you can find the "shapefile" of my study area, a
"txt" document of my data and my R script (Kcrossinhom(DV)).


Again, I really appreciate your help. Thank you.


Cheers


2013/10/21 Julia Chacon Labella <juliachacon at gmail.com>

> Yes, I tried to reproduced your example, and I didn´t have any problem.
> Have you check how are your lambdas?? Why are you using "at points" instead
> of the default "by pixel"??
>
> It seems that could be the lambda values what is wrong. Try to visualized
> them, and try with the pixel image.
>
> Other option is to built a new window for your pattern. How did you built
> it?
>
>
>
> 2013/10/22 Rolf Turner <r.turner at auckland.ac.nz>
>
>>
>>
>> Again, your problem is not reproducible.  We do not have the objects
>> "north", "west", "W" and "tipo" which are necessary to duplicate your
>> steps.
>>
>> I tried to reproduce your problem with an artificial example:
>>
>> W <- owin(c(0,3350),c(0,6150))
>> set.seed(42)
>> Z <- runifpoint(201,win=W)
>> m <- sample(rep(c("ficus","tienda")**,c(131,70)),201)
>> marks(Z) <- factor(m)
>> ff <- with(split(Z),bw.diggle(ficus)**)
>> tt <- with(split(Z),bw.diggle(**tienda))
>> lambdaf <- with(split(Z),density(ficus,**ff,at="points"))
>> lambdat <- with(split(Z),density(tienda,**tt,at="points"))
>>
>> K <- Kcross.inhom(Z,"ficus","**tienda",lambdaf,lambdat)
>>
>> No problema.
>>
>> It is possible that the error has something to do with the rather
>> intricate
>> (1716 vertices) boundary of your observation window.  However since I
>> don't
>> have that window I can't tell.
>>
>> cheers,
>>
>> Rolf Turner
>>
>>
>>
>> On 10/22/13 10:16, david.villalobos wrote:
>>
>>> Sure Julia,
>>>
>>> First:
>>>
>>> I have the following object called "Z"
>>>
>>>  Z <- ppp(north, west,window=W,marks=tipo)
>>>> summary(Z)
>>>>
>>> Marked planar point pattern: 201 points
>>> Average intensity 4.46e-05 points per square unit
>>>
>>> Coordinates are integers
>>> i.e. rounded to the nearest 1 unit
>>>
>>> Multitype:
>>>         frequency proportion intensity
>>> ficus        131      0.652  2.90e-05
>>> tienda        70      0.348  1.55e-05
>>>
>>> Window: polygonal boundary
>>> single connected closed polygon with 1716 vertices
>>> enclosing rectangle: [484546.8, 487897.4] x [1147521.3, 1153682.9] units
>>> Window area =  4509680 square units
>>>
>>> Second:
>>>
>>> I calculated the bandwidth sigma for the kernel estimator of point
>>> process
>>> intensity with a Cross Validated Bandwidth Selection for Kernel Density
>>> (bw.diggle)
>>>
>>>  attach(split(Z))
>>>> f<-bw.diggle(ficus)
>>>> t<-bw.diggle(tienda)
>>>>
>>> Third:
>>>
>>> I calculated with the Kernel Smoothed Intensity of Point Pattern
>>> (density.ppp) the values of the the estimated intensity of the
>>> sub-process
>>> of points of type i and j:
>>>
>>>  lambdaf<-density.ppp(ficus,f,**at="points")
>>>> lambdat<-density.ppp(tienda,t,**at="points")
>>>>
>>> and Finally:
>>>
>>> I ran the script for Kcross.inhom for the method (1): estimate
>>> intensities
>>> by nonparametric smoothing, but I had the error.
>>>
>>>  K <- Kcross.inhom(Z, "ficus", "tienda", lambdaf, lambdat)
>>>>
>>> Error in Kwtsum(dclose, bI, weight, b, 1/lambdaI, breaks) :
>>>    Weights in K-function were infinite or NA
>>>
>>> I tryed the method (2): leave-one-out, but I had the same problems
>>>
>>> Any help is appreciated. A lot of thanks.
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://r-sig-geo.2731867.n2.**
>>> nabble.com/Problems-with-**Kcross-inhom-**tp7584914p7584920.html<http://r-sig-geo.2731867.n2.nabble.com/Problems-with-Kcross-inhom-tp7584914p7584920.html>
>>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>>
>>> ______________________________**_________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>>
>>
>> ______________________________**_________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>
>
>
>
> --
> Julia
>



-- 

Saludos

David Villalobos Chaves
Maestría Académica en Biología
Universidad de Costa Rica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131022/c0f82834/attachment.html>
-------------- next part --------------
tipo	X	Y
tienda	486080	1149670
tienda	486142	1149690
tienda	486111	1150020
tienda	486135	1150010
tienda	486186	1150030
tienda	486126	1150040
tienda	486080	1150010
tienda	486051	1150020
tienda	486038	1149990
tienda	486036	1149990
tienda	486036	1149990
tienda	486049	1150000
tienda	485907	1149910
tienda	485813	1149900
tienda	485788	1149860
tienda	485808	1149870
tienda	485888	1149900
tienda	486016	1149980
tienda	486113	1150200
tienda	486115	1150200
tienda	486109	1150200
tienda	486093	1150170
tienda	486082	1150140
tienda	486076	1150140
tienda	486058	1150110
tienda	485971	1150120
tienda	485971	1150120
tienda	485971	1150120
tienda	486005	1150070
tienda	485523	1149580
tienda	485724	1149800
tienda	486487	1151010
tienda	486544	1150890
tienda	486531	1150860
tienda	486537	1150860
tienda	486509	1150880
tienda	486505	1150880
tienda	486485	1150920
tienda	486511	1150820
tienda	486513	1150820
tienda	486566	1150720
tienda	486558	1150740
tienda	486562	1150740
tienda	486560	1150740
tienda	486564	1150760
tienda	486553	1150790
tienda	486516	1150830
tienda	486544	1150920
tienda	487792	1150300
tienda	487792	1150300
tienda	486496	1150900
tienda	486496	1150840
tienda	486557	1150730
tienda	486764	1151800
tienda	486012	1150000
tienda	485815	1149720
tienda	486076	1149680
tienda	485897	1149900
tienda	485815	1149890
tienda	486043	1150020
tienda	486009	1149970
tienda	485848	1149880
tienda	486070	1149680
tienda	485854	1149750
tienda	485924	1149920
tienda	485799	1149810
tienda	485754	1149810
tienda	486463	1150940
tienda	486931	1150900
tienda	487314	1150640
tienda	486703	1151680
tienda	486533	1150860
tienda	486685	1151670
tienda	486819	1151700
ficus	487413	1153530
ficus	487591	1150610
ficus	486612	1151120
ficus	486664	1151250
ficus	486606	1151050
ficus	486536	1151090
ficus	486685	1151580
ficus	486707	1151720
ficus	486901	1151360
ficus	486697	1151510
ficus	486633	1151240
ficus	486618	1150700
ficus	487063	1152380
ficus	487057	1152380
ficus	486926	1152600
ficus	486908	1152610
ficus	486892	1152530
ficus	486947	1153300
ficus	486993	1153300
ficus	486926	1153130
ficus	486887	1153160
ficus	486890	1153110
ficus	486231	1149630
ficus	486125	1150230
ficus	486311	1150270
ficus	486350	1150260
ficus	486241	1150060
ficus	486658	1152660
ficus	486222	1150250
ficus	486146	1150180
ficus	486155	1150160
ficus	486012	1149760
ficus	486435	1150390
ficus	486432	1150460
ficus	486441	1150460
ficus	486411	1150470
ficus	485550	1149990
ficus	486171	1150430
ficus	486031	1150310
ficus	486143	1150340
ficus	485030	1149470
ficus	484969	1149230
ficus	484972	1149220
ficus	484963	1149200
ficus	484978	1149230
ficus	485063	1149390
ficus	484945	1149190
ficus	484941	1149200
ficus	484935	1149110
ficus	484935	1149080
ficus	484929	1149070
ficus	486149	1149780
ficus	485973	1149720
ficus	486113	1149430
ficus	486688	1150080
ficus	486700	1150050
ficus	486709	1150070
ficus	486718	1150100
ficus	484768	1148780
ficus	484686	1148740
ficus	486019	1150030
ficus	485988	1150020
ficus	485891	1149930
ficus	485824	1149950
ficus	485742	1149890
ficus	485757	1149900
ficus	485882	1149850
ficus	485036	1148980
ficus	484972	1148750
ficus	485012	1149400
ficus	486161	1150090
ficus	486152	1150090
ficus	486131	1150090
ficus	486165	1150190
ficus	486381	1150240
ficus	486688	1149950
ficus	486168	1150460
ficus	485191	1149950
ficus	486183	1150470
ficus	485191	1149940
ficus	486015	1149590
ficus	485857	1149850
ficus	485760	1149910
ficus	485885	1149930
ficus	486704	1152670
ficus	486689	1152670
ficus	486686	1152670
ficus	486070	1150050
ficus	486277	1150090
ficus	485900	1149970
ficus	485821	1149840
ficus	486149	1150120
ficus	486140	1150120
ficus	486493	1150370
ficus	486490	1150360
ficus	485924	1149920
ficus	485891	1149940
ficus	486162	1150110
ficus	485799	1149840
ficus	485803	1149840
ficus	485912	1149940
ficus	485879	1149930
ficus	485632	1149800
ficus	485672	1149640
ficus	486052	1149990
ficus	486209	1148180
ficus	486000	1149860
ficus	486140	1149760
ficus	485897	1149680
ficus	486261	1148130
ficus	486456	1148000
ficus	486513	1147960
ficus	486553	1147780
ficus	486574	1147800
ficus	486580	1147770
ficus	486443	1147710
ficus	486440	1147670
ficus	486611	1147730
ficus	486507	1148010
ficus	486349	1148080
ficus	486334	1148090
ficus	486331	1148080
ficus	486395	1148070
ficus	486489	1148010
ficus	486173	1149570
ficus	486210	1149520
ficus	486237	1149480
ficus	486355	1148060
ficus	486337	1148070
ficus	486113	1149470
ficus	485708	1149710
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Kcrossinhom(DV).R
Type: application/octet-stream
Size: 704 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131022/c0f82834/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: study area.rar
Type: application/rar
Size: 20551 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131022/c0f82834/attachment.bin>


More information about the R-sig-Geo mailing list