Skip to content

Commit 87c52d7

Browse files
James RamsayJames Ramsay
James Ramsay
authored and
James Ramsay
committed
six files fixed
1 parent 7e33622 commit 87c52d7

File tree

9 files changed

+18
-154
lines changed

9 files changed

+18
-154
lines changed

DESCRIPTION

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: fda
2-
Version: 6.1.2
3-
Date: 2023-01-31
2+
Version: 6.1.3
3+
Date: 2023-04-24
44
Title: Functional Data Analysis
55
Authors@R: c(person("James", "Ramsay",
66
role=c("aut","cre"),
@@ -11,7 +11,7 @@ Authors@R: c(person("James", "Ramsay",
1111
person("Spencer", "Graves",
1212
role="ctb",
1313
email="spencer.graves@effectivedefense.org"))
14-
Maintainer: J. O. Ramsay <james.ramsay@mcgill.ca>
14+
Maintainer: James Ramsay <ramsay@psych.mcgill.ca>
1515
Depends: R (>= 3.5), splines, fds, deSolve
1616
Suggests:
1717
rmarkdown,

R/.DS_Store

-6 KB
Binary file not shown.

R/eval.surp.R

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
2-
# Evaluates a value of a surprisal coordinate functional data object.
2+
# Evaluates a value of a surprisal coordinate functional data object.
33
# # Evaluates a value or a derivative of a surprisal coordinate functional
44
# # data object.
55
# A positive functional data object h is <- the form
@@ -16,7 +16,7 @@ eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
1616
# Returns: An array of function values corresponding to the
1717
# argument values in EVALARG
1818

19-
# Last modified 24 September 2021 by Jim Ramsay
19+
# Last modified 25 April 2025 by Jim Ramsay
2020

2121
# check arguments
2222

@@ -86,6 +86,9 @@ eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
8686
SumMXmat <- matrix(rep(sum0,each=M), ncol=M, byrow=TRUE)
8787

8888
# Case where EVALARG is a vector of values to be used for all curves
89+
# NB: Resist the temptation of use /log(M) anywhere else.
90+
# This code sets up Smat as defined with log basis M, and no further
91+
# definition of log basis is required.
8992

9093
if (nderiv == 0) {
9194
Smat <- -Xmat + log(SumMXmat)/log(M)
@@ -115,7 +118,8 @@ eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
115118
matSum <- rowSums(Pmat*DXmat)
116119
Rmat <- matrix(rep(matSum,each=M), ncol=M, byrow=TRUE)
117120
matSum2 <- rowSums((Pmat*(D2Xmat + DXmat^2) - Rmat*DXmat))
118-
D2Smat <- -D2Xmat + matrix(rep(matSum2,each=M), ncol=M, byrow=TRUE)
121+
D2Smat <- -D2Xmat +
122+
matrix(rep(matSum2,each=M), ncol=M, byrow=TRUE)
119123
return(D2Smat)
120124
}
121125
}

R/smooth.surp.R

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ smooth.surp <- function(argvals, y, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
8484

8585
WfdPar <- fdParcheck(WfdPar,M)
8686
Wbasis <- WfdPar$fd$basis
87+
8788
Wnbasis <- Wbasis$nbasis
8889
Wlambda <- WfdPar$lambda
8990
Wpenalty <- eval.penalty(Wbasis, WfdPar$Lfd)

data/refinery.R

-139
This file was deleted.

inst/.DS_Store

-8 KB
Binary file not shown.

man/.DS_Store

-6 KB
Binary file not shown.

vignettes/BasisBasics.Rmd

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "BasisBasics"
2+
title: "Introduction to the Basics of FDA"
33
output: html_document
44
vignette: >
55
%\VignetteIndexEntry{BasisBasics}
@@ -8,10 +8,8 @@ vignette: >
88
---
99

1010
```{r, include = FALSE}
11-
knitr::opts_chunk$set(
12-
collapse = TRUE,
13-
comment = "#>"
14-
)
11+
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
12+
system.file(package="fda")
1513
```
1614

1715
```{r setup}

vignettes/monotoneFunctions.Rmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "monotoneFunctions"
2+
title: "monotone Functions"
33
author: "Jim Ramsay"
44
date: "16/02/2022"
55
output: html_document
@@ -11,9 +11,9 @@ vignette: >
1111

1212
```{r setup, include=FALSE}
1313
knitr::opts_chunk$set(echo = TRUE)
14+
system.file(package="fda")
1415
```
1516

16-
1717
## R Markdown
1818

1919
Let $x$ be a value of a strictly monotone function $h(x)$. Let $W(x)$ be an arbitrary unconstrained function.
@@ -39,7 +39,7 @@ print(paste("h(2*pi) =",round(hof2pi,2)))
3939

4040
Now display the complete function $h(x)$ from 0 to $2 \pi$ along with $W(x)$.
4141

42-
```{r,fig.height = 7}
42+
```{r,fig.width = 7}
4343
h <- delta*(cumsum(EW) - EW[101]/2)
4444
par(mfcol=c(2,1))
4545
plot(x, W, type="l")
@@ -50,7 +50,7 @@ Notice that, near $W(\pi/2) = 1$, $h$ is increasing the most rapidly, and that w
5050

5151
Often we want $h(x)$ to end up at a fixed point. Let's use 1, for example. Then we simply divide $h(x)$ by $h(2 \pi)$.
5252

53-
```{r,fig.height = 7}
53+
```{r,fig.width = 7}
5454
h <- delta*(cumsum(EW) - EW[101]/2)/hof2pi
5555
par(mfcol=c(2,1))
5656
plot(x, W, type="l")

0 commit comments

Comments
 (0)