Closed certifiedwaif closed 9 years ago
Seems to be a false alarm.
markg@markg-OptiPlex-9020:~$ cd phd/code
markg@markg-OptiPlex-9020:~/phd/code$ R
R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Previously saved workspace restored]
> source("splines.R")
> n <- 100
> vx <- matrix(sort(runif(n, -pi / 2, pi / 2)))
> numIntKnots <- 10
> intKnots <- quantile(unique(vx), seq(0, 1, length=(numIntKnots + 2))[-c(1, (numIntKnots + 2))])
> mZ <- ZOSull(vx, range.x=c(-1.1 * pi / 2, 1.1 * pi / 2), intKnots=intKnots, drv=0)
Called from: ZOSull(vx, range.x = c(-1.1 * pi/2, 1.1 * pi/2), intKnots = intKnots,
drv = 0)
Browse[1]> c
> warnings()
NULL
warnings() will show warnings from previous runs, which is confusing.
I think perhaps ZOSull is sensitive to the range of its input values? I'll try using numbers more in the range that were used in the O'Sullivan splines paper.
Yes, that seems to be right. I set the range to between 10 and 100, rather than between -pi/2 and pi/2, and Stan is suddenly behaving much better.
Actually, that's not it either. So I'll admit I don't know what the problem is. I don't understand why the same code that fits random slope models perfectly well is unable to fit spline models.
Maybe we can touch base first think tomorrow, if you are free.
From: Mark Greenaway [notifications@github.com] Sent: Tuesday, May 05, 2015 5:52 PM To: certifiedwaif/phd Subject: Re: [phd] Something is going wrong in ZOSull, but it fails silently. The warnings are only visible when you explicitly check for them. (#9)
Actually, that's not it either. So I'll admit I don't know what the problem is.
— Reply to this email directly or view it on GitHubhttps://github.com/certifiedwaif/phd/issues/9#issuecomment-98986070.
I've been trying to get the splines code working for two weeks.
I've thought something was off with the Z matrix for a while. This is very suspect, and I don't believe for a minute that what's currently in the Z matrix is right. Yet I've looked at the relevant code, and don't see what's wrong yet.