Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Rapid PHP 2018 15.5
IBDAC 6.4
Online Course Booking Script 1.3.3
Database Workbench Pro 5.6.4
Job Portal Script 1.3.2
The C# PDF Library 5.2
PostgreSQL Data Access Components 6.0
Virtual Data Access Components 11.0
HTMLPad 2018 15.5
WeBuilder 2018 15.5
SentiMask SDK Trial 2.0.0
Track Order For Magento 2 1.0.0
Calendar 365 For Dynamics CRM 4.0
Scimbo 1.2
Odoo Furnito Theme 1.0
Top Code
TdsPrinter 1.8
Top Rated
VisualNEO Web 2018.12.15
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Estimatenoise 1.0
File ID: 78378






Estimatenoise 1.0
Download Estimatenoise 1.0http://www.mathworks.comReport Error Link
License: Freeware
File Size: 10.0 KB
Downloads: 5
Submit Rating:
Estimatenoise 1.0 Description
Description: Some curve fitting or smoothing tools can benefit from knowledge of the noise variance to expect on your data. Kalman filters use this information, also some spline fitting tools. So I wrote a function to extract the noise variance from a signal vector. It also works on any specified dimension of an array.

A few examples of this code in use:

Simple linear data, with purely additive N(0,1) gaussian noise:

t = 0:10000;
x = t + randn(size(t));
mv = estimatenoise(x)
mv =
1.0166

Gaussian noise added to a sine wave (Nominal variance = 0.01)
t = linspace(0,1,1000)';
x = sin(t*50) + randn(size(t))/10;
mv = estimatenoise(x)
mv =
0.0096887

Pure gaussian noise, with a nominal variance of 9. (Note that var would have been a better estimator for this particular case...)

mv = estimatenoise(3*randn(2,3,1000),3)
mv =
9.6584 8.2696 8.632
9.2404 8.5346 9.7725

A piecewise constant function with multiple discontinuities. The true noise variance should be 0.01.

t = linspace(0,1,1000);
X = round(cos(t*6*pi)) + randn(size(t))/10;
plot(t,X)
var(X) % var will be wildly in error
ans =
0.68256

estimatenoise(X)
ans =
0.010882

Test if estimatenoise is able to recover the variance of a normally distributed random sample with unit variance. (Yes, it will be much slower than var.)

mean(estimatenoise(randn(1000,1000)))
ans =
1.0002

Estimatenoise can now handle non-uniformly spaced series (by request.) In the next example,
the actual noise variance was 1.0 here. Perform the operation 1000 times, then look at the median variance estimate. How well did we do?

t = sort([randn(1,100) , randn(1,100)+5]);
X = repmat(sin(t*5)*100,1000,1) + ...
randn(1000,length(t));

Estimatenoise is clearly wrong when the spacing is ignored.

median(estimatenoise(X,2))
ans =
16.438

Supplying the sampling "times", we get quite a reasonable result.
median(estimatenoise(X,2,t))
ans =
1.1307

Estimatenoise also works on data with replicates. In this example, each point will be replicated up to 3 times. The actual noise variance was again 1.0 here. I'll also compare the increase in times required for estimatenoise when t is supplied.

t = sort([0:1:100, 1:2:100, 1:4:100]);
X = repmat(sin(t/10)*100,1000,1)+ ...
randn(1000,length(t));

Again, estimatenoise is clearly wrong when the non-uniform spacing is ignored.

tic,median(estimatenoise(X,2)),toc
ans =
4.2056
Elapsed time is 2.690135 seconds.

Supplying the sampling "times", we again get quite a reasonable result. The time penalty is not quite 2x.

tic,median(estimatenoise(X,2,t)),toc
ans =
1.0116
Elapsed time is 4.864486 seconds.

License: Freeware

Related: do3ft, sortrandn, estimate, median, Operation, times, randn, repmatsint, ignoredmedianestimatenoisex ans, supplying, spacing, wrong, randn lengthtestimatenoise, perform, actual, Sample, slower, Random, Distributed

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 5



More Similar Code

Suppose that you have a signal Y (Y can be a time series, a parametric surface or a volumetric data series) corrupted by a Gaussian noise with unknown variance. It is often of interest to know more about this variance. EVAR(Y) thus returns an estimated variance of the additive noise.

EVAR provides better results if the original function (i.e. the function without noise) is relatively smooth i.e. has continuous derivatives up to some...

User Review for Estimatenoise
- required fields
     

Please enter text on the image