Hello!

I have moved my website to http://45.79.102.35/blaph/index.html because I had trouble running my web apps on WordPress.

Welcome to my blog. I am a math instructor at a technical college in British Columbia, Canada. I have been teaching Statistics, Linear algebra, Calculus, etc. to engineering students at various levels.

My goal is to publish a book (or books) someday on basic mathematics for data science. The target audience will be those who are interested in data science but have not studied mathematics seriously since high school. I am planning to write down bits and pieces of information here, and hopefully someday soon I will be able to string them together in a logical and pedagogically effective manner as (a) book(s).

Lastly, please note that this blog is not for everyone. You may not need much mathematics if you are content with using ready-made commands to do routine work. But if you are curious to know how the algorithms in various libraries work or interested in reading the latest research papers, you do need to know some mathematics, actually quite a bit of mathematics. My hope is to provide the shortest possible bridge from high school-level math to the level at which you can make sense of more advanced data science books or research papers.

Disclaimer: I am not a “data scientist“, statistician, mathematician nor a computer scientist. My background is theoretical physics. So, I might say the wrong things from time to time. If you see me writing about something incorrectly, please let me know. I am still learning every day!

P.S. I added “, etc.” to the title to indicate that I may write about topics not directly related to data science or mathematics. I would like to justify this by saying “Everything is related after all.”

RR ver. 0.1 Remote R web app

I made a web app for running R script on any web site.

First, you need to include the following code in the header of your site.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://45.79.102.35/scripts/RR.css">
<script src="http://45.79.102.35/scripts/RR.js"></script>

Here are some examples:

Example 1: Display a number generated by R

pnorm(1.5)

The probability that a normally distributed variable is less than 1.5 standard deviations above the mean is


P(z<1.5) = .

The HTML code for this example is

<div id="R1" class="R hide">
<pre class="script">pnorm(1.5)</pre>
</div>
The probability that a normally distributed variable
is less than 1.5 standard deviations above the mean is <center> P(z<1.5) = <span id="R1_answer"></span>. </center>


"R1" in the first div element is a unique identifier you choose. The block <div id="..." class="R">....</div> contains the R script and optional parameters.
Obviously, R code goes in the block with class="script". The HTML tag for the script can be anything, i.e., div, span, etc. But I think the "pre" tag is most appropriate because it shows the line breaks correctly and uses a monospaced font, as shown in the next example.

Example 2: Display a plot generated by R


This graph is produced by the following R code:

[[[FIG_OPTIONS]]]height=300,width=300
t = seq(0, 3, 0.01)
y0 = 0
for(k in 1:10){
    y0 = y0 + (-1)^(k+1)*sin(2*pi*k*t)/k
}
plot(t, y0, type="l")

Here is the HTML code:

<img id="R2_figure"><br>
This graph is produced by the following R code:
<div id="R2" class="R">
<div class="settings">[[[FIG_OPTIONS]]]height=300,width=300</div>
<pre class="script">
t = seq(0, 3, 0.01)
y0 = 0
for(k in 1:10){
    y0 = y0 + (-1)^(k+1)*sin(2*pi*k*t)/k
}
plot(t, y0, type="l")
</pre>
</div>

*Note to myself: Needs warning for wrong syntax in "settings".

To be continued.