<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Operations Research sorted by most replies.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/478669" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/178439" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1703087" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/488913" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1895675" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1065416" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/251988" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/169161" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/394537" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/598249" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1907256" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1762584" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1736350" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/941017" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/441131" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3245846" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/220551" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/571131" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2223040" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2026904" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/478669">
    <title>Doing a KenKen in Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/478669</link>
    <description>Here&amp;#039;s today&amp;#039;s New York Times 4x4 KenKen solved in Mathematica.  The approach is to first construct all possible arrays with different numbers in each row, from that select all arrays that have different numbers in each column, then apply the constraints on various cells.  For this particular example, it was not necessary to apply all the constraints to get the unique answer.  It is necessary to take the absolute value of some difference and ratio constraints, since it the order of the difference or ratio is not known.&#xD;
&#xD;
    Dimensions[p4 = Permutations[Range[4]]]&#xD;
    &#xD;
    Out[1]= {24, 4}&#xD;
    &#xD;
    Dimensions[a1 = Flatten[Outer[List, p4, p4, p4, p4, 1], 3]] &#xD;
    &#xD;
    Out[2]= {331776, 4, 4}&#xD;
    &#xD;
    Dimensions[&#xD;
     a2 = Select[&#xD;
       a1, (And @@ (And @@ Unequal[Sequence @@ #] &amp;amp;) /@ Transpose[#]) &amp;amp;]] &#xD;
    &#xD;
    Out[3]= {576, 4, 4}&#xD;
    &#xD;
    Dimensions[a3 = Select[a2, #[[1, 1]]*#[[1, 2]]*#[[2, 2]] == 12 &amp;amp;]]&#xD;
    &#xD;
    Out[4]= {112, 4, 4}&#xD;
    &#xD;
    Dimensions[a4 = Select[a3, Abs[Log[#[[1, 3]]/#[[1, 4]]]] == Log[2] &amp;amp;]]&#xD;
    &#xD;
    Out[5]= {64, 4, 4}&#xD;
    &#xD;
    In[6]:= Dimensions[&#xD;
     a5 = Select[&#xD;
       a4, #[[2, 1]] + #[[3, 1]] + #[[3, 2]] + #[[4, 1]] == 11 &amp;amp;]]&#xD;
    &#xD;
    Out[6]= {8, 4, 4}&#xD;
    &#xD;
    In[7]:= Dimensions[a6 = Select[a5, Abs[#[[2, 3]] - #[[3, 3]]] == 2 &amp;amp;]]&#xD;
    &#xD;
    Out[7]= {6, 4, 4}&#xD;
    &#xD;
    In[8]:= Dimensions[a7 = Select[a6, #[[2, 4]] == 2 &amp;amp;]]&#xD;
    &#xD;
    Out[8]= {1, 4, 4}&#xD;
    &#xD;
    In[10]:= a7&#xD;
    &#xD;
    Out[10]= {{{1, 3, 2, 4}, {3, 4, 1, 2}, {4, 2, 3, 1}, {2, 1, 4, 3}}}</description>
    <dc:creator>Frank Kampas</dc:creator>
    <dc:date>2015-04-13T20:56:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/178439">
    <title>How to derive the global optimal value from several subset values?</title>
    <link>https://community.wolfram.com/groups/-/m/t/178439</link>
    <description>Hi, everybody, I would like to ask you guys a little question. I have three maximization problems, they are Q1, Q2 and Q3, respectively, as you can see below:[mcode]Clear[&amp;#034;`*&amp;#034;];
d2 = a - b*p2;Q1 = Maximize[{(p2*(a - b*p2) - (w2*(a - b*p2) - (v2*((a - b*p2))^2)/       2)), p2 &amp;gt;= a/b - (w2 - c)/(b*v2) &amp;amp;&amp;amp; c &amp;lt; w2 &amp;lt; (a - b*c)*v2 + c &amp;amp;&amp;amp;     a/b &amp;gt; p2 &amp;gt; w2 &amp;gt; 0 &amp;amp;&amp;amp; 2/b &amp;gt; v2 &amp;gt; 0}, {p2}]Q2 = Maximize[{(p2*d2 - (w2*d2 - (v2*(d2)^2)/2)),    p2 &amp;gt;= a/b - (w2 - c)/(b*v2) &amp;amp;&amp;amp; (a - b*c)*v2 + c &amp;lt;= w2 &amp;lt; a/b &amp;amp;&amp;amp;     2/b &amp;gt; v2 &amp;gt; 0 &amp;amp;&amp;amp; a/b &amp;gt; p2 &amp;gt; w2 &amp;gt; 0}, {p2}]Q3 = Maximize[{(p2*      d2 - (((w2)^2 - c^2)/(2*v2) + c*(d2 - (w2 - c)/v2))),    p2 &amp;lt;= a/b - (w2 - c)/(b*v2) &amp;amp;&amp;amp; 0 &amp;lt; c &amp;lt; w2 &amp;lt; (a - b*c)*v2 + c &amp;amp;&amp;amp;     2/b &amp;gt; v2 &amp;gt; 0 &amp;amp;&amp;amp; a/b &amp;gt; p2 &amp;gt; w2 &amp;gt; 0}, {p2}][/mcode]For Q1, I want to find the optimal p2 to maximize the first expression, i.e., p2*(a - b*p2) - (w2*(a - b*p2) - (v2*((a - b*p2))^2)/ 2)) , the same for Q2 and Q3.  In fact, it is easy to get the results for them respectively. However, my final purpose is going to find the global optimality, which means I have to compare the first expressions of the three problems. Therefore, I tried to use command Max[Q1, Q2, Q3], the result is odd. So there are two important questions: Firstly, how to pick up the optimal value of the first expressions from Q1, Q2 and Q3; secondly, which comand can be used to solve this problem of comparison since &amp;#034;Max&amp;#034; doesn&amp;#039;t work at all. Thank you very much in advance. </description>
    <dc:creator>Shaoyan Robert</dc:creator>
    <dc:date>2014-01-04T02:50:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1703087">
    <title>Alternating terms of two lists, as function.</title>
    <link>https://community.wolfram.com/groups/-/m/t/1703087</link>
    <description>Hello community. I have created a function and would like to know if it is worth submitting in Function Repository or if there is already something simpler that does this same job? If anyone can give any opinion on this I will be very grateful.&#xD;
&#xD;
I modestly have created a function that can interleave two lists by alternating their terms (unlike Riffle, which only fits the terms into gaps, this function does this keeping the same number of terms as it replaces them by both functions simultaneously).&#xD;
&#xD;
- It works like this:&#xD;
&#xD;
If the third term inside the function (&amp;#034;c_&amp;#034;) is {} the function does this automatically in a 1 to 1 pattern of each group:&#xD;
&#xD;
    Alternate[a_, b_] := Alternate[a, b, {}]&#xD;
    Alternate[a_, b_, c_] := &#xD;
     PadRight[a*&#xD;
        PadRight[&#xD;
         Take[Flatten@Table[If[c == {}, {1, 0}, c], Count[a, _]], &#xD;
          Min[Count[a, _], Count[b, _]]], Count[a, _], 1], &#xD;
       Max[Count[a, _], Count[b, _]]] + &#xD;
      PadRight[b*&#xD;
        PadRight[&#xD;
         Take[Flatten@Table[Abs[If[c == {}, {1, 0}, c] - 1], Count[b, _]],&#xD;
           Min[Count[a, _], Count[b, _]]], Count[b, _], 1], &#xD;
       Max[Count[a, _], Count[b, _]]]&#xD;
    &#xD;
    r = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};&#xD;
    s = {3, 5, 7, 9, 11, 13, 15, 17, 19, 21};&#xD;
    &#xD;
    Alternate[r, s]&#xD;
    Alternate[s, r]&#xD;
&#xD;
![ie1][1]&#xD;
&#xD;
The function works even with lists of different sizes, keeping the terms in excess unchanged:&#xD;
&#xD;
    p = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};&#xD;
    q = {3, 5, 7, 9, 11, 13, 15, 17};&#xD;
    &#xD;
    Alternate[p, q]&#xD;
    Alternate[q, p]&#xD;
&#xD;
![ie2][2]&#xD;
&#xD;
Or you can change the third term (&amp;#034;c&amp;#034;) in the function to any pattern (eg: {0,1,1,1}). Where &amp;#034;1&amp;#034; refers to the first term (&amp;#034;a&amp;#034;) from within the function while &amp;#034;0&amp;#034; refers to the term (&amp;#034;b&amp;#034;) from within the function:&#xD;
&#xD;
    t = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};&#xD;
    u = {3, 5, 7, 9, 11, 13, 15, 17};&#xD;
    &#xD;
    Alternate[t, u, {0, 1, 1, 1}]&#xD;
    Alternate[u, t, {0, 1, 1, 1}]&#xD;
&#xD;
![ie3][3]&#xD;
&#xD;
I would like to know if is this a good idea or there is a simpler way to do this? Is it worth sending a repository request?&#xD;
&#xD;
Thank you.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ie1.png&amp;amp;userId=1316061&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ie2.png&amp;amp;userId=1316061&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ie3.png&amp;amp;userId=1316061</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2019-06-12T19:48:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/488913">
    <title>FindRoot help with precision and accuracy</title>
    <link>https://community.wolfram.com/groups/-/m/t/488913</link>
    <description>Hi,&#xD;
&#xD;
I&amp;#039;m solving a non-linear system of equations with FindRoot. The system is very sparse, if I can say that about a non-linear system. After a few seconds of computation, Mathematica outputs the answer and gives me the error&#xD;
&#xD;
        FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal &#xD;
         and PrecisionGoal but was unable to find a sufficient decrease in the merit function.&#xD;
         You may need more than MachinePrecision digits of working precision to meet these tolerances. &amp;gt;&amp;gt;&#xD;
&#xD;
I have played around with DampingFactor, WorkingPrecision and AccuracyGoal to no avail: When I verify the solutions that Mathematica gives me, at best about 1/3 of them are not satisfied. Can you help me figure out what should I be looking at?</description>
    <dc:creator>Miguel Olivo-V</dc:creator>
    <dc:date>2015-04-30T05:55:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1895675">
    <title>[NB] Basic experiments workflow for simple epidemiological models</title>
    <link>https://community.wolfram.com/groups/-/m/t/1895675</link>
    <description>*MODERATOR NOTE: coronavirus resources &amp;amp; updates:* https://wolfr.am/coronavirus&#xD;
&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/75ec2a4b-b7bd-4c7f-9a14-6e543085fc0e</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2020-03-10T20:51:05Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1065416">
    <title>Deep Learning with Wolfram Neural Networks?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1065416</link>
    <description>Is anyone interested in and actively using Wolfram to do Deep Learning research?&#xD;
&#xD;
I am doing research in all areas of Deep Learning with my focus currently on VGG style of convolution neural networks (CNN). I will be branching out very soon to RLN, RNN, and GAN research very soon. &#xD;
&#xD;
I would like to be able to compare experiences and lessons learned using Wolfram in these areas. &#xD;
&#xD;
Thanks for any interest in discussions on Deep Learning.</description>
    <dc:creator>Bryan Minor</dc:creator>
    <dc:date>2017-04-18T17:29:38Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/251988">
    <title>My program keeps outputting the input! Help!</title>
    <link>https://community.wolfram.com/groups/-/m/t/251988</link>
    <description>I&amp;#039;m trying to use mathematica to solve this linear integer program but I keep getting the input as the output.
I deleted like 9 lines of the constraints to make it fit to a page.</description>
    <dc:creator>kiet ngo</dc:creator>
    <dc:date>2014-05-14T21:44:52Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/169161">
    <title>Convergence of FindMinimum</title>
    <link>https://community.wolfram.com/groups/-/m/t/169161</link>
    <description>I wondered if FindMinimum always converges to the nearest minimum, so I minimized sin(x) cos(y)  with random starting points with x and y between -6 and 6 and colored the points by the location of the minimum.

[img=width: 360px; height: 359px;]/c/portal/getImageAttachment?filename=chaoticmin.gif&amp;amp;userId=29126[/img]</description>
    <dc:creator>Frank Kampas</dc:creator>
    <dc:date>2013-12-12T13:36:07Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/394537">
    <title>Divide a triangle into four small triangles</title>
    <link>https://community.wolfram.com/groups/-/m/t/394537</link>
    <description>Hello all, I am writing to tell you my idea. The process of splitting up a triangle either in four smaller triangles, do so by the larger angle as shown below:&#xD;
&#xD;
    Graphics[Line[{{0, 0}, {7, -5}, {8, 10}, {0, 0}}]]&#xD;
After analyze the angles of the triangle we see that the larger angle is what is at the point {0,0}, subsequently we construct a straight line to the midpoint of the opposite side to the point {0,0 } Finally we estimate the midpoints of the sides adjacent to the point {0,0 } and the join by a straight line to the midpoint of the opposite side that we calculated above ,for finally getting the following figure:&#xD;
&#xD;
![first step][1]&#xD;
&#xD;
&#xD;
If we do the same steps with each of the four triangles, we will be able to obtain more triangles 16 in total&#xD;
&#xD;
![second step][2]&#xD;
&#xD;
Can anyone help me to do what I say, I have made some progress but I am having some problems in order to apply it several times on a initial triangle&#xD;
&#xD;
&#xD;
  [1]: /c/portal/getImageAttachment?filename=montanafr.bmp&amp;amp;userId=133435&#xD;
  [2]: /c/portal/getImageAttachment?filename=montanagh.bmp&amp;amp;userId=133435</description>
    <dc:creator>Luis Ledesma</dc:creator>
    <dc:date>2014-11-22T19:26:37Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/598249">
    <title>Ellipse Packing Via Hierarchical Optimization</title>
    <link>https://community.wolfram.com/groups/-/m/t/598249</link>
    <description>Packing ellipses into a circumscribing circle is more complex than packing circles, since there is no formula for the minimum distance between two ellipses or the maximum distance from the center of the circumscribing circle to an ellipse.  This is overcome by embedding constraints using Lagrange multipliers into the problem to locate the most distant point from the origin of an ellipse and the points on pairs of ellipses closest to each other.  A result of a packing, showing the ellipses and the determined points is shown here: &#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=EllipsePackingUsingEmbeddedLagrangeMultipliers.jpg&amp;amp;userId=29126&#xD;
&#xD;
The complete calculation is in the attached notebook.  The optimization was carried out as a local search using MathOptimizer Professional&#xD;
&#xD;
http://www.wolfram.com/products/applications/mathoptpro&#xD;
&#xD;
as FindMinimum does not converge for the calculation.</description>
    <dc:creator>Frank Kampas</dc:creator>
    <dc:date>2015-10-26T13:32:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1907256">
    <title>WirVsVirus 2020 hackathon participation</title>
    <link>https://community.wolfram.com/groups/-/m/t/1907256</link>
    <description># Introduction&#xD;
&#xD;
Last weekend -- 2020-03-20 ÷ 2020-03-22 -- I participated in [the (Germany-centric) hackathon WirVsVirus](https://wirvsvirushackathon.org). (I friend of mine who lives in Germany asked me to team up and sign up. Participated together with Balint Badonfai and Diego Zviovich.)&#xD;
&#xD;
[Our idea proposal](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/org/WirVsVirus-Hackathon-work-plan.org) was accepted, [listed in the dedicated overview table (see item 806)](https://airtable.com/shrs71ccUVKyvLlUA/tbl6Br4W3IyPGk1jt/viw7AlEju6qFtXJqL?blocks=hide). The title of our hackathon project is:&#xD;
&#xD;
**“Geo-spatial-temporal Economic Model for COVID-19 Propagation and Management in Germany”**&#xD;
&#xD;
[Nearly a dozen of people enlisted to help](https://devpost.com/software/geo-raumlich-zeitliches-wirtschaftsmodell-fur-covid-19). (We communicated through Slack.)&#xD;
&#xD;
```mathematica&#xD;
WebImage[&amp;#034;https://devpost.com/software/geo-raumlich-zeitliches-\&#xD;
wirtschaftsmodell-fur-covid-19&amp;#034;]&#xD;
```&#xD;
&#xD;
![13dzfagts8105](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/13dzfagts8105.png)&#xD;
&#xD;
Multiple people helped with the discussion of ideas, directions where to find data, with actual data gathering, and related documented analysis. Of course, just discussing the proposed solutions was already a great help!&#xD;
&#xD;
# What was accomplished&#xD;
&#xD;
## Work plans&#xD;
&#xD;
The following mind-map reflects pretty well what was planned and done:&#xD;
&#xD;
![15n5cjaej10q8](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/15n5cjaej10q8.png)&#xD;
&#xD;
There is also a related [org-mode file with the work plan](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/org/WirVsVirus-Hackathon-work-plan.org).&#xD;
&#xD;
## Data&#xD;
&#xD;
I obtained Germany city data with Mathematica’s build-in functions and used it to heuristically derive a traveling patterns graph, [AA1]. &#xD;
&#xD;
Here is the data:&#xD;
&#xD;
```mathematica&#xD;
dsCityRecords = &#xD;
  ResourceFunction[&amp;#034;ImportCSVToDataset&amp;#034;][&#xD;
 &amp;#034;https://raw.githubusercontent.com/antononcube/SystemModeling/master/Data/dfGermanyCityRecords.csv&amp;#034;];&#xD;
Dimensions[dsCityRecords]&#xD;
&#xD;
(*{12538, 6}*)&#xD;
```&#xD;
&#xD;
Here is Geo-histogram of that data:&#xD;
&#xD;
```mathematica&#xD;
cellRadius = Quantity[70, &amp;#034;Kilometers&amp;#034;];&#xD;
aCoordsToPopulations = AssociationThread[Values /@ Normal[dsCityRecords[All, {&amp;#034;Lat&amp;#034;, &amp;#034;Lon&amp;#034;}]], Normal[dsCityRecords[All, &amp;#034;Population&amp;#034;]]];&#xD;
GeoHistogram[aCoordsToPopulations, cellRadius, ColorFunction -&amp;gt; (Opacity[#, Blue] &amp;amp;), PlotLegends -&amp;gt; Automatic]&#xD;
```&#xD;
&#xD;
![0t08vw1kjdzbc](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/0t08vw1kjdzbc.png)&#xD;
&#xD;
We considered a fair amount of other data. But because of the time limitations of the hackathon we had to use only the one above.&#xD;
&#xD;
## Single-site models&#xD;
&#xD;
During the development phase I used the model SEI2R, but since we wanted to have a “geo-spatial-temporal epidemiological economics model” I productized the implementation of SEI2HR-Econ, [AAp1].&#xD;
&#xD;
Here are the stocks, rates, and equations of SEI2HR-Econ:&#xD;
&#xD;
```mathematica&#xD;
Magnify[ModelGridTableForm[SEI2HREconModel[t]], 0.85]&#xD;
```&#xD;
&#xD;
![0tbp6de6zdez0](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/0tbp6de6zdez0.png)&#xD;
&#xD;
## Multi-site SEI2R (SEI2HR-Econ) over a hexagonal grid graph&#xD;
&#xD;
I managed to follow through with a large part of [the work plan for the hackathon](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/org/WirVsVirus-hackathon-Geo-spatial-temporal-model-mind-map.pdf) and make multi-site scaled model that “follows the money”, [[AA1](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/Documents/WirVsVirus-hackathon-Multi-site-SEI2R-over-a-hexagonal-grid-graph.md)]. Here is a diagram that shows the travelling patterns graph and solutions at one of the nodes:&#xD;
&#xD;
![1vnygv6t7chgg](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/1vnygv6t7chgg.png)&#xD;
&#xD;
Here is an interactive interface for studying and investigating the solution results:&#xD;
&#xD;
![1pgmngb4uyuzb](https://raw.githubusercontent.com/antononcube/SystemModeling/master/Projects/Coronavirus-propagation-dynamics/Documents/Diagrams/WirVsVirus-2020-hackathon-participation/1pgmngb4uyuzb.png)&#xD;
&#xD;
For more details see the notebook [[AA1](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/Documents/WirVsVirus-hackathon-Multi-site-SEI2R-over-a-hexagonal-grid-graph.md)]. Different parameters can be set in the “Parameters” section. Especially of interest are the quarantine related parameters: start, duration, effect on contact rates and traffic patterns.&#xD;
&#xD;
I also put simulations results code and programmed visualization routines in R, [AA2]. (In order other members of team to be able to explore the results.)&#xD;
&#xD;
# References&#xD;
&#xD;
\[DP1\] [47_wirtschaftliche Auswirkung_Geo-spatial-temp-econ-modell](https://devpost.com/software/geo-raumlich-zeitliches-wirtschaftsmodell-fur-covid-19), DevPost.&#xD;
&#xD;
\[WRI1\] Wolfram Research, Inc., [Germany city data records](https://github.com/antononcube/SystemModeling/blob/master/Data/dfGermanyCityRecords.csv), (2020), [SystemModeling at GitHub](https://github.com/antononcube/SystemModeling).&#xD;
&#xD;
\[AA1\] Anton Antonov, [&amp;#034;WirVsVirus hackathon multi-site SEI2R over a hexagonal grid graph&amp;#034;](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/Documents/WirVsVirus-hackathon-Multi-site-SEI2R-over-a-hexagonal-grid-graph.md), (2020), [SystemModeling at GitHub](https://github.com/antononcube/SystemModeling).&#xD;
&#xD;
\[AA2\] Anton Antonov, [&amp;#034;WirVsVirus-Hackathon in R&amp;#034;](https://github.com/antononcube/SystemModeling/tree/master/Projects/Coronavirus-propagation-dynamics/R/WirVsVirus-Hackathon), (2020), [SystemModeling at GitHub](https://github.com/antononcube/SystemModeling).&#xD;
&#xD;
\[AAp1\] Anton Antonov, [&amp;#034;Epidemiology models Mathematica package&amp;#034;](https://github.com/antononcube/SystemModeling/blob/master/Projects/Coronavirus-propagation-dynamics/WL/EpidemiologyModels.m), (2020), [SystemsModeling at GitHub](https://github.com/antononcube/SystemModeling).</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2020-03-24T21:59:30Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1762584">
    <title>Investigation - power outages in the UK</title>
    <link>https://community.wolfram.com/groups/-/m/t/1762584</link>
    <description>&amp;lt;h2&amp;gt;Introduction&amp;lt;/h2&amp;gt;&#xD;
&#xD;
On Friday 9th August 2019, Britain suffered one of the worst power outages in recent years. Over 1 million people in England and Wales were cut off from power for nearly 9 hours, preventing numerous rail services from running during the rush hour. &#xD;
&#xD;
![Photograph of the distruption in King&amp;#039;s Cross station][1]&#xD;
&#xD;
Was this a statistical misfortune, or a systemic failure which caused the recent power outages?&#xD;
&#xD;
&amp;lt;h2&amp;gt;Getting the data&amp;lt;/h2&amp;gt;&#xD;
&#xD;
To obtain the information required to do analysis of the events leading up to the catastrophic power outage, we will we will use a fantastic website, [GridWatch Templar][3], which has realtime data as to the different power supplies, resources and frequencies. From the download page, I downloaded all the data from 27th May 2011 to the current time. Be patient; it will take a considerable amount of time to download the entire dataset (and as it is too large, I have not attached this csv file to this page). Also, as we will be carrying out analysis on such a large dataset, some cells will take a considerable amount of time to run. &#xD;
&#xD;
&amp;lt;h2&amp;gt;Analysis of the frequencies&amp;lt;/h2&amp;gt;&#xD;
&#xD;
First, we import the dataset:&#xD;
&#xD;
```&#xD;
In[1]: data = Import[&amp;#034;D:\\Programming\\GridWatch\\gridwatch.csv&amp;#034;];&#xD;
```&#xD;
&#xD;
The data which it contains:&#xD;
&#xD;
```&#xD;
In[2]: data[[1]]&#xD;
&#xD;
Out[2]: {&amp;#034;id&amp;#034;, &amp;#034;timestamp&amp;#034;, &amp;#034;demand&amp;#034;, &amp;#034;frequency&amp;#034;, &amp;#034;coal&amp;#034;, &amp;#034;nuclear&amp;#034;, &amp;#034;ccgt&amp;#034;, \&#xD;
&amp;#034;wind&amp;#034;, &amp;#034;pumped&amp;#034;, &amp;#034;hydro&amp;#034;, &amp;#034;biomass&amp;#034;, &amp;#034;oil&amp;#034;, &amp;#034;solar&amp;#034;, &amp;#034;ocgt&amp;#034;, \&#xD;
&amp;#034;french_ict&amp;#034;, &amp;#034;dutch_ict&amp;#034;, &amp;#034;irish_ict&amp;#034;, &amp;#034;ew_ict&amp;#034;, &amp;#034;nemo&amp;#034;, &amp;#034;other&amp;#034;, \&#xD;
&amp;#034;north_south&amp;#034;, &amp;#034;scotland_england&amp;#034;}&#xD;
```&#xD;
&#xD;
To look at the frequencies:&#xD;
&#xD;
```&#xD;
In[3]: frequencies = &#xD;
 If[#[[4]] == 0, Nothing, {DateObject[#[[2]]], #[[4]]}] &amp;amp; /@ &#xD;
  data[[2 ;;]];&#xD;
```&#xD;
&#xD;
To show the minimum value:&#xD;
&#xD;
```&#xD;
In[4]: MinimalBy[frequencies, Last]&#xD;
&#xD;
Out[4]: {{DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &amp;#034;Gregorian&amp;#034;, 1.], &#xD;
  48.889}}&#xD;
&#xD;
In[5]: DateListPlot[frequencies, PlotRange -&amp;gt; All, AxesLabel -&amp;gt; {&amp;#034;Time&amp;#034;, &amp;#034;Hz&amp;#034;}]&#xD;
```&#xD;
&#xD;
![The date plot][4]&#xD;
&#xD;
This is not particularly enlightening; although it does show how dramatic the recent drop of frequency is. In fact, it is known that if the frequency drops below 49.5 Hz, a blackout will occur - and this is the first time it has happened (at least since 2011). &#xD;
&#xD;
Let&amp;#039;s dive deeper -  we&amp;#039;ll use a normal distribution in approximation to the distribution:&#xD;
&#xD;
```&#xD;
In[6]: distribution = NormalDistribution[Mean[Last /@ frequencies], StandardDeviation[Last /@ frequencies]]&#xD;
&#xD;
Out[6]: NormalDistribution[50.0012, 0.0584802]&#xD;
```&#xD;
&#xD;
Now plotting it gives:&#xD;
&#xD;
```&#xD;
In[7]: Show[Histogram[Last /@ newfreqs, Automatic, &amp;#034;ProbabilityDensity&amp;#034;], &#xD;
 Plot[PDF[distribution, x], {x, 49.7, 50.3}, &#xD;
  PlotStyle -&amp;gt; Thick]]&#xD;
```&#xD;
&#xD;
This returns: &#xD;
![histogram][5]&#xD;
&#xD;
Observe how quickly this tapers off. Assuming the frequencies follow that normal distribution, the probability of this occurring is:&#xD;
&#xD;
```&#xD;
In[8]: Probability[freq &amp;lt;= 49.5, freq \[Distributed] distribution]&#xD;
&#xD;
Out[8]: 5.1191*10^-18&#xD;
```&#xD;
&#xD;
So we can be very confident that this was not just a statistical mishap - there was a genuine, systemic cause for this event to occur (see the comment below for explanation of this).&#xD;
&#xD;
Now let&amp;#039;s take a closer look at what happened that day.&#xD;
&#xD;
&amp;lt;h2&amp;gt;Focusing in further&amp;lt;/h2&amp;gt;&#xD;
&#xD;
A National Grid spokesperson said: &#xD;
&#xD;
&amp;gt; The root cause of yesterdays issue was not with our system but was a rare and unusual event, the almost simultaneous loss of two large generators, one gas and one offshore wind, at 4.54pm. We are still working with the generators to understand what caused the generation to be lost.&#xD;
&#xD;
 (courtesy of the [the Guardian][2] for this report). We will verify this report below.&#xD;
&#xD;
First, we will zoom in on the interval between one day before and one day after the event occurred.&#xD;
&#xD;
```&#xD;
In[9]: timeinterval = Select[data[[2;;]], &#xD;
 DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &amp;#034;Gregorian&amp;#034;, 1.`] - &#xD;
    Quantity[1, &amp;#034;Days&amp;#034;] &amp;lt;= DateObject[#[[2]]] &amp;lt;= &#xD;
   DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &amp;#034;Gregorian&amp;#034;, 1.`] +&#xD;
     Quantity[1, &amp;#034;Days&amp;#034;] &amp;amp;] &#xD;
```&#xD;
&#xD;
(This specific time interval data is attached to this post). &#xD;
&#xD;
To visualise it the frequencies:&#xD;
&#xD;
```&#xD;
In[11]: timeintervalfreqs = {DateObject[#[[2]]], #[[4]]} &amp;amp; /@ timeinterval;&#xD;
&#xD;
In[12]: DateListPlot[Out[51], PlotRange -&amp;gt; All, &#xD;
 Epilog -&amp;gt; {Red, &#xD;
   Text[Style[&amp;#034;\[SixPointedStar]&amp;#034;, &#xD;
       20], #] &amp;amp; /@ {{DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &#xD;
       &amp;#034;Gregorian&amp;#034;, 1.`], 48.889`}}}]&#xD;
```&#xD;
&#xD;
which shows:                                                                      &#xD;
![2 day interval][6]&#xD;
&#xD;
Now let&amp;#039;s look at the specific types of energy generation:                  &#xD;
&#xD;
```&#xD;
In[13]: DateListPlot[&#xD;
 Table[{DateObject[#[[2]]], #[[k]]} &amp;amp; /@ timeinterval, {k, 5, 21}], &#xD;
 PlotLegends -&amp;gt; data[[1]][[5 ;;]], PlotRange -&amp;gt; All]&#xD;
```&#xD;
&#xD;
which returns &#xD;
![nuclear, coal etc.][7]&#xD;
&#xD;
Now let&amp;#039;s reduce down to the two energy sources which were mentioned in the report: namely, gas (or CCGT, OCGT), and offshore wind.&#xD;
&#xD;
```&#xD;
In[14]: indices = {3, 7, 8, 14};&#xD;
DateListPlot[&#xD;
 Table[{DateObject[#[[2]]], #[[k]]} &amp;amp; /@ timeinterval, {k, indices}], &#xD;
 PlotLegends -&amp;gt; data[[1]][[indices]], PlotRange -&amp;gt; All, &#xD;
 Epilog -&amp;gt; {Directive[{Thick, Red, Dashed}], &#xD;
   Line[{{DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &amp;#034;Gregorian&amp;#034;,&#xD;
        1.`], 0}, {DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &#xD;
       &amp;#034;Gregorian&amp;#034;, 1.`], 40000}}]}]&#xD;
```&#xD;
&#xD;
![graph_6][8]&#xD;
&#xD;
This clearly shows a drop in CCGT and wind power (and also the demand) subsequent to the incident. &#xD;
&#xD;
Finding peaks for the CCGT data to find when the drop occurs:&#xD;
&#xD;
```&#xD;
In[15]: ccgtdata = {AbsoluteTime[#[[2]]], -#[[8]]} &amp;amp; /@ timeinterval;&#xD;
&#xD;
In[16]: inter = Interpolation[ccgtdata[[All, 1]]];&#xD;
&#xD;
In[17]: peaks = FindPeaks[ccgtdata[[All, 2]]];&#xD;
&#xD;
In[18]: peak = Select[{inter[#1], #2} &amp;amp; @@@ &#xD;
  peaks, #[[1]] &amp;gt;= &#xD;
   AbsoluteTime[&#xD;
    DateObject[{2019, 8, 9, 15, 55, 37}, &amp;#034;Instant&amp;#034;, &amp;#034;Gregorian&amp;#034;, &#xD;
     1.`]] &amp;amp;][[1, 1]] (*This calculates the first trough since the event took place*)&#xD;
&#xD;
Out[18]: 3774356135&#xD;
```&#xD;
&#xD;
This means that, 20 minutes after the frequency collapses, the CCGT (and the Wind power) supply decrease dramatically.&#xD;
&#xD;
&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&#xD;
&#xD;
At 3:55 PM GMT +1 (so really 4:55 PM, confirming the report - this is on account of BST) on Friday the 9th of August, for the first time since 2011 (and probably many years before), frequency reached levels below 49.5 Hz, at which point blackouts would take place, affecting nearly 1 million people and disrupting multiple rail services across England and Wales. According to the National Grid, this had almost happened 3 times before this one took place; our data can confirm this (see the graph below input 5). We can be certain that this was not a statistical oddity; in fact, around 20 minutes later, we begin to see that the CCGT and offshore wind supplies decrease, which confirms the report stating that both had cut out simultaneously. Hopefully this will never happen again. With this dataset at hand, it seems likely that these outages could be more foreseen in the future. &#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image1.jpg&amp;amp;userId=1719931&#xD;
  [2]: https://www.theguardian.com/business/2019/aug/10/uk-energy-watchdog-demands-answers-after-major-power-cut-england-wales&#xD;
  [3]: https://gridwatch.templar.co.uk/&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph_1.jpg&amp;amp;userId=1719931&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph_2.jpg&amp;amp;userId=1719931&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph_4.jpg&amp;amp;userId=1719931&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph_3.PNG&amp;amp;userId=1719931&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph_6.PNG&amp;amp;userId=1719931</description>
    <dc:creator>Henry Jaspars</dc:creator>
    <dc:date>2019-08-13T18:25:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1736350">
    <title>[?] Check entries and return output if condition is satisfied?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1736350</link>
    <description>I would be grateful if someone could help me with this code. &#xD;
&#xD;
I want to check whether all the entries in any column of the generated table is equal to one &#xD;
If the condition is satisfied in any column, the result shall be the column&amp;#039;s heading.&#xD;
If the condition is not satisfied in all columns, the result shall be none.&#xD;
&#xD;
For example, I am attaching a file that outputs a table. This table contains no columns with all values are equal to one, so I am expecting the result to be none.</description>
    <dc:creator>Nehal Elshaboury</dc:creator>
    <dc:date>2019-07-13T17:13:12Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/941017">
    <title>Basic example of using ROC with Linear regression</title>
    <link>https://community.wolfram.com/groups/-/m/t/941017</link>
    <description>## Introduction&#xD;
&#xD;
This post is for the package \[[2](https://github.com/antononcube/MathematicaForPrediction/blob/master/ROCFunctions.m)\] that provides *Mathematica* implementations of [Receiver Operating Characteristic](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) (ROC) functions calculation and plotting. The ROC framework is used for analysis and tuning of binary classifiers, \[[3](https://en.wikipedia.org/wiki/Receiver_operating_characteristic)\]. (The classifiers are assumed to classify into a positive/true label or a negative/false label. )&#xD;
&#xD;
The function `ROCFuntions` gives access to the individual ROC functions through string arguments. Those ROC functions are applied to special objects, called ROC Association objects.&#xD;
&#xD;
Each ROC Association object is an `Association` that has the following four keys: &amp;#034;TruePositive&amp;#034;, &amp;#034;FalsePositive&amp;#034;, &amp;#034;TrueNegative&amp;#034;, and &amp;#034;FalseNegative&amp;#034; .&#xD;
&#xD;
Given two lists of actual and predicted labels a ROC Association object can be made with the function `ToROCAssociation` .&#xD;
&#xD;
For more definitions and example of ROC terminology and functions see \[[3](https://en.wikipedia.org/wiki/Receiver_operating_characteristic),[4](https://ccrma.stanford.edu/workshops/mir2009/references/ROCintro.pdf)\].&#xD;
&#xD;
## Minimal example&#xD;
&#xD;
Note that here although we use both of the provided Titanic training and test data, the code is doing only training. The test data is used to find the best tuning parameter (threshold) through ROC analysis.&#xD;
&#xD;
### Get packages&#xD;
&#xD;
These commands load the packages \[[1](https://github.com/antononcube/MathematicaForPrediction/blob/master/MathematicaForPredictionUtilities.m),[2](https://github.com/antononcube/MathematicaForPrediction/blob/master/ROCFunctions.m)\]:&#xD;
&#xD;
    Import[&amp;#034;https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/MathematicaForPredictionUtilities.m&amp;#034;]&#xD;
    Import[&amp;#034;https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/ROCFunctions.m&amp;#034;]&#xD;
&#xD;
### Using Titanic data&#xD;
&#xD;
Here is the summary of the Titanic data used below:&#xD;
&#xD;
    titanicData = (Flatten@*List) @@@ExampleData[{&amp;#034;MachineLearning&amp;#034;, &amp;#034;Titanic&amp;#034;}, &amp;#034;Data&amp;#034;];&#xD;
    columnNames = (Flatten@*List) @@ExampleData[{&amp;#034;MachineLearning&amp;#034;, &amp;#034;Titanic&amp;#034;}, &amp;#034;VariableDescriptions&amp;#034;];&#xD;
    RecordsSummary[titanicData, columnNames]&#xD;
&#xD;
[![Titanic1][1]][1]&#xD;
&#xD;
This variable dependence grid shows the relationships between the variables.&#xD;
&#xD;
    Magnify[#, 0.7] &amp;amp;@VariableDependenceGrid[titanicData, columnNames]&#xD;
&#xD;
[![VariableDependencies][7]][7]&#xD;
&#xD;
### Get training and testing data&#xD;
&#xD;
    data = ExampleData[{&amp;#034;MachineLearning&amp;#034;, &amp;#034;Titanic&amp;#034;}, &amp;#034;TrainingData&amp;#034;];&#xD;
    data = ((Flatten@*List) @@@ data)[[All, {1, 2, 3, -1}]];&#xD;
    trainingData = DeleteCases[data, {___, _Missing, ___}];&#xD;
    Dimensions[trainingData]&#xD;
&#xD;
(* {732, 4} *)&#xD;
&#xD;
    data = ExampleData[{&amp;#034;MachineLearning&amp;#034;, &amp;#034;Titanic&amp;#034;}, &amp;#034;TestData&amp;#034;];&#xD;
    data = ((Flatten@*List) @@@ data)[[All, {1, 2, 3, -1}]];&#xD;
    testData = DeleteCases[data, {___, _Missing, ___}];&#xD;
    Dimensions[testData]&#xD;
&#xD;
(* {314, 4} *)&#xD;
&#xD;
### Replace categorical with numerical values&#xD;
&#xD;
    trainingData = trainingData /. {&amp;#034;survived&amp;#034; -&amp;gt; 1, &amp;#034;died&amp;#034; -&amp;gt; 0, &amp;#034;1st&amp;#034; -&amp;gt; 0, &amp;#034;2nd&amp;#034; -&amp;gt; 1, &amp;#034;3rd&amp;#034; -&amp;gt; 2, &amp;#034;male&amp;#034; -&amp;gt; 0, &amp;#034;female&amp;#034; -&amp;gt; 1};&#xD;
&#xD;
    testData = testData /. {&amp;#034;survived&amp;#034; -&amp;gt; 1, &amp;#034;died&amp;#034; -&amp;gt; 0, &amp;#034;1st&amp;#034; -&amp;gt; 1, &amp;#034;2nd&amp;#034; -&amp;gt; 2, &amp;#034;3rd&amp;#034; -&amp;gt; 3, &amp;#034;male&amp;#034; -&amp;gt; 0, &amp;#034;female&amp;#034; -&amp;gt; 1};&#xD;
&#xD;
### Do linear regression&#xD;
&#xD;
    lfm = LinearModelFit[{trainingData[[All, 1 ;; -2]], trainingData[[All, -1]]}]&#xD;
&#xD;
[![Regression1][2]][2]&#xD;
&#xD;
### Get the predicted values&#xD;
&#xD;
    modelValues = lfm @@@ testData[[All, 1 ;; -2]];&#xD;
&#xD;
    Histogram[modelValues, 20]&#xD;
&#xD;
[![Prediction1][3]][3]&#xD;
&#xD;
RecordsSummary[modelValues]&#xD;
&#xD;
[![Prediction2][4]][4]&#xD;
&#xD;
### Obtain ROC associations over a set of parameter values&#xD;
&#xD;
    testLabels = testData[[All, -1]];&#xD;
&#xD;
    thRange = Range[0.1, 0.9, 0.025];&#xD;
    aROCs = Table[ToROCAssociation[{1, 0}, testLabels, Map[If[# &amp;gt; \[Theta], 1, 0] &amp;amp;, modelValues]], {\[Theta], thRange}];&#xD;
&#xD;
### Evaluate ROC functions for given ROC association&#xD;
&#xD;
    N @ Through[ROCFunctions[{&amp;#034;PPV&amp;#034;, &amp;#034;NPV&amp;#034;, &amp;#034;TPR&amp;#034;, &amp;#034;ACC&amp;#034;, &amp;#034;SPC&amp;#034;, &amp;#034;MCC&amp;#034;}][aROCs[[3]]]]&#xD;
&#xD;
    (* {0.513514, 0.790698, 0.778689, 0.627389, 0.53125, 0.319886} *)&#xD;
&#xD;
### Standard ROC plot&#xD;
&#xD;
    ROCPlot[thRange, aROCs, &amp;#034;PlotJoined&amp;#034; -&amp;gt; Automatic, &amp;#034;ROCPointCallouts&amp;#034; -&amp;gt; True, &amp;#034;ROCPointTooltips&amp;#034; -&amp;gt; True, GridLines -&amp;gt; Automatic]&#xD;
&#xD;
[![ROCPlot1][5]][5]&#xD;
&#xD;
### Plot ROC functions wrt to parameter values&#xD;
&#xD;
    rocFuncs = {&amp;#034;PPV&amp;#034;, &amp;#034;NPV&amp;#034;, &amp;#034;TPR&amp;#034;, &amp;#034;ACC&amp;#034;, &amp;#034;SPC&amp;#034;, &amp;#034;MCC&amp;#034;};&#xD;
    rocFuncTips = Map[# &amp;lt;&amp;gt; &amp;#034;, &amp;#034; &amp;lt;&amp;gt; (ROCFunctions[&amp;#034;FunctionInterpretations&amp;#034;][#]) &amp;amp;, rocFuncs];&#xD;
    ListLinePlot[&#xD;
     MapThread[Tooltip[Transpose[{thRange, #1}], #2] &amp;amp;, {Transpose[Map[Through[ROCFunctions[rocFuncs][#]] &amp;amp;, aROCs]], rocFuncTips}],&#xD;
     Frame -&amp;gt; True, &#xD;
     FrameLabel -&amp;gt; Map[Style[#, Larger] &amp;amp;, {&amp;#034;threshold, \[Theta]&amp;#034;, &amp;#034;rate&amp;#034;}], &#xD;
     PlotLegends -&amp;gt; rocFuncTips, GridLines -&amp;gt; Automatic]&#xD;
&#xD;
[![ROCPlot2][6]][6]&#xD;
&#xD;
### Finding the intersection point of PPV and TPR&#xD;
&#xD;
We want to find a point that provides balanced positive and negative labels success rates. One way to do this is to find the intersection point of the ROC functions PPV (positive predictive value) and TPR (true positive rate).&#xD;
&#xD;
Examining the plot above we can come up with the initial condition for $x$.&#xD;
&#xD;
    ppvFunc = Interpolation[Transpose@{thRange, ROCFunctions[&amp;#034;PPV&amp;#034;] /@ aROCs}];&#xD;
    tprFunc = Interpolation[Transpose@{thRange, ROCFunctions[&amp;#034;TPR&amp;#034;] /@ aROCs}];&#xD;
    FindRoot[ppvFunc[x] - tprFunc[x] == 0, {x, 0.2}]&#xD;
&#xD;
(* {x -&amp;gt; 0.3} *)&#xD;
&#xD;
### Area under the ROC curve&#xD;
&#xD;
The Area Under the ROC curve (AUROC) tells for a given range of the controlling parameter &amp;#034;what is the probability of the classifier to rank a randomly chosen positive instance higher than a randomly chosen negative instance, (assuming &amp;#039;positive&amp;#039; ranks higher than &amp;#039;negative&amp;#039;)&amp;#034;, [3,4]&#xD;
&#xD;
Calculating AUROC is easy using the Trapezoidal quadrature formula:&#xD;
&#xD;
     N@Total[Partition[Sort@Transpose[{ROCFunctions[&amp;#034;FPR&amp;#034;] /@ aROCs, ROCFunctions[&amp;#034;TPR&amp;#034;] /@ aROCs}], 2, 1] &#xD;
       /. {{x1_, y1_}, {x2_, y2_}} :&amp;gt; (x2 - x1) (y1 + (y2 - y1)/2)]&#xD;
&#xD;
     (* 0.474513 *)&#xD;
&#xD;
It is also implemented in \[[2](https://github.com/antononcube/MathematicaForPrediction/blob/master/ROCFunctions.m)\]:&#xD;
&#xD;
    N@ROCFunctions[&amp;#034;AUROC&amp;#034;][aROCs]&#xD;
&#xD;
    (* 0.474513 *)&#xD;
&#xD;
## References&#xD;
&#xD;
\[1\] Anton Antonov, [MathematicaForPrediction utilities](https://github.com/antononcube/MathematicaForPrediction/blob/master/MathematicaForPredictionUtilities.m), (2014), source code [MathematicaForPrediction at GitHub](https://github.com/antononcube/MathematicaForPrediction), package [MathematicaForPredictionUtilities.m](https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/MathematicaForPredictionUtilities.m).&#xD;
&#xD;
\[2\] Anton Antonov, [Receiver operating characteristic functions Mathematica package](https://github.com/antononcube/MathematicaForPrediction/blob/master/ROCFunctions.m), (2016), source code [MathematicaForPrediction at GitHub](https://github.com/antononcube/MathematicaForPrediction), package [ROCFunctions.m](https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/ROCFunctions.m) .&#xD;
&#xD;
\[3\] Wikipedia entry, [Receiver operating characteristic](http://en.wikipedia.org/wiki/Receiver_operating_characteristic).&#xD;
&#xD;
\[4\] Tom Fawcett, [An introduction to ROC analysis](https://ccrma.stanford.edu/workshops/mir2009/references/ROCintro.pdf), (2006), Pattern Recognition Letters, 27, 861-874.&#xD;
&#xD;
[1]:http://i.imgur.com/VTVyV9P.png&#xD;
[2]:http://i.imgur.com/d663I98.png&#xD;
[3]:http://i.imgur.com/bBXsDp2.png&#xD;
[4]:http://i.imgur.com/mzWjhZc.png&#xD;
[5]:https://i.imgur.com/Sam8wX5.png&#xD;
[6]:https://i.imgur.com/lrGRgJp.png&#xD;
[7]:http://i.imgur.com/DSkPQOH.png</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2016-10-12T13:21:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/441131">
    <title>Speeding Up Matrix Expression Evaluation With Expand</title>
    <link>https://community.wolfram.com/groups/-/m/t/441131</link>
    <description>In some cases, evaluation of expressions containing matrices can be sped up by wrapping the expression in Expand.  Here&amp;#039;s an example of a 5 fold gain in speed for an expression containing 50x50 matrices:&#xD;
&#xD;
    In[12]:= n = 50;&#xD;
    &#xD;
    In[13]:= SeedRandom[0]; Dimensions[a = RandomReal[{-1, 1}, {n, n}]]&#xD;
    &#xD;
    Out[13]= {50, 50}&#xD;
    &#xD;
    In[14]:= SeedRandom[0]; Dimensions[b = RandomReal[{-1, 1}, n]]&#xD;
    &#xD;
    Out[14]= {50}&#xD;
    &#xD;
    In[15]:= v = Array[x, n];&#xD;
    &#xD;
    In[16]:= AbsoluteTiming @ NMaximize[-1/4 v.a.Transpose[a].v - b.v, v]&#xD;
    &#xD;
    Out[16]= {7.294668, {51.9929, {x[1] -&amp;gt; -8.79, x[2] -&amp;gt; -5.14004, &#xD;
       x[3] -&amp;gt; 4.77431, x[4] -&amp;gt; -33.5074, x[5] -&amp;gt; -17.8675, &#xD;
       x[6] -&amp;gt; -41.973, x[7] -&amp;gt; -14.8, x[8] -&amp;gt; 7.17246, x[9] -&amp;gt; 40.5797, &#xD;
       x[10] -&amp;gt; -1.30352, x[11] -&amp;gt; 15.2247, x[12] -&amp;gt; 24.7157, &#xD;
       x[13] -&amp;gt; 20.5358, x[14] -&amp;gt; -37.6259, x[15] -&amp;gt; -23.1615, &#xD;
       x[16] -&amp;gt; 5.04749, x[17] -&amp;gt; 0.716219, x[18] -&amp;gt; -9.14941, &#xD;
       x[19] -&amp;gt; 18.7447, x[20] -&amp;gt; 14.4649, x[21] -&amp;gt; 9.51407, &#xD;
       x[22] -&amp;gt; -23.4491, x[23] -&amp;gt; 1.5991, x[24] -&amp;gt; 6.41455, &#xD;
       x[25] -&amp;gt; 2.53314, x[26] -&amp;gt; 17.8861, x[27] -&amp;gt; -13.0104, &#xD;
       x[28] -&amp;gt; 10.2575, x[29] -&amp;gt; -16.721, x[30] -&amp;gt; 15.549, &#xD;
       x[31] -&amp;gt; -1.68674, x[32] -&amp;gt; 12.4654, x[33] -&amp;gt; 24.0295, &#xD;
       x[34] -&amp;gt; -17.7568, x[35] -&amp;gt; 9.24454, x[36] -&amp;gt; -11.9835, &#xD;
       x[37] -&amp;gt; -5.83835, x[38] -&amp;gt; 0.33071, x[39] -&amp;gt; 16.9103, &#xD;
       x[40] -&amp;gt; -30.5781, x[41] -&amp;gt; -18.2771, x[42] -&amp;gt; -29.8421, &#xD;
       x[43] -&amp;gt; -7.07211, x[44] -&amp;gt; -14.7736, x[45] -&amp;gt; -14.2617, &#xD;
       x[46] -&amp;gt; 39.7569, x[47] -&amp;gt; 48.0993, x[48] -&amp;gt; -3.96191, &#xD;
       x[49] -&amp;gt; 9.70208, x[50] -&amp;gt; -21.7266}}}&#xD;
    &#xD;
    In[17]:= AbsoluteTiming @ &#xD;
     NMaximize[Expand[-1/4 v.a.Transpose[a].v - b.v], v]&#xD;
    &#xD;
    Out[17]= {1.386620, {51.9929, {x[1] -&amp;gt; -8.79, x[2] -&amp;gt; -5.14004, &#xD;
       x[3] -&amp;gt; 4.77431, x[4] -&amp;gt; -33.5074, x[5] -&amp;gt; -17.8675, &#xD;
       x[6] -&amp;gt; -41.973, x[7] -&amp;gt; -14.8, x[8] -&amp;gt; 7.17246, x[9] -&amp;gt; 40.5797, &#xD;
       x[10] -&amp;gt; -1.30352, x[11] -&amp;gt; 15.2247, x[12] -&amp;gt; 24.7157, &#xD;
       x[13] -&amp;gt; 20.5358, x[14] -&amp;gt; -37.6259, x[15] -&amp;gt; -23.1615, &#xD;
       x[16] -&amp;gt; 5.04749, x[17] -&amp;gt; 0.716219, x[18] -&amp;gt; -9.14941, &#xD;
       x[19] -&amp;gt; 18.7447, x[20] -&amp;gt; 14.4649, x[21] -&amp;gt; 9.51407, &#xD;
       x[22] -&amp;gt; -23.4491, x[23] -&amp;gt; 1.5991, x[24] -&amp;gt; 6.41455, &#xD;
       x[25] -&amp;gt; 2.53314, x[26] -&amp;gt; 17.8861, x[27] -&amp;gt; -13.0104, &#xD;
       x[28] -&amp;gt; 10.2575, x[29] -&amp;gt; -16.721, x[30] -&amp;gt; 15.549, &#xD;
       x[31] -&amp;gt; -1.68674, x[32] -&amp;gt; 12.4654, x[33] -&amp;gt; 24.0295, &#xD;
       x[34] -&amp;gt; -17.7568, x[35] -&amp;gt; 9.24454, x[36] -&amp;gt; -11.9835, &#xD;
       x[37] -&amp;gt; -5.83835, x[38] -&amp;gt; 0.33071, x[39] -&amp;gt; 16.9103, &#xD;
       x[40] -&amp;gt; -30.5781, x[41] -&amp;gt; -18.2771, x[42] -&amp;gt; -29.8421, &#xD;
       x[43] -&amp;gt; -7.07211, x[44] -&amp;gt; -14.7736, x[45] -&amp;gt; -14.2617, &#xD;
       x[46] -&amp;gt; 39.7569, x[47] -&amp;gt; 48.0993, x[48] -&amp;gt; -3.96191, &#xD;
       x[49] -&amp;gt; 9.70208, x[50] -&amp;gt; -21.7266}}}</description>
    <dc:creator>Frank Kampas</dc:creator>
    <dc:date>2015-02-12T16:23:11Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3245846">
    <title>M/M/c retrial queue implementation in Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/3245846</link>
    <description>Looking for a Mathematica implementation of the M/M/c retrial queueing system</description>
    <dc:creator>Goran Djuknic</dc:creator>
    <dc:date>2024-08-11T05:02:40Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/220551">
    <title>Mosaic plots for data visualization</title>
    <link>https://community.wolfram.com/groups/-/m/t/220551</link>
    <description>I just published a blog post proclaiming the implementation of the function MosaicPlot that gives visual representation of the contingencies of categorical variables in a list of records. The blog post has examples and explanations:
[url=http://mathematicaforprediction.wordpress.com/2014/03/17/mosaic-plots-for-data-visualization/]http://mathematicaforprediction.wordpress.com/2014/03/17/mosaic-plots-for-data-visualization/[/url]

If we consider the census income data set known as the [url=http://archive.ics.uci.edu/ml/datasets/Census+Income]&amp;#034;adult data set&amp;#034;[/url] that is summarized in this table:

[img=width: 800px; height: 375px;]http://mathematicaforprediction.files.wordpress.com/2014/03/adult-census-income-data-summary.png[/img]

we visualize the co-occurence of (categorical variable) values with mosaic plots like this one:

[img=width: 500px; height: 506px;]http://mathematicaforprediction.files.wordpress.com/2014/03/adult-census-income-data-sex-education-colored-mosaic-plot.png[/img]

By comparing the sizes of the rectangles corresponding to values Bachelors, Doctorate, Masters, and Some-college on the sex vs. education mosaic plot we can see that the fraction of men that have finished college is larger than the fraction of women that have finished college.
We can further subdivide the rectangles according the co-occurrence frequencies with a third categorical variable. We are going to choose that third variable to be income, the values of which can be seen as outcomes or consequents of the values of the first two variables of the mosaic plot.

[img=width: 550px; height: 509px;]http://mathematicaforprediction.files.wordpress.com/2014/03/adult-census-income-data-sex-education-income-colored-mosaic-plot.png[/img]

From the mosaic plot &amp;#034;sex vs. education vs. income&amp;#034; we can make the following observations.1. Approximately 75% of the males with doctorate degrees or with a professional school degree earn more than $50000 per year.2. Approximately 60% of the females with a doctorate degree earn more than $50000 per year.3. Approximately 45% of the females with a professional school degree earn more than $50000.4. Across all education type females are (much) less likely to earn more than $50000 per year.</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2014-03-17T21:29:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/571131">
    <title>Import/Export to Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/571131</link>
    <description>Can PDF/Docs (with math equations) documents be imported into Mathematica?</description>
    <dc:creator>hady hakim</dc:creator>
    <dc:date>2015-09-26T05:49:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2223040">
    <title>Reverse engineer video game function/formula</title>
    <link>https://community.wolfram.com/groups/-/m/t/2223040</link>
    <description>I am attempting to use Wolfram to reverse engineer a formula. Unfortunately, my background in advanced math is limited, so I&amp;#039;ve been struggling to identify which functions (or even area of mathematics) to try. Hopefully someone has a suggestion on how I could try to either recreate the formula or what sort of function would approximate a solution with the smallest degree of error.&#xD;
&#xD;
The problem is reverse engineering combat math of a video game, specifically the result of a battle involving two forces, where the formulas calculate the number of losses from the attacker and defender. The formula for the losses of the defender is linear and simple, the losses for the attacker however are nonlinear. Given inputs:&#xD;
&#xD;
x = # of Attackers&#xD;
&#xD;
y = # of Defenders&#xD;
&#xD;
d = Damage output constant/coefficient = 0.1&#xD;
&#xD;
a = Damage absorption constant/coefficient = 0.01&#xD;
&#xD;
The formula to determine dy (the losses of the defenders) is:&#xD;
&#xD;
f(x * d - y * a) = (# of attackers * damage coefficient - # of defenders * damage absorption)&#xD;
&#xD;
Given the simplicity of the function to determine the losses of the defenders, it makes sense that the function for the loss of attackers is also simple, but it has me baffled. I&amp;#039;ve been playing with Wolfram trying to identify functions to try but I&amp;#039;m new to the tool, and like I said, don&amp;#039;t have a strong math background. &#xD;
&#xD;
Some examples of the outcomes for the loss of x (attackers) and y (defenders) are:&#xD;
&#xD;
    x,    y,   = dx, dy&#xD;
   &#xD;
f(1100, 1000) = 90, 100&#xD;
&#xD;
f(1200, 1000) = 89, 110&#xD;
&#xD;
f(1300, 1000) = 88, 120&#xD;
&#xD;
f(1400, 1000) = 87, 130&#xD;
&#xD;
f(1500, 1000) = 86, 140&#xD;
&#xD;
f(1600, 1000) = 86, 150&#xD;
&#xD;
f(1700, 1000) = 85, 160&#xD;
&#xD;
f(1800, 1000) = 84, 170&#xD;
&#xD;
f(1900, 1000) = 84, 180&#xD;
&#xD;
f(2000, 1000) = 83, 190&#xD;
&#xD;
f(2100, 1000) = 82, 200&#xD;
&#xD;
f(2200, 1000) = 81, 210&#xD;
&#xD;
f(2300, 1000) = 81, 220&#xD;
&#xD;
f(2400, 1000) = 80, 230&#xD;
&#xD;
f(2500, 1000) = 80, 240&#xD;
&#xD;
f(2600, 1000) = 79, 250&#xD;
&#xD;
f(2700, 1000) = 78, 260&#xD;
&#xD;
f(2800, 1000) = 78, 270&#xD;
&#xD;
Anyway, I&amp;#039;m stuck. Does anyone have an idea of what I could try?</description>
    <dc:creator>Paul Loht</dc:creator>
    <dc:date>2021-03-18T18:47:14Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2026904">
    <title>[WSS20]Design &amp;amp; Implementation of Data Structure of Crystalline Atomic Data</title>
    <link>https://community.wolfram.com/groups/-/m/t/2026904</link>
    <description>![frontimage][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=imagefront.jpg&amp;amp;userId=1316061&#xD;
  [2]: https://www.wolframcloud.com/obj/88bd85e6-8a15-4fe1-ab85-7da71b0ce10b</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2020-07-14T02:04:22Z</dc:date>
  </item>
</rdf:RDF>

