---
title: "Higher Partials of fStress. Who Needs Them ?"
author: "Jan de Leeuw"
date: "Version 02, August 06, 2017"
output:
html_document:
keep_md: yes
number_sections: yes
toc: yes
pdf_document:
keep_tex: yes
number_sections: yes
toc: yes
toc_depth: 3
fontsize: 12pt
graphics: yes
bibliography: fStress.bib
abstract: We define *fDistances*, which generalize Euclidean distances, squared distances, and log distances. The least squares loss function to fit fDistances to dissimilarity data is *fStress*. We give formulas and R/C code to compute partial derivatives of orders one to four of fStress, relying heavily on the use of Faà di Bruno's chain rule formula for higher derivatives.
---
---
```{r function_code, echo = FALSE}
dyn.load("fStress.so")
source("fStress.R")
source("check.R")
```
```{r packages, echo = FALSE}
options (digits = 10)
suppressPackageStartupMessages (library (captioner, quietly = TRUE))
figure_nums <- captioner (prefix = "Figure")
```
Note: This is a working paper which will be expanded/updated frequently. All suggestions for improvement are welcome. The directory [gifi.stat.ucla.edu/fStress](http://gifi.stat.ucla.edu/fStress) has a pdf version, the bib file, the complete Rmd file with the code chunks, and the R and C source code.
#Introduction
The multidimensional scaling (MDS) loss function *fStress* (@groenen_deleeuw_mathar_C_95) is defined as
\begin{equation}\label{E:fstress}
\sigma(x):=\mathop{\sum\sum}_{1\leq i