OptimusMaplePrime

156 Reputation

6 Badges

16 years, 326 days

MaplePrimes Activity


These are replies submitted by OptimusMaplePrime

Thanks for the quick resolution. I am posting this comment from Microsoft Internet Explorer 9 x64 with Compatibility View off.

@hirnyk Sorry, my original post was missing the attachment. I had been unable to get the File Uploader to work. Using Microsoft Internet Explorer 9 x64 on Microsoft Windows 7 Professional x64 I find that I need to use Compatibility Mode on MaplePrimes. I will create a separate post on that issue.

Thanks for taking a look at the post. Let me know what you think about the worksheet.

Thanks edgar, I see that this post has already been moved to the "Product Suggestions" forum.  I presume this was done for us by the moderators.

Pagan, sorry for not providing a more detailed example.  I forget that not everyone is familar with R syntax.  Looking at the example from R we have two tables of data, "Authors" and "Books":

Authors
=======
Surname  Nationality  Deceased
-------  -----------  --------
Tukey    US           yes
Venables Australia    no
Tierney  US           no
Ripley   UK           no
McNeil   Australia    no

Books
=====
Name     Title                         Other.Author
----     -----
Tukey    Exploratory Data Analysis     NA
Venables Modern Applied Statistics ... Ripley
Tierney  LISP-STAT                     NA
Ripley   Spatial Statistics            NA
Ripley   Stochastic Simulation         NA
McNeil   Interactive Data Analysis     NA
R Core   An Introduction to R          Venables & Smith

Indeed, as you point out the examples in the R documentation fail to show the output which makes them a bit incomplete.  The main capability of interest is joining two tables on the value of a common column to create a new flat table.

m1 <- merge(authors, books, by.x = "surname", by.y = "name")

m1
==
Surname  Nationality Deceased Title                         Other.Author
-------  ----------- -------- -----                         ------------
McNeil   Australia   no       Internative Data Analysis     NA
Ripley   UK          no       Spatial Statistics            NA
Ripley   UK          no       Stochastic Simulation         NA
Tierney  US          no       LISP-STAT                     NA
Tukey    US          yes      Exploratory Data Analysis     NA
Venables Australia   no       Modern Applied Statistics ... Ripley

The syntatical niceties of R's merge allow it to provide equivalent capabilities to a RDBMS:

"In SQL database terminology, the default value of all = FALSE gives a natural join, a special case of an inner join. Specifying all.x = TRUE gives a left (outer) join, all.y = TRUE a right (outer) join, and both (all=TRUE a (full) outer join. DBMSes do not match NULL records, equivalent to incomparables = NA in R."

Does Maple have a syntax or command that would similarity provide such an equivalency to RDBMS join operations?  Perhaps I shouldn't have brought up R's merge command at all and I should just ask if Maple has syntax or commands similar to database JOINs.

Pagan, sorry for not providing a more detailed example.  I forget that not everyone is familar with R syntax.  Looking at the example from R we have two tables of data, "Authors" and "Books":

Authors
=======
Surname  Nationality  Deceased
-------  -----------  --------
Tukey    US           yes
Venables Australia    no
Tierney  US           no
Ripley   UK           no
McNeil   Australia    no

Books
=====
Name     Title                         Other.Author
----     -----
Tukey    Exploratory Data Analysis     NA
Venables Modern Applied Statistics ... Ripley
Tierney  LISP-STAT                     NA
Ripley   Spatial Statistics            NA
Ripley   Stochastic Simulation         NA
McNeil   Interactive Data Analysis     NA
R Core   An Introduction to R          Venables & Smith

Indeed, as you point out the examples in the R documentation fail to show the output which makes them a bit incomplete.  The main capability of interest is joining two tables on the value of a common column to create a new flat table.

m1 <- merge(authors, books, by.x = "surname", by.y = "name")

m1
==
Surname  Nationality Deceased Title                         Other.Author
-------  ----------- -------- -----                         ------------
McNeil   Australia   no       Internative Data Analysis     NA
Ripley   UK          no       Spatial Statistics            NA
Ripley   UK          no       Stochastic Simulation         NA
Tierney  US          no       LISP-STAT                     NA
Tukey    US          yes      Exploratory Data Analysis     NA
Venables Australia   no       Modern Applied Statistics ... Ripley

The syntatical niceties of R's merge allow it to provide equivalent capabilities to a RDBMS:

"In SQL database terminology, the default value of all = FALSE gives a natural join, a special case of an inner join. Specifying all.x = TRUE gives a left (outer) join, all.y = TRUE a right (outer) join, and both (all=TRUE a (full) outer join. DBMSes do not match NULL records, equivalent to incomparables = NA in R."

Does Maple have a syntax or command that would similarity provide such an equivalency to RDBMS join operations?  Perhaps I shouldn't have brought up R's merge command at all and I should just ask if Maple has syntax or commands similar to database JOINs.

I realize this is an old thread and the laptop has been purchased but I'd like to add a short note to the archive.  I second acer's comments on considering a dedicated GPU in the specifications for a new laptop.  General Purpose GPU (GPGPU) has a lot of potential for scientific computing.  At the moment custom C (or C++) code would need to be written to do the GPCPU work but Maple could call such code as an external procedure.

