FORCinel: An improved algorithm for calculating first-order reversal curve distributions using locally weighted regression smoothing



[1] We describe a modification to existing algorithms for the calculation of first-order reversal curve (FORC) diagrams using locally weighted regression smoothing (often referred to as “LOESS” smoothing). The new algorithm offers several advantages over current methods: (1) it allows the FORC distribution to be calculated using a constant smoothing factor all the way to the Hc = 0 axis; (2) noninteger values of the smoothing factor can be specified, enabling finer control over the degree of smoothing and the development of a graphical method for automated selection of the optimum smoothing factor; (3) it performs automated extrapolation across gaps or undefined regions of FORC space. This has two applications: first, bad curves or outlying data points caused by instrumental instabilities can be removed from the data, eliminating artifacts from the final FORC diagram; second, specific regions of interest in the FORC measurement can be masked out in order to investigate their contribution to the final FORC diagram. The new algorithm forms the basis of FORCinel, a new user-friendly suite of FORC analysis tools with graphical user interface.

1. Introduction

[2] Hysteresis loops are a ubiquitous characterization tool in rock magnetism and paleomagnetism. Although hysteresis parameters such as coercivity (Hc), coercivity of remanence (Hcr), saturation magnetization (Ms), and saturation remanence (Mrs) are undeniably useful, they represent bulk sample averages and provide little information about the distribution of coercivities and interaction fields that exist at the nanometer scale. First-order reversal curve (FORC) diagrams are an advanced hysteresis tool based on data sampled from the entire area enclosed by a major hysteresis loop and represent one of the most efficient methods for measuring these distributions [Hejda and Zelinka, 1990; Pike et al., 1999]. Significant progress has been made recently in the theoretical understanding and modeling of FORC diagrams. Quantitative models for noninteracting and interacting SD particles have been developed by Newell [2005] and Egli [2006], respectively. The first application of these models is discussed by Chen et al. [2007]. Such information is becoming increasingly valuable to researchers seeking to identify and “unmix” magnetic components within individual samples [Muxworthy et al., 2005], preselect samples for paleointensity studies [Wehland et al., 2005; Carvallo et al., 2006], determine magnetic domain states [Acton et al., 2007a, 2007b], and distinguish different mineral phases [Roberts et al., 2006].

