I develop an application in which I constantly get samples of heart pulse.  I defined an interval of $t$ seconds.  In each $t$ seconds I have $n$ samples.  In every interval, I want to calculate the tendency of those $n$ samples. For example, lets say I have $n = 5$, and I have samples with values $\{70, 88, 95, 103, 115\}$. I want to recognize I have a growth in the heart pulse, and I want to have some measure for the rate of grows/decrease/almost no change.  I thought on two approaches for solving this problem.   I calculate the linear approximation for the $n$ samples using linear regression by applying least squares implemented by the normal equations. (I treat each sample as two coordinates vector with $x$ coordinate as time and $y$ coordinate as heart pulse). I get from the normal equations a linear function of the form $y = mx+b$ and my measure for the tendency is the slope, i.e. the $m$ value. The second approach is to calculate the correlation (pearson's correlation) between vector $x$ and vector $y$ when $x$ is the time and $y$ is the heart pulse.   I'm asking which approach do you think is better for my problem (determining the tendency of heart pulses). Or, do you have a better algorithm for solving this problem?
I develop an application in which i constantly get samples of heart pulse.  I defined an interval of t seconds.  In each t seconds I have n samples.  In every interval, I want to calculate the tendency of those n samples. For example, lets say I have n = 5, and I have samples with values {70, 88, 95, 103, 115}. I want to recognize I have a growth in the heart pulse, and I want to have some measure for the rate of grows/decrease/almost no change.  I thought on two approaches for solving this problem.   I calculate the linear approximation for the n samples using linear regression by applying least squares implemented by the normal equations. (I treat each sample as two coordinates vector with x coordinate as time and y coordinate as heart pulse). I get from the normal equations a linear function of the form y = mx+b and my measure for the tendency is the slope, i.e. the m value. The second approach is to calculate the correlation (pearson's correlation) between vector x and vector y when x is the time and y is the heart pulse.   I'm asking which approach do you think is better for my problem (determining the tendency of heart pulses). Or, do you have a better algorithm for solving this problem?
Why is ridge regression called "ridge", why is it needed, and what happens when $\lambda$ goes to infinity? .Net 'Any Framework' configuration states:  "In practice, explicit right outer joins are rarely used, since they can always be replaced with left outer joins and provide no additional functionality."  Can anyone provide a situation where they have preferred to use the RIGHT notation, and why? I can't think of a reason to ever use it. To me, it wouldn't ever make things more clear.  Edit: I'm an Oracle veteran making the New Year's Resolution to wean myself from the (+) syntax. I want to do it right How to kill all process with given name? Adding meta values to permalink I have publications and I want to simply add year and month to the permalink. Currently the year and month of publication is added to the post as a meta value. I've set up publications as a custom post type and created taxonomy for the specific title of the publication. I would like the permalink to be:  publications/publication-title/year-published/month-published/name-of-post  I simply want to add the meta values for the publication year and month to the permalink.   So far, I've been able to pull the year and month published and add it to the url but unfortunately I keep getting a 404 when I try to access posts. I think I'm taking a wrong turn with one of my steps below ...  Any help would be appreciated.  These are the steps I did in the following order:   Since I was adding publication-year and publication-month to the url, I was reading that I had to make WordPress aware of these custom querystring variables. I added the following functions to register these custom variables:  function pubyear_register_rewrite_tag() {       add_rewrite_tag( '%pubyear%', '([0-9]{4})');   }    add_action( 'init', 'pubyear_register_rewrite_tag');  function pubmonth_register_rewrite_tag() {      add_rewrite_tag( '%pubmonth%', '([0-9]{2}');   }    add_action( 'init', 'pubmonth_register_rewrite_tag');    2) Added the year and month to the permalink structure:  add_filter('post_type_link', 'pub_term_permalink', 10, 4);  function pub_term_permalink($permalink, $post, $leavename, $sample) {     if ( false !== strpos( $permalink, '%publication-title%/%pubyear%/%pubmonth%' ) ) {       //get the publication-title      $publicationtype = get_the_terms( $post-&gt;ID, 'publication-type' );       //get the year of the publication      $pubyear = date('Y', get_post_meta($post-&gt;ID, 'pub_date', true));       //get the month of the publication      $pubmonth = date('m', get_post_meta($post-&gt;ID, 'pub_date', true));       $rewritecode = array(          '%publication-type%',          '%pubyear%',          '%pubmonth%',          $leavename? '' : '%postname%',      );       $rewritereplace = array(          array_pop($publicationtype)-&gt;slug,          $pubyear,          $pubmonth,          $post-&gt;post_name      );       $permalink = str_replace($rewritecode, $rewritereplace, $permalink);       }     return $permalink; }   3) Add rewrite rules:  function pub_add_rewrite_rules() {       add_rewrite_rule(  '^([^/]*)/([0-9]{4})/([0-9]{2})/([^/]+)?', 'publications/index.php?pagename=$matches[3]', 'top' );   }    add_action( 'init', 'pub_add_rewrite_rules' );   4) Made sure the custom post type is registered and includes this rewrite array:  'rewrite' =&gt; array     (             'slug' =&gt; 'publications/%publication-type%/%pubyear%/%pubmonth%',     'with_front' =&gt; false          ), A photon emitted from a receding source (Doppler redshift) has less energy when detected at an observer's location. Please explain the energy loss from the perspective of energy conservation. Are the off-world colonies really a "golden land of opportunity"? In Blade Runner, there seems to be quite a  for emigration to the off-world colonies, e.g.,      "A new life awaits you in the off-world colonies, a chance to begin   again in a golden land of opportunity and adventure."   Is there any evidence that people emigrating are actually better off than staying on Earth?  The job descriptions of the replicants Deckard is tasked with "retiring" don't seem consistent with the colonies being wonderful places. If the colonies offered a good life, would they have to do so much advertising? Pivot rows into multiple columns I have a SQL Server instance that has a linked server to an Oracle server. There is a table on the Oracle server called PersonOptions which contains the following data:  ╔══════════╦══════════╗ ║ PersonID ║ OptionID ║ ╠══════════╬══════════╣ ║        1 ║ A        ║ ║        1 ║ B        ║ ║        2 ║ C        ║ ║        3 ║ B        ║ ║        4 ║ A        ║ ║        4 ║ C        ║ ╚══════════╩══════════╝   I need to pivot that data so the results are:  ╔══════════╦═════════╦══════════╦══════════╗ ║ PersonID ║ OptionA ║ Option B ║ Option C ║ ╠══════════╬═════════╬══════════╬══════════╣ ║        1 ║       1 ║        1 ║          ║ ║        2 ║         ║          ║        1 ║ ║        3 ║         ║        1 ║          ║ ║        4 ║       1 ║          ║        1 ║ ╚══════════╩═════════╩══════════╩══════════╝   Any suggestions? As Joel points out in , in  (aka: K &amp; R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]? Thread Confinement Execution of a command locally after ssh tunneling I have a script file ./run_app.sh which contains of the following:  ssh -L 8888:localhost:8888 ubuntu@address ./run_website.sh   # it should be executed locally   but it tries to run the second line on the remote machine. Actually, I want to run it on my pc. Any idea? How to format table with long column head entries? Why do airplanes experience negligible Coriolis force while bullets experience the Coriolis force in long range shooting, even though the mass of airplane is much bigger than a bullet? Is there any way to recover deleted files which may have since been overwritten? I deleted lots of files &amp; folders on my laptop and then I put a new files in the same folders. I need to recover the deleted files. I tried a lot of recovery software and I couldn't recover my old files.   I read that if you refill the folders with new files after deleting old ones then I can't recover them again. Is that true?   What should I do? What are the basics needed to learn quantum computing? My book says:     For most of the small objects, both are same. But for mammoth ones, they are really different ones. And in a gravity-less environment, COG is absent; COM still exists.   Ok, what's the big deal when things are small and big? How these two :  &amp; ? I've been using Windows 10 for a couple of month now (joined the Insider Preview).  Now my hard drive started ticking so I've bought a new SSD and I want to move the windows installation to the new hard drive, which has been connected to the computer (unpartitioned). I don't mind and I even prefer reinstalling it over again.   Since I have the free version of Windows 10 pro, can I still reinstall it anew? Does the windows 10 installation offer disk management and partition like the older Windows installations used to? How should I reinstall Winodws 10 x64 the easiest but still remain on free mode? I try unsuccessfully to install the ECW support (mainly to use ECW file in QGIS 2.2). We attempt to follow and adapt the howto provided by .  My first supprise was the repository ubuntugis-unstable is unavailable for trusty and the repository  doesn't have libgdal-ecw-src package. Finally in desperation we add ubuntugis-unstable for the raring distribution in source.list.  And apply the following commands   chmod +x ERDAS-ECW_JPEG_2000_SDK-5.1.1.bin ./ERDAS-ECW_JPEG_2000_SDK-5.1.1.bin # Select option desktop read only sudo cp -r ERDAS-ECW_JPEG_2000_SDK-5.1.1 /usr/local/ sudo ln -s /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only/lib/x86/release/libNCSEcw.so /usr/local/lib/libNCSEcw.so sudo ldconfig sudo apt-get install libgdal-ecw-src sudo gdal-ecw-build /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only   The ECW format seems to be installed  gdalinfo --formats | grep -i ecw   ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)   JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)   But .... Gis crash when a ECW raster file is open with the following message :   QGIS died on signal 4Abandon (core dumped)   If anyone have an idea How to use "grep" command to find text including subdirectories Is it true that all numbers of the form $\sqrt[b_1]{a_1}+\sqrt[b_2]{a_2}+\cdots+\sqrt[b_k]{a_k}$ are not integers, where $a_i,b_i$ are positive integers such that none of the $k$ terms is an integer? I think this must be a theorem somewhere, probably a fundamental theorem in number theory, but not sure what it would be called.