Note that there are some explanatory texts on larger screens.

plurals
  1. POMuPad in Matlab
    primarykey
    data
    text
    <p>I have a simple question want to use MuPad in Matlab to calculate it. I spent about 1 hour to calc it using my pen and paper, however it's interesting for me if it can be solved using MuPad.</p> <p>I have n numbers, clustered in two groups (p and q), each of them with a mean (Mp and Mq). I have a measure called SSE (sum of square error) that calculates the sum of the squared distances between any number in a group to its mean <code>(sum (x[i]-Mp)^2 + sum (x[j]-Mq)^2</code> where i loops on first group and j loops on the second). My question is about the value of the measure if I exchange the position of two records from their original group to the neighbor group <code>( q &lt;= xq,xp =&gt; p )</code>. Please note that the means of the groups are changed also after the exchange. The final formula (based on pen and paper) is as follows:</p> <pre><code>d = xq - xp deltaSSE = SSE1 - SSE2 = d(d (np + nq)/(np nq) -2 (Mq-Mp)) </code></pre> <p>where np and nq are the number of records in groups, xq and xp are the two records are considered for exchange the position, Mq and Mp are corresponding means (before exchange).</p> <p>The most important problem I have with MuPad, is about the number of records in groups (it is always below 10).</p> <p>Thank you for your help.</p> <p><hr/> Example about the formula above: you have two groups "1 2 3" and "4 5 6". The SSE of such clustering is 1^2+0^2+1^2 + 1^2+0^2+1^2 = 4. Now I'm interested to know what is the SSE if I exchange the place of 3 and 6, without the complete calculation. based on the formula above, d=6-3=3, np=nq=3,Mp=(1+2+3)/3=2 and Mq=(4+5+6)/3=5, so deltaSSE = 3(3(3+3)/(3*3)-2(5-2))=-12, i.e the new SSE is 4+12=16. My question is about how to represent clusters of numbers without knowing the exact number of them in MuPad. The Simple form where the number of elements in groups are known, can be solved easily in MuPad. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload