friendmiao

  •  
  • 2007年9月3日
  • 注册于 2007年8月29日
  • 尝试用过

    trellis.device(win.metafile,file,width,height)

    plot

    dev.off()



    但是想同时输出多张plots的时候貌似不可以了

  • [quote]引用第2楼rtist2007-08-31 05:06发表的“”:

    using matrix manipulations directly should be much faster.[/quote]



    The raw data implored from csv.file with huge amount. and i make a loop to explore what i need.



    How can i chage the data.frame to matrix?



    is.data.frame(inter)

    TRUE



    as.matrix(inter)



    is.data.frame(inter)

    TRUE # inter still is a data.frame
  • [quote]引用第5楼谢益辉2007-08-31 16:19发表的“”:

    不好意思,现在才大致明白你的意思。



    你这个问题恐怕不太容易转换为线性模型来做,我觉得应该用非线性模型吧(PMA也作为一个参数一起估计)[/quote]



    谢谢,请问有constrained非线性的mode拟合的packagel吗?
  • [quote]引用第4楼rtist2007-08-31 05:03发表的“”:

    MA is random, if it's a function of data. [/quote]



    Thanks for reply



    pls refer to my quesion at "3-Lou"
  • 确切来说,已知一组数据(R,DMA),来模拟得到PMA

    模型建立为:



    R=exp(A)(DMA-PMA)^4+exp(B)(DMA-PMA)^2+C



    其中R,DMA是已知量,设参数A,B,C,且A,B>0,求PMA



    请大侠指教!
  • 请大侠们指教,是否有运算速度更快的线性拟和语句
  • 谢谢回复,问题没有这么简单MA=min(y),而是通过现有的数据你和一个对称的四次模型来求得模型y最小时的x.
  • 目的:采用y=a(x-MA)^4+b(x-MA)^2+c模型对temp数据进行拟合,求a,b,c,MA(MA是当y最小时的值)

    问题:如何code?



    本人尝试着用lm(y~I(x^2)+I(x^4))但又不会求MA,请达人指教?

    万分感谢?





    temp

    y    x

    20.26008    -0.08

    19.72613    -0.065

    19.501619 -0.05

    18.72662    -0.03

    18.58769    -0.015

    18.592199 0.015

    18.88372    0.03

    19.5453    0.05

    19.88743    0.065

    20.9914    0.08

    18.12336    0
  • 请教有关模型拟合问题:
    <br />
    j<-1<br />
      for(i in unique(merge.data$inter))   <br />
      { <br />
        temp<-merge.data[merge.data$inter==i,c("R","M")]  <br />
        x<-temp$M<br />
        y<-temp$R<br />
        <br />
        temp.lm<-lm(y~x+I(x^2)) #quadratic fit model<br />
     <br />
        a<-coef(temp.lm)[[3]]# Quadratic coefficients<br />
        b<-coef(temp.lm)[[2]]<br />
        c<-coef(temp.lm)[[1]]<br />
        rsq<-summary(temp.lm)$r.squared   <br />
        ma<--b/(2*a)<br />
     <br />
        inter<-strsplit(i,"#")[[1]]<br />
        names(inter)<-c("lot_id","wafer_id","diex","diey","prmod","cellOrientation","implantType","misalignLayer")<br />
        inter<-t(data.frame(inter))<br />
        temp.MA<-data.frame(A=a,B=b,C=c,RSQ=rsq,MA=ma,inter)<br />
     <br />
          for ( k in (1:length(temp$R)))<br />
          {<br />
             temp.mis<-data.frame(temp[k,1])<br />
             names(temp.mis)<-temp[k,2]<br />
             if (k==1) {mis<-temp.mis} else {mis<-cbind(mis,temp.mis)}<br />
          }<br />
        temp.MA<-cbind(mis,temp.MA)    <br />
     <br />
       if (j==1){MA.RAW<-temp.MA} else {MA.RAW<-rbind(MA.RAW,temp.MA)} <br />
      j<-j+1 <br />
     }<br />
    <br />
    




    目的:从merge.data数据框中求当inter为某一值时,提取R和M两列数据,进行一元二项次拟合,求y为最小值时的x值,并且删除rsq小于某值的数据。



    问题:由于原数据量大,需要大约10~15分钟的时间才能算完,请教是否有更加合理的拟合运算?