Displaying 3 results from an estimated 3 matches for "predint".
Did you mean:
predict
2023 Nov 06
2
understanding predict.lm
...fit = TRUE)
pred.w.clim <- predict(lm(y ~ x), new, interval = "confidence",
se.fit = TRUE)
(z.confInt <- with(pred.w.clim, (fit[,3]-fit[,2])/se.fit))
pnorm(-z.confInt/2)
s.pred <- sqrt(with(pred.w.plim,
se.fit^2+residual.scale^2))
(z.predInt <- with(pred.w.plim, (fit[,3]-fit[,2])/s.pred))
pnorm(-z.predInt/2)
** This gives me 0.01537207. I do not understand why it's not 0.025
with level = 0.95.
Can someone help me understand this?
Thanks,
Spencer Graves
2017 Jul 23
1
BayesianTools update prior
...missing values and NaN's not allowed if 'na.rm' is FALSE"
The error appears to come from the function getPredictiveIntervals, specifically the lines:
for (i in 1:nrow(predDistr)) {
predDistr[i, ] = error(mean = pred[i, ], par = parMatrix[i,
])
}
predInt = getCredibleIntervals(sampleMatrix = predDistr,
quantiles = quantiles)
I suspect lower and upper bounds on the parameters are not being enforced leading to a negative standard deviation being passed to rnorm?.
Any suggestions on how to proceed would be welcome.
Code:
#run the example...
2023 Nov 06
0
understanding predict.lm
...h correct df, not the standard-normal
> distribution:
>
> > pt(-z.confInt/2, df=13)
> ??? 1???? 2???? 3???? 4???? 5???? 6???? 7???? 8???? 9??? 10??? 11
> 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025
> ?? 12??? 13
> 0.025 0.025
>
> > pt(-z.predInt/2, df=13)
> ??? 1???? 2???? 3???? 4???? 5???? 6???? 7???? 8???? 9??? 10??? 11
> 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025
> ?? 12??? 13
> 0.025 0.025
>
> I hope this helps,
> ?John