17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

570 Chapter 13. Fourier and Spectral Applications<br />

#include "nrutil.h"<br />

void predic(float data[], int ndata, float d[], int m, float future[],<br />

int nfut)<br />

Given data[1..ndata], and given the data’s LP coefficients d[1..m], this routine applies<br />

equation (13.6.11) to predict the next nfut data points, which it returns in the array<br />

future[1..nfut]. Note that the routine references only the last m values of data, asinitial<br />

values for the prediction.<br />

{<br />

int k,j;<br />

float sum,discrp,*reg;<br />

}<br />

reg=vector(1,m);<br />

for (j=1;j

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!