﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Bluebit Software Support Forum / Technical Support and Help / Matrix ActiveX Component  / ActiveX Component with FOXPRO / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Bluebit Software Support Forum</description><link>http://www.bluebit.gr/forum/</link><webMaster>support@bluebit.gr</webMaster><lastBuildDate>Wed, 08 Feb 2012 06:54:12 GMT</lastBuildDate><ttl>20</ttl><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>oops i made i big mistake... ive found the errors in the above code sd(0) = 0For x = 0 To (M.Rows - 1)    sd(0) = sd(0) + ((M(x, 0) - mean(0)) ^ 2)Nextsd(0) = Sqr(sd(0) / (M.Rows - 1))its working ok now :D</description><pubDate>Wed, 22 Mar 2006 08:21:03 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Thanks ive got that bit working now and i'm using an array.  The standard deviations don't look right though.s0 = 175.5438827s1 = 38.312072766s2 = 50.721087668Ive tried using a different way rather than the colddotproduct for s0 and i stil dont seem to be getting the right values as the SD of column zero should be about 5.764762918I'll paste my code here so you can see what i have done and hopefully where i am going wrong...Private Sub Command3_Click()Dim M As New MatrixDim mean(2) As DoubleDim sd(2) As DoubleM.Size 6, 3M(0, 0) = 20.8921: M(0, 1) = 1.5012: M(0, 2) = 6.2138M(1, 0) = 4.9635: M(1, 1) = 3.6289: M(1, 2) = 7.9978M(2, 0) = 9.1142: M(2, 1) = 0.554: M(2, 2) = 4.2135M(3, 0) = 11.1238: M(3, 1) = 9.8182: M(3, 2) = 9.9979M(4, 0) = 6.1176: M(4, 1) = 5.2137: M(4, 2) = 2.4238M(5, 0) = 13.129: M(5, 1) = 7.2285: M(5, 2) = 5.2386Debug.Print M.GetString(4)mean(0) = M.ColSum(0) / M.Rowsmean(1) = M.ColSum(1) / M.Rowsmean(2) = M.ColSum(2) / M.RowsDebug.Print "mean0 = " &amp; mean(0)Debug.Print "mean1 = " &amp; mean(1)Debug.Print "mean2 = " &amp; mean(2)sd(0) = M.ColsDotProduct(0, 0) / (M.Rows - 1)sd(1) = M.ColsDotProduct(1, 1) / (M.Rows - 1)sd(2) = M.ColsDotProduct(2, 2) / (M.Rows - 1)s0 = 0For x = 0 To (M.Rows - 1)    s0 = s0 + ((M(x, 0) - mean0) ^ 2)    s0 = s0 / (M.Rows - 1)NextDebug.Print "s0 = " &amp; sd(0)Debug.Print "s1 = " &amp; sd(1)Debug.Print "s2 = " &amp; sd(2)'For x = 0 To (M.Rows - 1)'    M(x, 0) = (M(x, 0) - mean0) / s0'    M(x, 1) = (M(x, 1) - mean1) / s1'    M(x, 2) = (M(x, 2) - mean2) / s2'NextFor r = 0 To M.Rows - 1    For c = 0 To M.Cols - 1        M(r, c) = (M(r, c) - mean(c)) / sd(c)    NextNextDebug.Print M.GetString(6)End Sub</description><pubDate>Wed, 22 Mar 2006 08:08:14 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>You will have to do it element by elementYou may update all columns in the same time. Something like this:[code]For r = 0 To M.Rows - 1    For c = 0 To M.Cols - 1        M(r, c) = (M(r, c) - mean(c)) / s(c)    NextNext[/code]I suggest storing the columns means and deviations in arrays</description><pubDate>Wed, 22 Mar 2006 07:55:41 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>i have this at the minuteDim M As New MatrixM.Size 6, 3M(0, 0) = 20.8921: M(0, 1) = 1.5012: M(0, 2) = 6.2138M(1, 0) = 4.9635: M(1, 1) = 3.6289: M(1, 2) = 7.9978M(2, 0) = 9.1142: M(2, 1) = 0.554: M(2, 2) = 4.2135M(3, 0) = 11.1238: M(3, 1) = 9.8182: M(3, 2) = 9.9979M(4, 0) = 6.1176: M(4, 1) = 5.2137: M(4, 2) = 2.4238M(5, 0) = 13.129: M(5, 1) = 7.2285: M(5, 2) = 5.2386Debug.Print M.GetString(4)mean0 = M.ColSum(0) / M.Rowsmean1 = M.ColSum(1) / M.Rowsmean2 = M.ColSum(2) / M.Rowss0 = M.ColsDotProduct(0, 0) / (M.Rows - 1)s1 = M.ColsDotProduct(1, 1) / (M.Rows - 1)s2 = M.ColsDotProduct(2, 2) / (M.Rows - 1)Debug.Print M.GetString(6)***************************************i cant update them in one step as i have a mean for each column and a SD for each column...can i update a column at a time or do i have to use a loop to go through updating each value?</description><pubDate>Wed, 22 Mar 2006 07:28:23 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>ok cool, many thanks :)</description><pubDate>Wed, 22 Mar 2006 07:16:31 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>You will have to do it using some more lines of codeFirst you calculate the sum using the ColSum , you get the mean by dividing by the number of rows.Then you calculate the squares sum using ColsDotProduct, you divide by N-1 and you get samples deviation.You update the values in a sigle step by setting x = (x-mean)/s</description><pubDate>Wed, 22 Mar 2006 06:53:25 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Thanks ive tried it with that and i think i know where the problem is now.  There are two types of standard deviation, the sample and population.  This method returns the population standard deviation which is where the denominator for dividing the sum of squared deviations is simply N itself.However i am using a sample and not a population so i need the sample standard deviation where the demoninator for dividing the sum of squared deviations is N-1.Can this activeX control normalize the matrix in this way for me??</description><pubDate>Wed, 22 Mar 2006 06:31:05 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Hello,Try this to verify the results[code]Dim A As New MatrixA.Size 5, 2A(0, 0) = 6.87491: A(0, 1) = 9.37361A(1, 0) = 0.17828: A(1, 1) = 7.54182A(2, 0) = 3.44818: A(2, 1) = 3.26085A(3, 0) = 3.14801: A(3, 1) = 7.26423A(4, 0) = 7.88243: A(4, 1) = 9.41093'Display 6 digitsDebug.Print A.GetString(6)A.NormalizeColumns bmModeZScoresDebug.Print A.GetString(6)'Check to column sumDebug.Print "ColSum 0 = " &amp; A.ColSum(0) &amp; "  ColSum 1 =" &amp; A.ColSum(1)'Calculate S(x^2)/nDebug.Print "Col 0  S(x^2)/n = " &amp; (A.ColsDotProduct(0, 0) / A.Rows)Debug.Print "Col 1  S(X^2)/n = " &amp; (A.ColsDotProduct(1, 1) / A.Rows)[/code]</description><pubDate>Wed, 22 Mar 2006 05:46:35 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Thanks ive had a look at that but ive decided to go the long way around and i'm writing the fucntionality i want in VB and then calling that from foxpro.  This is because you cant create a dynamic array in foxpro so i cant transfer data from the matrices to an array an vice versa if i just use fox pro.I am planning to use your product to help me with performing principle components analysis and therefore i need the data normalized to have a mean of 0 and a standard deviation of 1.  I have tried the normalize columns method with the parameter 'bmModeZScores' but this doesnt give me the correct results.The original data values are as follows.[6.87491 9.37361][0.17828 7.54182][3.44818 3.26085][3.14801 7.26423][7.88243 9.41093]The values i have got from using the normalize columns method with the parameter of 3 are as follows.[0.926	0.894][-1.488	0.077][-0.309	-1.834][-0.417	-0.047][1.289	0.911]Mean = [0.0002	0.0002]Standard deviation = [1.118314669 1.118129107]The correct normalized values should be as follows.[0.82786 0.79964][-1.33051 0.06847][-0.27660 -1.64031][-0.37335 -0.04233][1.15260 0.81454]Mean = [0 -1.11022E-16]Standard Deviation = [1	1]**********************************************************What is going wrong? Can someone help me as i cant seem to get the right values when i use this method :(</description><pubDate>Wed, 22 Mar 2006 04:41:35 GMT</pubDate><dc:creator>zicon</dc:creator></item><item><title /><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Hello,Have a look here, I think this is what you need:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp/html/dgextending_visual_foxpro_with_external_libraries.asp</description><pubDate>Tue, 21 Mar 2006 04:39:43 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title>ActiveX Component with FOXPRO</title><link>http://www.bluebit.gr/forum/Topic92-1-1.aspx</link><description>Has anyone had any experience using this control with MS FoxPro? I have downloaded the trial version to test it out before i buy the advanced version.  The excel example works but the help file says to select the activeX control from References on the Tools menu.  In FoxPro there is no references option on the tools menu.In the FoxPro options there is a 'Controls' tab where the activeX controls can be selected.  I have tried to add the control to this list but it does not appear after being added.Can anyone please give me some advice on how i go about using this control from with FoxPro?Thanks,James.</description><pubDate>Tue, 21 Mar 2006 02:22:02 GMT</pubDate><dc:creator>zicon</dc:creator></item></channel></rss>
