[R] Error while using register from fda package

2013-03-27 Thread zoe richards
Hi all,

I think I've run into an error caused by my computer's having too little
computational power, but I'm not sure.  I used the following code to
perform continuous registration on two functional objects:

lambda1 - 10E-2
norder=8
samples-seq(0,780,length=781)
nbasis - length(samples)+norder-2
mybasis-create.bspline.basis(c(0,780),nbasis,norder)
myfdPar-fdPar(mybasis,4,lambda1)
myfd.unemployment - smooth.basis(samples,unemployment.rate,myfdPar)$fd
myfd.unemployment.squared - smooth.basis(samples,unemp.squared,myfdPar)$fd
lambda2-10E-2
myfdPar-fdPar(mybasis,4,lambda2)
myfd.inflation - smooth.basis(samples,inflation.rate,myfdPar,)$fd
myfd.inflation.squared - smooth.basis(samples,inflation.squared,myfdPar)$fd
plot(myfd.inflation)
#register
lambda=1
nbasis=myfd.unemployment$basis$nbasis
ntrial=1
y0fd=mean(myfd.inflation)
yfd=myfd.unemployment
coef0-matrix(0,nbasis,ntrial)
wfd-fd(coef0,mybasis)
wfdPar=fdPar(coef0,2,lambda)
reglist-register.fd(y0fd,yfd,wfdPar,iterlim=10,dbglev=1)

I get the following error after the last command:
Error in matrix(0, length(x), nbaspr) : too many elements specified

Is this error associated with my computer's not having sufficient power to
perform the registration?  I can't think of what else that might be going
on...

Thanks,

Zoe Richards

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] Inverse function using FDA

2013-03-06 Thread zoe richards
Hi,

Does anyone know how (or whether or not it's possible) to output an inverse
of a functional object?  I haven't found a way, but since derivatives etc.
can be computed using the fda package it seems like this should be
possible using this package or another designed for functional data
analysis.

Thanks,
Zoe Richards

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Inverse function using FDA

2013-03-06 Thread zoe richards
I am trying to register unemployment rate and inverse of inflation rate to
investigate the phillips
curvehttp://www.econlib.org/library/Enc/PhillipsCurve.html by
looking at the resulting warping function.




On Wed, Mar 6, 2013 at 5:17 PM, Peter Ehlers ehl...@ucalgary.ca wrote:

 On 2013-03-06 12:54, zoe richards wrote:

 Hi,

 Does anyone know how (or whether or not it's possible) to output an
 inverse
 of a functional object?  I haven't found a way, but since derivatives etc.
 can be computed using the fda package it seems like this should be
 possible using this package or another designed for functional data
 analysis.

 Thanks,
 Zoe Richards


 What does your question mean? Possibly, you could 'invert' a mean
 function, but I have no idea what that would accomplish. Can you
 provide an example of just what you want to do?

 Peter Ehlers



[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] predict.smooth.Pspline function not found

2013-02-27 Thread zoe richards
I have a simple question that irritatingly I haven't been able to figure
out on my own.  It seems that some functions from the Pspline package are
successfully installed while others are not.  The code with which I'm
working is more complicated, but the following highlights my problem.  If I
run the following code

 tt - seq (0,1,length=20)
 xt - tt^3
 fit - smooth.Pspline (tt, xt, norder=3,spar=0.0001, method=1)
 pred- predict.smooth.Pspline (fit, tt, nderiv=0)

I get this error:
Error: could not find function predict.smooth.Pspline 

So it seems like smooth.Pspline is loading but predict.smooth.Pspline
isn't.  Any ideas about why this might be the case?

-Zoe Richards

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] R error: system is computationally singular when building GMM model

2013-01-13 Thread zoe chan

Dear,
I built the generalized method of moments model to estimate the sales rank
in the bookstore using plm package in R.
 
The equation is:
 
data1.gmm - pgmm(dynformula(lnsales_rank ~ ln_price + avg_ham_rate +
avg_spam_rate + num_of_ham+ num_of_spam + ship_code2 +ship_code3
+ship_code4+ ship_code5+ ship_code6 + ship_ code7, lag = list(0, 0, 0,
0,0,0,0,0,0,0,0,0), log =FALSE), data=data, effect = individual, model =
twosteps, transformation = ld,gmm.inst = ~ ln_price, lag.gmm =2)
 
However, error message: Error in solve.default(Reduce(+, A1)) :
  system is computationally singular: reciprocal condition number =
6.36689e-23 shown.
 
I found that skipping one of the ship_code variables (dummy variable) can
generate result. But don't know the reason. 
 
I found some books about using R, but no one can answer me.
 
Please help. Thanks much. 
 
Zoe   
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] How to map new data to the existing cluster assignments in R mclust?

2012-11-24 Thread Zoe
I need to map new data to the existing cluster assignments in R. For
clustering was used mclust. I need to find which cluster the new data belong
to.

Asking for a help :)



