Least Squares by IterationWfit.wpj

Abstract

This document is about a fitting evenly spaced data at distances ri = iR/N to a Fourier sine series at frequencies fm = m/R. Sine transform.docSinetran.htm

(1)

(2)

The left hand parts of (1) and (2) can use any values of f and r, while the right hand parts are restricted to fm=m/R and ri = iR/N. Note that r never quite makes it to R in the sum. This is not the place to worry about the mathematics of this. For h  constant as r  0 and to zero as r  R, the right hand parts of (1) and (2) can be simply regarded as trap rule approximations to the left hand integrals. Be aware however that for large f and r, these approximations produce strange periodicities.

The 3-d version of this can be useful for theoretical considerations

(3)

(4)

The N and L in (3) and (4) are related to but not equal to the R and N in (1) and (2). In the appropriate limits, the h and H in (3) and (4) are the same as those in (1) and (2). This will be used below.

Introduction

The function h is to be approximated by

(5)

The integral in (5) is a 3-d convoution integral. Direct evaluation of this is detailed in Convolution in 3d.doc. In this document c and hA are functions of |r| which reduces the integrals to one dimensional integrals as detailed in Sine transform.doc. In transform space ConvDetail.doc. In addition, we are using the grid fm=m/R and ri = iR/N to reduce the transform integrals to the sum forms in (1) and (2). The function c(r) is a short range function c(ri) = 0 for ri > r0 or i < i0.

(6)

or

(7)

or

(8)

Where c. The values of c(ri) for r < r0 are to be determined by minimizing.

(9)

Or equivalently

(10)

In general im > i0 so that the values of c are determined. Newton-Raphson minimization of 2 with respect to c requires accurate first derivatives of hA with respect to c Extremal.htm.doc. Derivatives of h.doc discusses finding the first derivatives with respect to k = c(rk).

(11)

Or

(12)

First Derivative array

Using the (9) form

(13)

Then use the (12) form for the partial of hA with respect to k

(14)

Evaluate the sum on r first to form

(15)

Note that this sum is not over all N

or

(16)

So that

(17)

Noting that the functions depend on |f| alone. Switch to the spherical coordinate representation

(18)

Then from Derivatives of h.doc

(19)

This is the sin transform of

(20)

Second Derivative array

Using the equation (12) form, an approximate second derivative array is

(21)

Substituting (12) into (21)

(22)

Replace wi by <w> and evaluate the sum over r first

(23)

Switch to spherical coordinates

(24)

Inserting the partial of H values

(25)

Then the partial of C values

(26)

Simplify

(27)

This is a decided maximum for k = k', thus the matrix is nearly orthogonal.

(28)

Change in alpha

(29)

Or

(30)