changeset 19:1eb0ea29ec40

Doesn't belong here.
author samer
date Thu, 17 Jan 2013 13:32:19 +0000
parents b1399f66b364
children ed2629b7f02b
files general/numerical/mse.m general/numerical/quantile.m general/numerical/smooth_with.m general/numerical/stddevs.m
diffstat 4 files changed, 0 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/general/numerical/mse.m	Thu Jan 17 13:24:01 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-function E=mse(x1,x2)
-% mse - Mean-square diff between arrays.
-%
-% mse :: [[Size]], [[Size]] -> nonneg.
-
-E=mean(flatten((x1-x2).^2));
-
-
-
--- a/general/numerical/quantile.m	Thu Jan 17 13:24:01 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-function Y=quantile(Q,X)
-% quantile - compute quantiles of X
-%
-% quantile :: 
-%    [[L]->0--1] ~'the L quantiles to compute',
-%    [[N,M]] ~'M columns of data'
-% -> [[L,M]] ~'the L quantiles for each of M columns'.
-
-j=max(1,round(Q*size(X,1)));
-S=sort(X);
-Y=S(j,:);
-
-
--- a/general/numerical/smooth_with.m	Thu Jan 17 13:24:01 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-function Z=smooth_with(h,i,Y)
-% smooth_with - Smooth a signal by convolution without changing length
-%
-% smooth_with :: [[M]], 1..M, [[N]] -> [[N]].
-
-m=length(h);
-h=stoch(h(:))';
-csh=cumsum(h);
-rsh=fliplr(cumsum(fliplr(h)));
-
-if isvector(Y), Z=sm(Y);
-else Z=maprows(@sm,Y); 
-end
-
-function z=sm(y)
-	z=conv(h,y); % complete convolution
-	z=z(i:end-(m-i)); % trim the ends
-
-	% rescale end bits
-	z(1:m-i)=z(1:m-i)./csh(i:end-1);
-	z(end-i+2:end)=z(end-i+2:end)./rsh(2:i);
-end
-
-end
--- a/general/numerical/stddevs.m	Thu Jan 17 13:24:01 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-function Y=stddevs(Q,X)
-% stddevs - returns values a certain number of standard deviations from mean
-%
-% stddevs :: [[L]], [[N,M]] -> [[L,M]].
-
-Y=Q(:)*std(X) + repmat(mean(X),length(Q),1);