--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-map-new-data-to-the-existing-cluster-assignments-in-R-mclust-tp4650702.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


[R] remove from the R mailing list

2010-03-30 Thread zoe zhang
I would like to be removed from the R mailing list.

Thanks.

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] Help with Merge - unexpected loss of factor level

2009-12-16 Thread Zoe van Havre
Hi, Thanks in advance for any advice you can give me, I am very stumped on this 
problem...

I use R every day and consider myself a confident user, but this seems to be an 
elementary problem..

Outline of problem: I am analysing the results of a study on protein expression 
in cancer tissues. I have raw intensities from 2 different types of cancer and 
normal tissue,  which can be taken from several different parts of the cell, as 
well as patient information. Part of the analysis calls for a fold-change 
calculation. In order to do this I am sub-setting the dataset by cancer type, 
merging each cancer dataset with the data from the Normal tissue, then 
calculating fold change for matching individuals and cell section.

The problem is that I have been tracking one factor in particular ('branch', 
values 2 or 3) and once the final merge occurs, the second level of this factor 
seems to disappear in the last dataset, even though it was present before.
See code  output below:

  dim(tma)
  names(tma)
[1] Code   marker cell   tumourAtumourEXP  int  
  stain  tumourPERC branch
 levels(tma$tumourA)
[1] DCIS   LN Metastasis  Normal  
   Primary Invasive Carcinoma
#split into cancer and normal tissue
  tma1-subset(tma, tumourA==Primary Invasive Carcinoma)
   tma2-subset(tma, tumourA==LN Metastasis)
   tmaN-subset(tma, tumourA==Normal)

#size of datasets
 dim(tma1)
[1] 587   9
 dim(tma2)
[1] 323   9
 dim(tmaN)
[1] 142   9

#merge back with normal type
 tma1.1-merge(tmaN, tma1, by=Code)
 tma2.1-merge(tmaN, tma2, by=Code)

#new dimensions (seem excessively large)
 dim(tma1.1)
[1] 2439   17
 dim(tma2.1)
[1] 625  17

#progression of branch: factor in datasets. Note last one where it 
disappears...
 table(tma$branch)

  2   3
450 613
 table(tma1$branch)

  2   3
314 273
 table(tma2$branch)

  2   3
 39 284
 table(tmaN$branch)

 2  3
91 51
 table(tma1.1$branch.x)

   23
1806  633
 table(tma2.1$branch.x)

  3
625


Please, can someone tell me what's going on?

Thanks you very much,
Zoe van Havre

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] Plotting Moa clustering result

2009-11-16 Thread Zoe Hoare
Hi all,

Is
there a way of plotting a 'decision tree' from the results of Mona in
the cluster package. The default bannerplot is not quite what I'm after
- I would like a plot of the binary decision tree.

Thanks
Zoë





__
R-help@r-project.org 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.


[R] Plotting Mona clustering result

2009-11-10 Thread Zoe Hoare
Hi all,

Is there a way of plotting a 'decision tree' from the results of Mona in the 
cluster package. The default bannerplot is not quite what I'm after - I would 
like a plot of the binary decision tree.

Thanks
Zoë



  
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] 3d Scatterplot using rgl

2009-05-11 Thread Zoe Hoare
Hi,
I am trying to plot a 3d scatter plot using the rgl package but am having 
trouble.
I have a matrix containing x, y and z co-ordinates and a fourth element related 
to a count variable. 
I would like to plot the points using plot3d with the sizes of the points 
related to the fourth element in the matrix. Is this possible with plot3d or do 
I need to use something else?

I include a small example of what I am trying to do

 swadt
 A   B  Crun1 run2 run3 run4 run5 run6
  93  96 51  0.1   NA  0.1   NA   NA   NA
  93  97 50  0.3   NA   NA  0.1   NA   NA
  93  98 49  0.1   NA   NA   NA   NA   NA
  94  95 51   NA   NA   NA   NA   NA  0.1
  94 100 46  0.1   NA   NA   NA   NA   NA
  94  96 50  2.1  0.1  1.0  0.7  0.8  0.4
  94  97 49  3.2  0.9  1.9  1.9  1.6  1.6
  94  98 48  0.9   NA  0.3  0.4  0.5  0.1
  95  94 51   NA   NA   NA  0.1  0.1   NA
  95  95 50  3.4  0.7  2.8  2.4  2.9  2.3
  95  96 49 12.5 13.4 13.6 15.0 15.3 17.1
  95  97 48 10.2 10.8  8.9 10.8  8.7  9.3
  95  98 47  1.5   NA  0.9  0.7  0.8  0.1
  96  93 51  0.1   NA   NA   NA   NA   NA

If I use
plot3d(swadt[,1],swadt[,2],swadt[,3],size=swadt[,4])
I get the following error
Error in rgl.numeric(size) : size must be a single numeric value

Is there a way of plotting this?
Thanks
Zoe Hoare


  
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.