Although Nvidia led the way in GPCPU with CUDA the new OpenCL API would be the API to target for new code.  This would help ensure the code would run on ATI or Nvidia hardware.  CUDA is Nvidia specific.

Also Maple should be using hardware acceleration for plots.  A dedicated GPU should improve the interactivity with plots.  If you ever decide to use Linux it is notable that the popular Intel integrated graphics have terrible performance while Nvidia and ATI dedicated graphics perform comparably on both Linux and Windows.  See this Phoronix article for details [http://www.phoronix.com/scan.php?page=news_item&px=ODIwMQ].

OK, thanks for the reply Will.  I saw the Blog post on the upcoming changes to reputation and badges and posted a comment (http://www.mapleprimes.com/blog/bthur/newmapleprimesreputationandbadges).

Thanks for the links jakubi.  I'll have to test and see if plots (inline or windowed) are somehow using a different VM instance or memory limit than the Maple GUI.  The really bothersomething thing is the mismatch between the Memory reported by the GUI status bar and the errors being reported to the console.

Thanks for the quick and detailed reply Acer.  The two lines of Units:-AddSystem and Units:-UseSystem are a nice and simple resolution to get the desired behavior.  I'll have to look into adding those lines to my Maple templates.

It seems that adding bytes to SI would be consistent with how the Units package operates in general.  Should I file an enhacement request with Maplesoft for this to be integrated with the Units package or are there drawbacks to this that I am not seeing?

Thanks for the quick and detailed reply Acer.  The two lines of Units:-AddSystem and Units:-UseSystem are a nice and simple resolution to get the desired behavior.  I'll have to look into adding those lines to my Maple templates.

It seems that adding bytes to SI would be consistent with how the Units package operates in general.  Should I file an enhacement request with Maplesoft for this to be integrated with the Units package or are there drawbacks to this that I am not seeing?

Badges and reputation seem like fun ideas for the site.  The badges concept is common enough in video games such a XBox Live or Quake Live where icons are awarded for progression through simple tasks in the system.  Assignment of badges should be easy to implement.

Computing an individual's reputation score on the other hand is an active research topic in Information Science and nontrivial.  A Maple-esque way to do this would be to expose the raw data from the site and the scoring algorithms so that users can participate in the computation.  One idea would be to expose the network data for posts and page hits along with a PageRank weighting to correlate posters with the score of thier posts.  With hit and link data the community could play with tweaking the algorthims for different kinds of scoring.  Such an approach would be much more fun for the Maple crowd than simply assigning reputation scores based on some arbitrary algorithm developed internally.  I could see Maple's GraphTheory package as being particularly useful for such a system.

Another consideration is that introducing an explict reputation scoring system will ultimately result in a narrowing of ideas and dominance of groupthink due to reinforcement effects.  Restricting features to users with a reputation score of 250 as mentioned in the original post would likely have this effect.  I did a short research poster on "Overcoming Groupthink in Distributed Heterogeneous Data Analysis" that touchs on this problem: http://www.donpellegrino.com/is/Pellegrino-ResearchDay2009.pdf

Thanks for the explaination acer.  I assumed that a Document would provide its own scope separate from the engine.  As this is not the case I also would not want my assignments and data shared across multiple documents.  I am sure that would eventually result in hard to track errors in my code.  I'll use multiple engines then.

Thanks for the explaination acer.  I did not realize that ArrayTools:-Alias offered so many efficiencies.  The use of Alias in this case is more efficient but since it does use the same underlying data the call to LinearAlgebra:-Normalize changes the input.  Removing the inplace option returns a vector that then needs a conversion to a matrix for input to the ImageTools:-Create procedure.  Alternatively ArrayTools:-Copy can be used to run the routine on a copy of the original matrix thus preserving the original data.

I really appreciate the advice.  I can see myself using ArrayTools:-Alias quite a bit in the future.  It is a very handy procedure.

Thanks for pointing out ImageTools:-Create.  I did not realize how easily a matrix could be used with the ImageTools:-Entropy procedure.  This use can be made more general by adding a call to LinearAlgebra:-Normalize before ImageTools:-Create to account for the case when the contents of the matrix are not all between 0 and 1.0.  I tried to generalize even further to the case where the matrix contains string or heterogeneous types but I was not able to find a solution for such a matrix.  I put a longer discussion with some example data in a file to test the algorithm:

View 8408_ShannonEntropy-RegressionTest.mw on MapleNet or Download 8408_ShannonEntropy-RegressionTest.mw
View file details

I am not very familiar with all of the options for type conversion in Maple so I may have missed some easy transformations that might make ImageTools:Entropy more useful.

Thanks acer.  Your version is much faster and simpler.  The use of Maple's Statistics:-Tally and ArrayTools:-Alias avoids all of the convoluted looping I was doing.  I have added a new file with your implementation.

View 8408_InformationIndices.mw on MapleNet or Download 8408_InformationIndices.mw
View file details

I have also added a test file that runs an example matrix on an expanded version of your code so that the intermediate results can be seen.

View 8408_ShannonEntropy-RegressionTest.mw on MapleNet or Download 8408_ShannonEntropy-RegressionTest.mw
View file details

Thanks, this is a great improvement.

1 2 Page 1 of 2