Help needed!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help needed!

Shuangyan Xiong
Hi everyone,

I have a question. Now I am reading the resource code of the package
"ssfcov". The resource code is as following. I cannot find the resource
code of the function "myss2d" anywhere in the package. Can anyone give
me a hint how to find it in the package. Thanks a lot!!bv


 > ssfcov
function (time, x, subject, nbasis = 5, centered = FALSE, noDiag = TRUE)
{
     if (!centered) {
         fit <- smooth.spline(time, x)
         x <- x - fitted(fit)
     }
     gg <- NULL
     for (zz in unique(subject)) {
         if (sum(subject == zz) > 1) {
             tt <- time[subject == zz]
             xx <- x[subject == zz]
             g <- expand.grid(t1 = tt, t2 = tt)
             scov <- xx %*% t(xx)
             if (noDiag)
                 scov <- scov + diag(rep(Inf, length(xx)))
             g$z <- matrix(scov, ncol = 1)
             gg <- rbind(gg, g[g$z < Inf, ])
         }
     }
     nobs <- nrow(gg)
     tt <- min(time) + (max(time) - min(time)) * (1:nbasis)/(nbasis +
         1)
     g <- expand.grid(t1 = tt, t2 = tt)
     g$z <- 0
     gg <- rbind(gg, g)
     fit <- myss2d(z ~ t1 * t2, data = gg, id.basis = ((nobs +
         1):(nobs + nbasis * nbasis)))
     class(fit) <- "rfcovObj"
     return(fit)
}
<environment: namespace:ssfcov>


Best,
Shuangyan
 >

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help needed!

Peter Ehlers
On 2011-04-20 14:33, Shuangyan Xiong wrote:

> Hi everyone,
>
> I have a question. Now I am reading the resource code of the package
> "ssfcov". The resource code is as following. I cannot find the resource
> code of the function "myss2d" anywhere in the package. Can anyone give
> me a hint how to find it in the package. Thanks a lot!!bv
>
>
>   >  ssfcov
> function (time, x, subject, nbasis = 5, centered = FALSE, noDiag = TRUE)
> {
>       if (!centered) {
>           fit<- smooth.spline(time, x)
>           x<- x - fitted(fit)
>       }
>       gg<- NULL
>       for (zz in unique(subject)) {
>           if (sum(subject == zz)>  1) {
>               tt<- time[subject == zz]
>               xx<- x[subject == zz]
>               g<- expand.grid(t1 = tt, t2 = tt)
>               scov<- xx %*% t(xx)
>               if (noDiag)
>                   scov<- scov + diag(rep(Inf, length(xx)))
>               g$z<- matrix(scov, ncol = 1)
>               gg<- rbind(gg, g[g$z<  Inf, ])
>           }
>       }
>       nobs<- nrow(gg)
>       tt<- min(time) + (max(time) - min(time)) * (1:nbasis)/(nbasis +
>           1)
>       g<- expand.grid(t1 = tt, t2 = tt)
>       g$z<- 0
>       gg<- rbind(gg, g)
>       fit<- myss2d(z ~ t1 * t2, data = gg, id.basis = ((nobs +
>           1):(nobs + nbasis * nbasis)))
>       class(fit)<- "rfcovObj"
>       return(fit)
> }
> <environment: namespace:ssfcov>

Maybe I'm just slow tonight, but where did you get
that package? I can't see on CRAN or R-Forge.

You might also consider a more informative subject
line. "Help needed" is true for all questions (not
answers) on R-help. Just think, why is this list
called R-***help***?

Peter Ehlers

>
>
> Best,
> Shuangyan
>   >
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help needed!

shuangyan
Hello, i got this package from the paper:" Nonparametric Covariance Function estimation for Functional and Longitudinal data". http://stat.wharton.upenn.edu/~tcai/paper/html/Covariance-Function.html.
Thanks lot!
Reply | Threaded
Open this post in threaded view
|

Re: package ssfcov and non-visible functions; was: Help needed!

Uwe Ligges-3


On 25.04.2011 20:05, shuangyan wrote:
> Hello, i got this package from the paper:" Nonparametric Covariance Function
> estimation for Functional and Longitudinal data".
> http://stat.wharton.upenn.edu/~tcai/paper/html/Covariance-Function.html.
> Thanks lot!

0. Please do read the posting guide!!! This includes knowing that you
should use a sensible subject lines in your messages to R-help.

1. Please quote the original thread, otherwise it is really hard to
follow for mailing list readers like me.

2. Please tell the authors of the package to provide it in source form.
Non-Windows users and non R-2.11.0 users may get problems with that
package (since it is a Windows binary package built with R-2.11.0).

3. For your original question: the package has a NAMESPACE and myss2d is
hidden (i.e.not exported from the NAMESPACE). To acess it either type
ssfcov:::myss2d  or if you really do not know: getAnywhere("myss2d").

Uwe Ligges





> --
> View this message in context: http://r.789695.n4.nabble.com/Help-needed-tp3464470p3473745.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.