Author Topic: "R" vs SmplMath, and a lazzy macro  (Read 229 times)

HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
"R" vs SmplMath, and a lazzy macro
« on: May 07, 2018, 05:27:32 AM »
Hi All!

 Just an interesting observation. A little model coded in R statics programming language with only 350 equations, running 835000 times and saving a couple of variables to a file, take 1 hour 49 minutes. The same thing in console plain asm using SmplMth take 312 miliseconds. Very interesting difference!

Of course R have overflow control, store all variables last run values, but nothing of that is required in this case.

An interesting feature of most HLL is that a variable can be declared in the same line of the equation. Some times require a type declaration like Java:
Code: [Select]
double difBasal1 = (0.100 * Math.pow(ebw,0.75) - Basal/h*ATADH1)/ATADH1

With this obvious macro:
Code: [Select]
NewR8 macro nombre
    .data
    align 4
        nombre REAL8 0.0
    .code
    exitm <nombre>
endm
the same thing is achived:
Code: [Select]
fSlv8 NewR8(difBasal1) = (0.100 * ebw^0.75 - Basal/h*ATADH1)/ATADH1

print real8$ difBasal1


Another thing is that running the full problem in 8350000 steps and storing 3 variables every other step  build a .txt file of 175 MB that qEditor open without problem, but storing all the steps build a file of more than 360 MB that qEditor can't open. 

Regards. HSE

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5427
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: "R" vs SmplMath, and a lazzy macro
« Reply #1 on: May 07, 2018, 12:26:09 PM »
You will find that the 64 bit editor that is similar to QE will open up to about 750 meg but you must have enough memory to do that.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

FORTRANS

  • Member
  • *****
  • Posts: 1000
Re: "R" vs SmplMath, and a lazzy macro
« Reply #2 on: May 07, 2018, 10:21:36 PM »
Hi HSE,

   Probably off-topic, but:  The Great Courses is a company that sells
courses or lectures on DVD (also Audio-CD).  I recently bought and
watched "Learning Statistics; Concepts and Applications in R".  I
installed R, but it never ran correctly.  If you are interested in R, this
might be an equivalent to a basic introduction with (?) well explained
examples.  The (?) is due to no way to try them out here because
R never ran properly on my older than recommended computer.

   R looks to be newfangled and powerful, something for school
use initially, and then when learned, used for quick analysis.  Maybe?
Apparently lots of features.

Regards,

Steve N.

HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
Re: "R" vs SmplMath, and a lazzy macro
« Reply #3 on: May 07, 2018, 10:55:08 PM »
QE will open up to about 750 meg but you must have enough memory to do that.
:t
I'm not going to edit such files. Just a curiosity. A TexPad from 1997 that remain in old disk opened opened 360MB file, perhaps some additional trick.


HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
Re: "R" vs SmplMath, and a lazzy macro
« Reply #4 on: May 08, 2018, 12:00:58 AM »
something for school
use initially, and then when learned, used for quick analysis.  Maybe?

Apparently lots of features.

Hi Steve!
It's the topic, because test have little meaning without some kowlegde about  R .
More than school, now R it's a reference that is replacing SAS for statics in scientific publications. Sometimes R code is publised like supplementary material with papers.
Examples in the package are really insificients. Fortunatelly there is a lot of universities' materiaI, and I found some examples of non linear regression from Nobel prize John Nash (remember A Beautiful Mind movie? [ or at least Jennifer Conelly?]) wich is some kind of "honour" to use  :biggrin:

Mostly all features needed are available, sometimes not very easy to find the way, and evidently not very fast. And no problems here.

Regards.

FORTRANS

  • Member
  • *****
  • Posts: 1000
Re: "R" vs SmplMath, and a lazzy macro
« Reply #5 on: May 08, 2018, 01:35:53 AM »
Hi,

Hi Steve!
It's the topic, because test have little meaning without some kowlegde about  R .
More than school, now R it's a reference that is replacing SAS for statics in scientific publications. Sometimes R code is publised like supplementary material with papers.

   Interesting to hear that.  I would not have expected that  The
interface seems busy or clumsy.  Oh well, time to get used to GUI
programs.
 
Snip
Quote
Mostly all features needed are available, sometimes not very easy to find the way, and evidently not very fast. And no problems here.

   How is your system set up?  I guess it is either the version of
Windows or Internet Explorer that bit me.  Or, unlikely, a router
or firewall setting.

Regards,

Steve N.

HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
Re: "R" vs SmplMath, and a lazzy macro
« Reply #6 on: May 08, 2018, 02:28:05 AM »
Are you trying to use the "friendly" IDE?

 :P :P :P

It's impossible.
I'm using console GUI, and coding in qEditor.

Oldest is XP sp 3-32 with 1.9GB RAM, but test RGUI.exe.



FORTRANS

  • Member
  • *****
  • Posts: 1000
Re: "R" vs SmplMath, and a lazzy macro
« Reply #7 on: May 08, 2018, 05:07:27 AM »
Hi,

Are you trying to use the "friendly" IDE?

It's impossible.
I'm using console GUI, and coding in qEditor.

   Not sure what I tried as it did not work.  Probably the console
GUI imbedded in the IDE.  Typed in the suggested commands and
read the failure messages.  More or less {can't communicate
securely}.

Quote
Oldest is XP sp 3-32 with 1.9GB RAM, but test RGUI.exe.

   Well, I tried on 32-bit XP, service pack 3.  Trying "RStudio",
which fails to find some procedure entry points in various DLL's.

Regards,

Steve

HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
Re: "R" vs SmplMath, and a lazzy macro
« Reply #8 on: May 08, 2018, 06:06:28 AM »
That is! RStudio is the IDE-nightmare. I forgot the name because I erased it.
You must try RGui.exe. In my case path is /program files/R/R-3.3.2/bin/i386/rgui.exe

Then type and enter: demo(graphics)

If you don't find Rgui perhaps you have installed RStudio but not R package. 

FORTRANS

  • Member
  • *****
  • Posts: 1000
Re: "R" vs SmplMath, and a lazzy macro
« Reply #9 on: May 09, 2018, 12:40:05 AM »
Hi,

   Well, by gosh, and by golly, that works!  Thank you very much.
I guess it is time to read all those Readme files to see what is
going on.  May even watch the course again to see if the examples
work the same way.

   It does look much better than RStudio.  Though that did some
"hand holding", I believe, to make things "easier" for beginners.
Cleaning out the Rstudio files will be, more or less, next on the list.

Regards,

Steve N.

HSE

  • Member
  • ****
  • Posts: 676
  • <AMD>< 7-32>
Re: "R" vs SmplMath, and a lazzy macro
« Reply #10 on: May 09, 2018, 01:10:49 AM »
 :t