<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convex hull without IML repeat in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476721#M24816</link>
    <description>&lt;P&gt;Thanks. As you helped me see there is no precise definition of "outer edges". From your blog of nearest neighbours I tried enclosing the data in the closest rectangle&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data_with_rectangle.PNG" style="width: 363px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21678i5ACA448526840235/image-size/large?v=v2&amp;amp;px=999" role="button" title="data_with_rectangle.PNG" alt="data_with_rectangle.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I then used modeclus and calculated n nearest neighbours. Whenever I had a near neighbour to the added frame I could partly find "outer" ponts. Was hard to find cut-off values for the number of nearest neighbours and bad results when the data were not close to a rectangle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the data are gridded from the outset I used the precise grid definitions which is in a different coordinate system called i,j. For these i found the min and max for j for each i and min and max for i for each j. This give me global outer edges. Then to draw the polygon I ordered the point using the travelling sales man network solver.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Solution with polygon.PNG" style="width: 419px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21681i3F96D9EBC773B0D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Solution with polygon.PNG" alt="Solution with polygon.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As can be seen from the picture above the results are reasonable. The red area is still a challenge. I know I can solve this by using adaptivereg on each i and j line with some postprocessing rules. However, at the moment I think the given solution is OK. Having tested on 15 different point shapes it seems as if there is a reasonable generalization.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2018 10:10:15 GMT</pubDate>
    <dc:creator>PaalNavestad</dc:creator>
    <dc:date>2018-07-10T10:10:15Z</dc:date>
    <item>
      <title>Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475607#M24768</link>
      <description>&lt;P&gt;Hi, I see from previous posts that there is a convex hull in IML. I do hot have this available.. I'm just checking to see if there are some other ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is briefly described in the graph.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Outeredges_of_pointcloud.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21585iD0F218FAD9E4B6B7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Outeredges_of_pointcloud.PNG" alt="Outeredges_of_pointcloud.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The points are actually defined in proc modeclus, which give me a good separation of different clusters. I was hoping that the Boundary would give me the edges but this only give edges towards other clusters. If anybody has any idea without IML I would be gratefull.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Pål N&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 13:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475607#M24768</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-05T13:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475628#M24772</link>
      <description>&lt;P&gt;I don't understand what you want. The red curve is NOT the convex hull (note that it is not convex. What is the red curve and how do want to compute it?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 14:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475628#M24772</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-05T14:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475711#M24773</link>
      <description>&lt;P&gt;Thanks for a prompt response.&lt;/P&gt;&lt;P&gt;Sry for the confusion, What I really want is to find the points that markes the outer boundaries of the shape. Another way of saying this is to find the minimal irregular&amp;nbsp; polygon that contains all the points.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shown points is a cluster from Modeclus that seem to give really good separtion of different areas in a large X-Y grid. For subsequent use a polygon that can be used in a map is benfical. Then for insatnce Ginside can be used to find other features and ares.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 15:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475711#M24773</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-05T15:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475728#M24774</link>
      <description>&lt;P&gt;What do you mean by "minimal"? Minimal area? Minimal perimeter? Do you have a reference paper or article that describes this procedure, or is this something that you are making up?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some data. I can think of multiple ways to put a polygon around these points. Please describe the rules for the polygon that you want in terms of the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Pts;
input x y @@;
datalines;
-2 3   -1 1  -2 0   0 1    1 1
 0 1.5  1 3   0 2  -1 1.5 -1 2
;

