Open
Conversation
Added 'data(WorldBankCO2)' at line 6. Package won't compile without it since the dataset is used later.
Collaborator
|
Emma,
What you did for the confidence interval is correct.
I am a little skeptical of these results but it is due to the means being very regular over the 366 days.
Here is some alternative code I used to check. Also added in different weights reflecting the differing variances across the day of year this helps some
yMean<- ( tapply(dayFlow[,2],x, mean ))
xMean<- as.numeric( names( yMean))
yVar <- tapply(dayFlow[,2], x, var )
N<- as.numeric(table( x))
yVar<- as.numeric(yVar/N)
fit.tps<-Tps(xMean, yMean, weights= 1/yVar)
# a more complicated curve fit
# fit.SP<- spatialProcess(out$xM, out$yM, weights= 1/yVar)
SE <- predictSE(fit.tps, x = 1:366)
fittedValues <- predict(fit.tps, x = 1:366)
ZBvalue <- qnorm(1 - .025/fit.tps$N) #Using Bonferroni Bounds
upperB<- fittedValues + ZBvalue* SE
lowerB<- fittedValues - ZBvalue* SE
bplot.xy(dayFlow[,1], dayFlow[,2], N=20 , main = "Day-Flow with Confidence Intervals", xlab = "DOY", ylab = "Flow")
envelopePlot(c(1:366), y1 = lowerB, y2 = upperB)
#points(dayFlow[,1], dayFlow[,2], cex = 0.5, pch = 19, col = #alpha("black", alpha = 0.2))
lines(c(1:366), fittedValues, col='red', lty=2, lwd=2)
Douglas Nychka
Personal email
Cell 3037253199
From: Emma Lilly <notifications@github.com>
Reply-To: NCAR/fields <reply@reply.github.com>
Date: Wednesday, July 29, 2020 at 11:13 AM
To: NCAR/fields <fields@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [NCAR/fields] Update splines.Rmd (#3)
Added 'data(WorldBankCO2)' at line 6. Package won't compile without it since the dataset is used later.
…________________________________
You can view, comment on, or merge this pull request online at:
#3
Commit Summary
* Update splines.Rmd
File Changes
* M vignette/splines.Rmd<https://github.com/NCAR/fields/pull/3/files#diff-50b6d36c22cb8926d22be04c39129ea0> (1)
Patch Links:
* https://github.com/NCAR/fields/pull/3.patch
* https://github.com/NCAR/fields/pull/3.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#3>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADHJ7U6LBRGJOOU6EE6BL2TR6BKCLANCNFSM4PL2MJOA>.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added 'data(WorldBankCO2)' at line 6. Package won't compile without it since the dataset is used later.