Skip to content

Commit

Permalink
six files fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
James Ramsay authored and James Ramsay committed Apr 26, 2023
1 parent 7e33622 commit 87c52d7
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 154 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: fda
Version: 6.1.2
Date: 2023-01-31
Version: 6.1.3
Date: 2023-04-24
Title: Functional Data Analysis
Authors@R: c(person("James", "Ramsay",
role=c("aut","cre"),
Expand All @@ -11,7 +11,7 @@ Authors@R: c(person("James", "Ramsay",
person("Spencer", "Graves",
role="ctb",
email="spencer.graves@effectivedefense.org"))
Maintainer: J. O. Ramsay <james.ramsay@mcgill.ca>
Maintainer: James Ramsay <ramsay@psych.mcgill.ca>
Depends: R (>= 3.5), splines, fds, deSolve
Suggests:
rmarkdown,
Expand Down
Binary file removed R/.DS_Store
Binary file not shown.
10 changes: 7 additions & 3 deletions R/eval.surp.R
@@ -1,5 +1,5 @@
eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
# Evaluates a value of a surprisal coordinate functional data object.
# Evaluates a value of a surprisal coordinate functional data object.
# # Evaluates a value or a derivative of a surprisal coordinate functional
# # data object.
# A positive functional data object h is <- the form
Expand All @@ -16,7 +16,7 @@ eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
# Returns: An array of function values corresponding to the
# argument values in EVALARG

# Last modified 24 September 2021 by Jim Ramsay
# Last modified 25 April 2025 by Jim Ramsay

# check arguments

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

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

if (nderiv == 0) {
Smat <- -Xmat + log(SumMXmat)/log(M)
Expand Down Expand Up @@ -115,7 +118,8 @@ eval.surp <- function(evalarg, Wfdobj, nderiv=0) {
matSum <- rowSums(Pmat*DXmat)
Rmat <- matrix(rep(matSum,each=M), ncol=M, byrow=TRUE)
matSum2 <- rowSums((Pmat*(D2Xmat + DXmat^2) - Rmat*DXmat))
D2Smat <- -D2Xmat + matrix(rep(matSum2,each=M), ncol=M, byrow=TRUE)
D2Smat <- -D2Xmat +
matrix(rep(matSum2,each=M), ncol=M, byrow=TRUE)
return(D2Smat)
}
}
Expand Down
1 change: 1 addition & 0 deletions R/smooth.surp.R
Expand Up @@ -84,6 +84,7 @@ smooth.surp <- function(argvals, y, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,

WfdPar <- fdParcheck(WfdPar,M)
Wbasis <- WfdPar$fd$basis

Wnbasis <- Wbasis$nbasis
Wlambda <- WfdPar$lambda
Wpenalty <- eval.penalty(Wbasis, WfdPar$Lfd)
Expand Down
139 changes: 0 additions & 139 deletions data/refinery.R

This file was deleted.

Binary file removed inst/.DS_Store
Binary file not shown.
Binary file removed man/.DS_Store
Binary file not shown.
8 changes: 3 additions & 5 deletions vignettes/BasisBasics.Rmd
@@ -1,5 +1,5 @@
---
title: "BasisBasics"
title: "Introduction to the Basics of FDA"
output: html_document
vignette: >
%\VignetteIndexEntry{BasisBasics}
Expand All @@ -8,10 +8,8 @@ vignette: >
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
system.file(package="fda")
```

```{r setup}
Expand Down
8 changes: 4 additions & 4 deletions vignettes/monotoneFunctions.Rmd
@@ -1,5 +1,5 @@
---
title: "monotoneFunctions"
title: "monotone Functions"
author: "Jim Ramsay"
date: "16/02/2022"
output: html_document
Expand All @@ -11,9 +11,9 @@ vignette: >

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


## R Markdown

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

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

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

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)$.

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

0 comments on commit 87c52d7

Please sign in to comment.