[3] In this technical brief we present a new FORC processing package called FORCinel, based on a new smoothing algorithm that offers several advantages over existing methods. FORCinel is a suite of functions with a graphical user interface written using Igor Pro by Wavemetrics. The software can be downloaded from three different servers: The Institute for Rock Magnetism (, the University of Cambridge (∼rjh40/forcinel), and ( is a data center with a longstanding commitment to the rock magnetic and paleomagnetic communities and will maintain a FORCinel download site independent of the authors. A fully functional demo version of Igor Pro for Macintosh and Windows can be downloaded from

2. Conventional FORC Processing

[4] The FORC technique was brought to the attention of the rock magnetic community by Hejda and Zelinka [1990] and Pike et al. [1999] and was made possible by the advent of automated vibrating-sample and alternating-gradient magnetometers, which are capable of collecting thousands of data points in a few hours or less. Despite the technique's relatively recent development, the FORC method has its intellectual origins in Preisach theory developed in the 1930s [Preisach, 1935].

[5] The process by which a FORC diagram is produced is shown schematically in Figure 1. Each FORC measurement begins by saturating the sample in a positive field. The external field is then decreased to some value, Ha (the reversal field), and the magnetization of the sample is measured as a function of increasing field, Hb, until positive saturation is reached again. A large number of FORCs are acquired for different reversal fields, in order to sample the entire area enclosed by a major hysteresis loop (Figure 1b). Values of Ha and Hb are chosen to cover a regular grid in HaHb space, resulting in a magnetization matrix, M(Ha, Hb) (Figure 1c). The FORC distribution is defined as the mixed second derivative of M(Ha, Hb) with respect to Ha and Hb:

equation image

Normally a new set of coordinates are defined, Hc = (HaHb)/2 and Hu = (Ha + Hb)/2, which serves to rotate the FORC distribution counterclockwise by 45° (Figure 1c). The final FORC diagram (Figure 1d) is a contour plot of ρ(Ha, Hb), with Hc and Hu on the horizontal and vertical axes, respectively.

Figure 1.

Introduction to the first-order reversal curve (FORC) technique. (a) Definition of a FORC. (b) A set of FORCs from a single crystal of clinopyroxene containing magnetite-ulvöspinel inclusions (characterized by Feinberg et al. [2005]). (c) Matrix of Ha and Hb values used to measure magnetization during a typical FORC measurement. FORC diagrams are usually presented using a rotated set of axes Hu and Hc, covering the area of Ha-Hb space defined by the pink rectangle. The blue square represents the region of Ha-Hb space used to fit equation (2) to M(Ha, Hb) about a point P (SF = 2). (d) FORC diagram derived from the curves in Figure 1b.

[6] In order to calculate the FORC distribution at any point P, a least squares fit to M(Ha, Hb) is performed over a square grid of points surrounding P. The most common method is that used by Pike et al. [1999], whereby the magnetization is fitted using a second-order polynomial function:

equation image

The value of the FORC distribution at P is then equal to −a6. The size of the square grid is determined by a smoothing factor, SF, such that the grid extends over (2SF + 1)2 points in the HaHb plane. An increase in SF leads to increased smoothing of the FORC diagram. While some smoothing is necessary to reduce experimental noise, too much smoothing may unduly affect the form of the distribution. Heslop and Muxworthy [2005] describe a numerical test, based on examination of the autocorrelation function of the residual of the observed and fitted values of M(Ha, Hb), to determine the optimum value of SF. The optimum value depends on the resolution of the M(Ha, Hb) matrix, but values in the range 2–5 are typically employed. Because the M(Ha, Hb) matrix does not extend to the Hc < 0 region, increasing SF leads to an increase in the number of points close to the Hc= 0 axis that must be extrapolated [Carvallo et al., 2005]. One method that is commonly employed is the “extended” FORC formalism of Pike [2003], whereby M(Ha, Hb < Ha) = M(Ha, Hb = Ha) in the undefined region of FORC space. The use of extended FORCs ensures that the total magnetization of the sample (obtained by integrating the FORC distribution over all of FORC space) coincides with the saturation magnetization, Ms. Calculating the second derivative of an extended FORC matrix results in a “reversible ridge” on the Hc = 0 axis, which represents the contribution from purely reversible magnetization processes. Although the reversible ridge is theoretically defined only for Hc = 0, current FORC processing algorithms can, in some cases, cause the ridge to unreasonably influence the irreversible (Hc > 0) part of the FORC diagram, obscuring the low-coercivity region and leading to unwanted artifacts (Figure 3).

3. Locally Weighted Polynomial Regression Method (“LOESS” Smoothing)

[7] The locally weighted regression smoothing technique, often referred to as “LOESS,” was first proposed by Cleveland [1979] and later refined by Cleveland and Devlin [1988]. Like conventional FORC smoothing algorithms, LOESS fits a second-order polynomial function to the measured magnetization surface over a specified area in FORC space. LOESS differs from the conventional smoothing algorithms in two important ways (Figure 2). The area of FORC space used for fitting is defined as a region of arbitrary shape encompassing a user-defined number of nearest-neighbor data points, rather than a rigid square grid of points whose number is limited by the (2SF + 1)2 rule. This region may be centered on and/or span across gaps or undefined regions of FORC space. The degree of smoothing is specified in the LOESS algorithm by a factor α:

equation image

where SF′ is an effective smoothing factor and Nobs is the number of magnetization measurements in the M(Ha, Hb) matrix. The number of measurements included in the fit region, N, is:

equation image

where Ntot is the total number of elements in the M(Ha, Hb) matrix (including those elements that are undefined, i.e., for Hb < Ha, and any elements that have been manually masked out prior to processing). In short, α is the fraction of Ntot being used in a localized fit. For convenience, the degree of smoothing in FORCinel is specified using the effective smoothing factor SF', allowing comparison with the parameter SF used by conventional FORC algorithms. A key difference, however, is that SF' is not constrained to be an integer, giving the user much finer control over the degree of smoothing. For simplicity we refer to the effective smoothing factor SF' simply as SF from now on. The measurements inside the fit region are given a weight that depends on the distance of each measurement from the point where the FORC function is being evaluated: measurements closer to the point being evaluated have higher weights and have a greater effect on the fit [see also Postolache et al., 2003; Clime et al., 2004]. Measurements are weighted using a “tricube” function [Cleveland, 1979]:

equation image

where equation image defines the position where the FORC function is to be evaluated, equation image defines the position of the measurement point, and max|equation imageequation image| is the maximum Euclidean distance between an evaluation point and the measurement point within the fit region. The advantages of the LOESS technique to the FORC method, as well as several additional useful features of FORCinel, are discussed in detail below.

Figure 2.

Comparison of FORC smoothing methods. (left) The conventional approach, where the smoothing factor is N = 9 (SF = 1) and all points are weighted equally. (right) The locally weighted regression smoothing (“LOESS”) approach, where the smoothing factor is also N = 9 but points are weighted on the basis of their proximity to the point where the FORC distribution is being calculated (equation (5)).

4. Applications

4.1. FORC Distribution at Hc = 0

[8] Because the fitting region may be centered on and/or span across gaps or undefined regions of FORC space, the FORC distribution can be calculated at constant smoothing factor all the way to the Hc = 0. Since M(Ha, Hb) is undefined for Hb < Ha, a circular fitting region centered on a point close to the Hc = 0 axis would contain fewer than the specified number of points (N; equation (4)). In this case, the fitting region is automatically expanded to include more measurements with Hb > Ha. Inevitably this leads to the center of the fitting region being displaced from the point of interest along the positive Hc axis. Using the conventional smoothing algorithm this shift may introduce unwanted bias into the fitted surface. In the LOESS method, however, such bias is significantly reduced by the use of the tricube weighting function (equation (5)), which de-emphasizes the contribution from points that are far away from the point of interest and enhances the contribution from those points that are close to the point of interest, hence minimizing the shift of the center of mass of the fit region.

[9] A typical example is shown in Figure 3. The sample is an ocean basalt sample from Ocean Drilling Program Leg 206 Site 1256 measured by Chris Scudder (downloaded from FORCopedia at Figure 3a shows the second derivative of the raw FORC data with no smoothing. Despite the high level of noise, the basic features of the FORC diagram are visible: a closed set of contours with significant horizontal and vertical spread, indicating single-domain behavior with a distribution of coercivities and interaction fields. Figure 3b shows an optimized FORC diagram produced using FORCinel (SF = 2.75), which plots all the way to the Hc = 0 axis and reproduces only those features that are observed in the raw data. Note, in particular, the well defined nature of the negative peak at Hc = 0, Hu = −30 mT, which is consistent with the exact theory for single-domain particles [Newell, 2005]. Figures 3c and 3d show FORC diagrams produced using FORCIT ( and FORClab [Winklhofer and Zimanyi, 2006] software, respectively. Both have been processed using the extended FORC formalism and hence produce the expected reversible ridge on the Hc = 0 axis. Figure 3c shows significant interaction between the ridge and the irreversible part of the FORC diagram, leading to features in the final FORC diagram at Hc > 0 that are not present in the raw data. In Figure 3d, the reversible ridge is properly confined to the Hc = 0 axis and the irreversible part of the FORC diagram is very close to the raw data. However, the presence of the ridge does produce some vertical spreading of the contours at low coercivities (indicated by the arrows in Figure 3d) that is not visible in the raw data, and the negative peak at Hc = 0, Hu = −30 mT is obscured by the ridge. The improved processing at the Hc = 0 axis provided by the LOESS method enhances the FORC technique's sensitivity to the presence of viscous and multidomain grains, both of which produce real signals close to the Hc = 0 axis that are often obscured by the reversible ridge [Pike et al., 2001a, 2001b].

Figure 3.

Comparison of FORC data processed using different algorithms. Data are from an ocean basalt sample (FORCopedia at (a) The second derivative of the raw data with no smoothing. (b) FORC diagram produced using FORCinel with the optimum smoothing factor SF = 2.75. (c) FORC diagram produced using FORCIT ( There is significant interaction between the reversible ridge and the irreversible part of the FORC diagram, leading to features that are not present in the raw data. (d) FORC diagram produced using FORClab [Winklhofer and Zimanyi, 2006]. Arrows indicate vertical spreading of contours caused by the reversible ridge at low coercivities that is not visible in the raw data. Figures 3b, 3c, and 3d all use different smoothing algorithms which are approximately equivalent to conventional SF values between 2 and 3.

4.2. Data Masking

[10] Because of its nearest neighbor approach to smoothing, the LOESS technique allows FORC distributions to be extrapolated across gaps in the data. By contrast, conventional FORC processing requires a regular grid of points. Thus, LOESS smoothing allows users to remove anomalous points and curves from the original data set. This additional flexibility to mask outlying data points caused by instrumental instabilities allows users to reduce artifacts in the final FORC diagram. Alternatively, specific regions of interest in the FORC measurement can be masked out in order to investigate their contribution to the final FORC diagram.

[11] An example of such data masking is shown in Figure 4. The data in this example are from a micromagnetic simulation of pseudo-single domain reversal in a 150 nm magnetite cube, calculated using “LLG Micromagnetics Simulator” (M. R. Scheinfein, 1997; available at Three FORCs show different behavior relating to a switch from vortex to single domain states (asterisks (*)). Removing these three curves from the data leads to the suppression of two negative (blue) peaks in the final FORC diagram. (Figure 4). A user-friendly graphical interface to allow the masking of outlying points, curves, or regions of FORC space is included in FORCinel.

Figure 4.

Selective data masking in FORCinel. (a) A micromagnetic simulation of a FORC measurement for a 150 nm magnetite cube. Three FORCs show anomalous behavior relating to a switch from vortex to single domain states (asterisks (*)). The calculation was performed using an FFT approach with 30 × 30 × 30 resolution and values of Ms = 480 kA/m, K1 = −1.25 × 104 J/m3, and A = 1.32 × 10−11 J/m. (b) Image plot of the raw M(Ha, Hb) matrix derived from Figure 4a. (c) Same as Figure 4b but with the three anomalous curve removed. (d and e) The LOESS smoothed surfaces that correspond to Figures 4b and 4c, respectively. (f and g) The resulting FORC diagrams from Figures 4d and 4, respectively. Removal of the anomalous curves suppresses two negative (blue) peaks in the final FORC diagram.

4.3. Optimum Smoothing

[12] Since the size of the LOESS smoothing window is not restricted to a square number, the degree of smoothing can be controlled more finely than with the conventional algorithm. This increased sensitivity allows a more detailed examination of the effect of smoothing on the final FORC diagram. The residuals of a FORC diagram can be calculated by finding the difference between the observed magnetization and the smoothed magnetization surface. Figure 5 compares the residuals of smoothing factor values 3 and 6 on a FORC measurement of single crystal of plagioclase containing magnetite needles. The distribution of residual values for SF = 3 is more uniform than that of SF = 6, which indicates that SF = 3 is more successful at removing measurement noise. The N-S and NW-SE linear traces in Figure 5b suggest that oversmoothing has begun to remove real signal.

Figure 5.

Residual plots of observed minus smoothed values of the M(Ha, Hb) matrix. The distribution of residual values in Figure 5a is more uniform than in Figure 5b, indicating that the smoothing process is removing noise. In Figure 5b it is clear that oversmoothing has begun to remove real data.

[13] This interpretation of the residuals forms the basis for a new method of finding the optimal smoothing factor for a FORC diagram. Figure 6a shows a plot of the standard deviation of the residual, σr, as a function of the smoothing factor. When there is no smoothing σr = 0, as the observed and fitted magnetization surfaces are identical. When the smoothing factor is gently increased, σr increases rapidly as the noise in the experimental data is eliminated. The optimal degree of smoothing is reached when noise is removed without biasing the fit to the underlying surface. This corresponds to a minimum in ∂σr/∂SF (Figure 6b). Beyond the optimum smoothing factor, ∂σr/∂SF rises once more due to increasing bias in the fit to the magnetization surface. This bias is revealed by the presence of distinct features in the residual plot (Figure 5b).

Figure 6.

Smoothing factor optimization. (a) The standard deviation of the residual between the measured FORC data and the smoothed surface as a function of smoothing factor. The initial slope is due to the successful removal of measurement noise, whereas the increase in the residuals' standard deviation after the inflection point is due to the removal of magnetic signal. (b) The derivative of Figure 6a, where the minimum indicates the optimum smoothing factor.

[14] A reasonable empirical estimate of the optimum smoothing factor is obtained by calculating the position of the minimum in the ∂σr/∂SF curve (Figure 6b). This optimum smoothing approach is included as an option in the graphical user interface of FORCinel. In many cases, manual inspection of the residual derivative plot provides a useful guide to optimizing the degree of smoothing. In the case of weakly magnetic samples with a low signal-to-noise ratio, the residual derivative plot is often very flat, indicating that it is safe to use a range of smoothing factors centered around the minimum in ∂σr/∂SF. In the example of the magnetite-bearing plagioclase, the minimum is indeed rather flat, indicating that optimal values of SF between 2.5 and 4 are acceptable. The preferred value may depend on the specific application; for quantification purposes one should aim to use the minimum SF within the optimal range, whereas for simple display purposes one might prefer to use the maximum SF within the optimal range. A comparison of three differently smoothed FORC diagrams is shown in Figure 7. The FORC diagram in Figure 7a was produced using SF = 2, and shows an undersmoothed distribution dominated by noise. In contrast, a smoothing factor of 8 (Figure 7c) produces an oversmoothed distribution with exaggerated dispersion along the Hu axis and a truncated coercivity spectrum along the Hc axis. The FORC diagram produced using the optimal smoothing factor (SF = 3) is shown in Figure 7b. This distribution minimizes the experimental noise, while preserving the measured interaction fields and coercivity spectrum.

Figure 7.

Smoothing effects on LOESS smoothed FORC distributions for the experiment shown in Figures 5 and 6. Figures 7a, 7b, and 7c correspond to smoothing factors 2, 3, and 8, respectively. Undersmoothing produces a distribution that is dominated by noise (Figure 7a). Oversmoothing produces a distribution with exaggerated positive and negative interactions and a truncated coercivity spectrum (Figure 7c). Using the optimization routine described in Figure 6, the ideal FORC distribution is SF = 3.

[15] Figure 8 demonstrates undersmoothing and oversmoothing in a sample with a lower signal-to-noise ratio, in this example a natural sample of pure hematite from the Gower Peninsula, South Wales. Figure 8a shows the derivative of the standard deviation's residual, which shows a broader minima than the magnetite sample discussed in Figure 6. The optimum smoothing factor value is between 3 and 6. The FORC distribution at SF = 2 is dominated by noise, just as in the example shown in Figure 7. When a more optimal smoothing factor of SF = 6 is chosen (Figure 8c), the FORC distribution displays many of the classic features of hematite FORCs: a peak negatively offset from the Hu = 0 axis, a curvilinear “boomerang” shape to the overall FORC distribution, as well as the presence of highly coercive (Hc > 4000 Oe), noninteracting grains along the Hu = 0 axis. If too high a smoothing factor is chosen (Figure 8d), then many of these features become muted. The unnecessarily high smoothing factor in Figure 8d nearly obscures the presence of the highly coercive, noninteracting grains.

Figure 8.

Smoothing effects on LOESS smoothed FORC distributions for a natural sample of pure hematite. In Figure 8a, optimum smoothing range is shown in green. Figures 8b, 8c, and 8d correspond to smoothing factors 2, 6, and 10, respectively. Undersmoothing produces a distribution that is dominated by noise (Figure 8b). Oversmoothing produces a distribution that obscures the presence of noninteracting grains along Hu = 0 (Figure 8d). Using the optimization routine described in Figure 5, the ideal FORC distribution is SF = 6.

4.4. Additional Features of FORCinel

[16] FORCinel includes a number of additional standard features that aid in the interpretation of FORC diagrams. Users can choose to plot horizontal or vertical profiles along specified Hc or Hu values. The marginal coercivity distribution, defined as [Winklhofer and Zimanyi, 2006]:

equation image

and the normalized FORC distribution defined as [Egli, 2006]:

equation image

can be rapidly plotted for those researchers interested in unmixing magnetic components. In case of weak samples, profiles of the FORC function can be very noisy. FORCinel provides an option to plot the “average” of several profiles given by:

equation image

Plots of measurement drift, and even the reversible ridge can be readily produced with the click of a mouse. More basic features such as the addition of contours and color scales are also included. All of these options are controlled by the user through a simple pull down menu in the graphical user interface of FORCinel.

[17] FORCinel reads data files taken directly from Princeton Measurements vibrating sample magnetometers (VSMs) and alternating gradient magnetometers (AGMs). Step-by-step instructions for loading data files and processing FORC diagrams are available at the Institute for Rock Magnetism Web site ( and the Web site of RJH (∼rjh40/forcinel/). This software is also being made publicly available to researchers in the rock magnetic and paleomagnetic communities through (, which is a Web site funded by the National Science Foundation dedicated to hosting Earth Science reference data and models.

5. Conclusions

[18] First-order reversal diagrams are powerful diagnostic tools for rock magnetic and paleomagnetic studies and ought to be accessible to as wide a cross-section of the research community as possible. FORCinel is an inexpensive, cross-platform software package that is controlled using a simple graphical user interface. Publication quality FORC diagrams can be produced without the need for any additional programming skills. The incorporation of the LOESS smoothing technique into the FORC processing algorithm allows for automated extrapolation across gaps or undefined regions of FORC space, which leads to two important applications: (1) anomalous curves or outlying data points caused by instrumental instabilities can be removed from the data, eliminating artifacts from the final FORC diagram; (2) specific regions of interest in the FORC measurement can be masked out in order to investigate their contribution to the final FORC diagram. A new smoothing factor optimization routine is also included in FORCinel.


[19] This research was supported by a NERC Advanced Fellowship (NE/B501339/1 “Mineral magnetism at the nanometre scale” to R.J.H.) and a NERC Postdoctoral Fellowship (NE/C518422/1 “Silicate Hosted Magnetic Inclusions as Paleomagnetic Recorders” to J.M.F.), and by the European Science Foundation (ESF) under the EUROCORES program EuroMinScI, through contract ERAS-CT-2003-980409 of the European Commission, DG Research, FP6. Micromagnetic simulations used in Figure 4 were performed by Leila Rimmer under the supervision of R.J.H. The authors appreciate thoughtful reviews by Adrian Muxworthy and one anonymous reviewer. The hematite sample used to produce Figure 8 was kindly provided by V. Wright.