proc sgplot data=Pts;
scatter x=x y=y;
xaxis grid; yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jul 2018 16:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475728#M24774</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-05T16:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475773#M24778</link>
      <description>&lt;P&gt;Hi, thanks. No I don't have a paper. I'm looking for ways to simplify a part visualization, part how to analyze data problem. The challenge is that the data is part of a 680,000 point grid. for each of these grid points there are 13 measurements over time. By combining two regression methods we have found a way to identify when slope changes. In some cases it is possible to associate this with nearby activity. Pure plotting and eye balling kind of works but get you biased towards the known activities. One thought was that we could make polygons we could easily test if there are activities inside. The we could find the areas where there are no activity. But from your kind answers it is obvious that the problem does not have a precise definition. We are also looking at Esri tools for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another wish for polygons is that it would then be possible to use map functions in VA and use these as subsetting and start mechanisms for more advanced analytical techniques within the area.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thinking about this it might be a solution to make a square from max and min X and max and min y divide this into equal points close to the original grid of the data.. Then some combinations of distance can give the edge.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And we do not have an article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 18:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475773#M24778</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-05T18:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475786#M24781</link>
      <description>&lt;P&gt;I don't fully understand your problem, but&amp;nbsp;here are some links to procedures that are used for analyzing spatial data, in case the links might be useful for you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/03/23/nonparametric-regression-binary-response-sas.html" target="_self"&gt;PROC ADAPTIVEREG example&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_adaptivereg_toc.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;PROC ADAPTIVEREG documentation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_spp_toc.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;PROC SPP (spatial point processes)&lt;/A&gt;&amp;nbsp;and &lt;A href="https://blogs.sas.com/content/iml/2016/09/19/nearest-neighbor-distances.html" target="_self"&gt;an example from my blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_hpsplit_toc.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;PROC HPSPLIT&amp;nbsp;documentation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe someone else will have an idea. Best wishes for your success.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 19:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/475786#M24781</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-05T19:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476025#M24787</link>
      <description>&lt;P&gt;Maybe PROC KDE could give you somthing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc kde data=bivnormal;
bivar x y / plots=(contour surface);
run;
ods graphics off;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jul 2018 14:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476025#M24787</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-06T14:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476707#M24815</link>
      <description>&lt;P&gt;Thanks. The picture show results for some of my real data. The kernel traces reasonably well. I had a hard time finidng an efficent way to get the kernel lines into a polygon shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really nice for visualization though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KDE_result.PNG" style="width: 392px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21677iBDADACE6D01E29E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="KDE_result.PNG" alt="KDE_result.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 09:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476707#M24815</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-10T09:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476721#M24816</link>
      <description>&lt;P&gt;Thanks. As you helped me see there is no precise definition of "outer edges". From your blog of nearest neighbours I tried enclosing the data in the closest rectangle&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data_with_rectangle.PNG" style="width: 363px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21678i5ACA448526840235/image-size/large?v=v2&amp;amp;px=999" role="button" title="data_with_rectangle.PNG" alt="data_with_rectangle.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I then used modeclus and calculated n nearest neighbours. Whenever I had a near neighbour to the added frame I could partly find "outer" ponts. Was hard to find cut-off values for the number of nearest neighbours and bad results when the data were not close to a rectangle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the data are gridded from the outset I used the precise grid definitions which is in a different coordinate system called i,j. For these i found the min and max for j for each i and min and max for i for each j. This give me global outer edges. Then to draw the polygon I ordered the point using the travelling sales man network solver.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Solution with polygon.PNG" style="width: 419px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21681i3F96D9EBC773B0D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Solution with polygon.PNG" alt="Solution with polygon.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As can be seen from the picture above the results are reasonable. The red area is still a challenge. I know I can solve this by using adaptivereg on each i and j line with some postprocessing rules. However, at the moment I think the given solution is OK. Having tested on 15 different point shapes it seems as if there is a reasonable generalization.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 10:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476721#M24816</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-10T10:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476810#M24821</link>
      <description>&lt;P&gt;I don't know if the following code could give you a help.&lt;/P&gt;
&lt;P&gt;I also want know how to plot these contour lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
ods output ContourPlot=ContourPlot Controls=Controls Inputs=Inputs;
proc kde data=sashelp.class;
bivar weight height / plots=contour;
run;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476810#M24821</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-10T13:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476813#M24822</link>
      <description>&lt;P&gt;It now sounds like you might be interested in the contours/boundaries of the highest-density regions. See the article &lt;A href="https://blogs.sas.com/content/iml/2016/08/01/highest-density-regions-sas.html" target="_self"&gt;"Compute highest density regions in SAS"&lt;/A&gt; for code to compute these regions.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476813#M24822</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-10T13:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476817#M24823</link>
      <description>&lt;P&gt;Thanks I've tried that one but did not get very much further.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476817#M24823</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-10T13:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convex hull without IML repeat</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476819#M24824</link>
      <description>&lt;P&gt;Thanks, I'm going on vactaion today so I do not have time to try this before I leave. Also from your blosg it seems as if I have to fight to get IML into the licence again.:-)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Convex-hull-without-IML-repeat/m-p/476819#M24824</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2018-07-10T13:59:05Z</dc:date>
    </item>
  </channel>
</rss>

