<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Recursive vs Ordinary Least Squares &#38; Fixed Point</title>
		<link>http://forums.leaflabs.com/topic.php?id=1545</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Wed, 22 May 2013 07:47:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1545" rel="self" type="application/rss+xml" />

		<item>
			<title>iainism on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10495</link>
			<pubDate>Sat, 05 May 2012 09:28:18 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">10495@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;OK, so I'm still grinding away on this - I realised that by using Vector CANoe I can simulate what I want to do on the Olimexino.  The fun stuff comes in when you realise that CAPL (the language used to programme in CANoe) doesn't support the struct or pointer concepts that one would normally use in implementing FIFOs and the like (and I need FIFOs as part of my final piece of work).&#60;/p&#62;
&#60;p&#62;Anyway, as part of my general hackery I've now implemented a recursive least squares function, which is (also) based on an assumption of a linear system (YMMV).&#60;/p&#62;
&#60;p&#62;I've stuck it in pastebin: &#60;a href=&#34;http://pastebin.com/wFsdECwa&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/wFsdECwa&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Enjoy!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iainism on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10168</link>
			<pubDate>Wed, 11 Apr 2012 18:17:09 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">10168@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;At the moment I have Code::Blocks as I don't generally work down amongst the bits and bytes and it provides some nice features for wxWidgets (and integrating libBoost into it is quite easy too) ;-)&#60;/p&#62;
&#60;p&#62;GCC is built-in to Code::Blocks via MinGW in Windows at 4.4.1 - the last time I tried to alter this I borked some things!&#60;/p&#62;
&#60;p&#62;However, I've checked the docs and it seems that 4.4.1 supports the _Fract and _Accum types - I didn't know they existed.  Thanks very much for the pointer.  I will have a play.  (It looks as though they came in around 4.3.0)&#60;/p&#62;
&#60;p&#62;Iain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10166</link>
			<pubDate>Wed, 11 Apr 2012 16:06:16 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10166@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ianism - What compiler have you got on your host system? &#60;/p&#62;
&#60;p&#62;If you have a relatively modern compiler, you might be able to do some fixed-point experiments using the C compilers built in _Fract, _Accum types to see how much precision is lost. They aren't ideal, but it might be easier writing code for them rather than trying to make a library or class-libary work.&#60;/p&#62;
&#60;p&#62;You might then time the two fixed-point programs to see if there is much difference.&#60;/p&#62;
&#60;p&#62;Edit: It is probably worth mentioning that if you install a newer version of gcc (e.g. gcc 4.6.x) than LeafLabs distribute in the Maple IDE, then that should compile code using _Fract _Accum types for Maple.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iainism on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10162</link>
			<pubDate>Tue, 10 Apr 2012 18:55:14 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">10162@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;In fact, because I'm feeling nice, here's a link to a PDF write-up I just completed on hardcoding OLS: &#60;a href=&#34;http://iainism.co.uk/public/OLS_hardcode.pdf&#34; rel=&#34;nofollow&#34;&#62;http://iainism.co.uk/public/OLS_hardcode.pdf&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iainism on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10160</link>
			<pubDate>Tue, 10 Apr 2012 13:30:07 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">10160@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, thanks.&#60;/p&#62;
&#60;p&#62;It's a bit of all of those!&#60;/p&#62;
&#60;p&#62;I'm trying to find out two things, firstly, whether I can tolerate the loss of precision due to using Fixed Point, but at the moment I can't easily simulate this.  I will build up the system and test with debug code as I go if I have to, but I'd prefer to benchmark beforehand if possible.  Secondly, given the restriction of scope of OLS whether using it is a better solution than RLS.&#60;/p&#62;
&#60;p&#62;So I have 4 options to compare:&#60;br /&#62;
1.  RLS fixed&#60;br /&#62;
2.  RLS float&#60;br /&#62;
3.  OLS fixed&#60;br /&#62;
4.  OLS float&#60;/p&#62;
&#60;p&#62;I'm just mindful that using RLS requires 3 steps with a total of 7 matrix multiplications for each iteration, while doing a hardcoded OLS for a fixed (low) number of points is one matrix multiplication and an inversion (but for a 2x2 this is trivial).  So it 'feels' as though the hardcoded OLS will present a lower load.  But this kind of contradicts the whole motivation for RLS (and hence gives rise to my desire to simulate before coding).&#60;/p&#62;
&#60;p&#62;If I do get a lower load in a hardcoded OLS, then it might lead me to the situation where I could use the 'OLS float' option and outperform 'RLS fixed'...&#60;/p&#62;
&#60;p&#62;If there's anywhere that I can post up PDF then I'm happy to outline hardcoded OLS for the situation in question so others can use it.&#60;/p&#62;
&#60;p&#62;Iain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10159</link>
			<pubDate>Tue, 10 Apr 2012 12:04:33 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10159@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;iainism - I'm not sure what the core of your question or concern is.&#60;/p&#62;
&#60;p&#62;Is it that you are concerned about the amount of error introduced by using fixed point vs floating point techniques?&#60;/p&#62;
&#60;p&#62;Or are you asking:&#60;br /&#62;
-which one will consume the least amount of CPU time?&#60;br /&#62;
- for suggestions of techniques which may have some better properties than either of them?&#60;br /&#62;
- or tools to simulate the two?&#60;/p&#62;
&#60;p&#62;Or something else? &#60;/p&#62;
&#60;p&#62;If I had the time, and no alternatives, I'd try to find code, or write them both, time them and compare them.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iainism on "Recursive vs Ordinary Least Squares &#38; Fixed Point"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1545#post-10158</link>
			<pubDate>Tue, 10 Apr 2012 11:34:48 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">10158@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;For my project I need to predict when a level will get to a certain point. I'm going to assume a linear model (y=ax+b, with y=level, x=time and b=y_0), finding the x value when y=0 is then trivial (y_end=-b/a).  My initial thoughts are to approach the parameter estimation for this in one of two ways:&#60;/p&#62;
&#60;p&#62;1.  To run a recursive least squares algorithm over all time that the system runs&#60;br /&#62;
2.  To run ordinary least squares over a fifo of the last 'n' readings of the level&#60;/p&#62;
&#60;p&#62;The level changes in a roughly constant manner (give or take measurement noise), so the two methods should give the same answer (to within an acceptable tolerance).  My question is:&#60;/p&#62;
&#60;p&#62;Which would give the least load - assuming that any matrix/vector work is carried out in fixed point (and either done in the form of precalculated expressions or using Trenki's matrix library)?&#60;/p&#62;
&#60;p&#62;Normally I'd simulate the two different *LS approaches in Matlab but I only have Matlab student R2009a, which doesn't include the fixed-point toolbox, so I seem to have hit a bit of a brick wall!&#60;/p&#62;
&#60;p&#62;Any ideas please?  I've seen that Octave has a FP toolbox, but development seems to have stopped on this a while ago - has anyone used it?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
