Commit 5a48436b authored by agebhard's avatar agebhard
Browse files

DEC cc ...

parent 7a689a35
library(baykrig)
library(baykrig)
leman.bk<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.mod.obj = leman.88.vmsph, xsw=min(leman.bank$x),ysw=min(leman.bank$y), xne=max(leman.bank$x), yne=max(leman.bank$y), nx=100, ny=100, trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
library(baykrig)
leman.bk<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.mod.obj = leman.88.vmsph, xsw=min(leman.bank$x),ysw=min(leman.bank$y), xne=max(leman.bank$x), yne=max(leman.bank$y), nx=100, ny=100, trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
library(baykrig)
library(baykrig)
leman.bk<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.mod.obj = leman.88.vmsph, xsw=min(leman.bank$x),ysw=min(leman.bank$y), xne=max(leman.bank$x), yne=max(leman.bank$y), nx=100, ny=100, trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean",method="ols")
library(baykrig)
library(baykrig)
......@@ -22,7 +15,6 @@ leman.bk.2<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.
library(baykrig)
leman.bk<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.mod.obj = leman.88.vmsph, xsw=min(leman.bank$x),ysw=min(leman.bank$y), xne=max(leman.bank$x), yne=max(leman.bank$y), nx=10, ny=10, trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
plot(leman.bk)
q()
library(baykrig)
leman.bk<- bk.grid(point = leman.88.pt , at = "cadpbm", prior=leman.prior,var.mod.obj = leman.88.vmsph, xsw=min(leman.bank$x),ysw=min(leman.bank$y), xne=max(leman.bank$x), yne=max(leman.bank$y), nx=50, ny=50, trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
plot(leman.bk)
......@@ -30,3 +22,11 @@ plot(leman.bk,show.snb=T)
plot(leman.bk,show.snb=T,bias=T)
dev.print(file="bias.ps")
q()
library(baykrig)
plot(leman.bk,show.snb=T,bias=T)
ls()
library(baykrig)
leman.bk.pt <- bk.points(point = leman.88.pt , at = "cadpbm", prior=leman.prior, var.mod.obj = leman.88.vmsph, x=c(530,550),y=c(142,147), trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
ls()
library(baykrig)
leman.bk.pt <- bk.points(point = leman.88.pt , at = "cadpbm", prior=leman.prior, var.mod.obj = leman.88.vmsph, x=c(530,550),y=c(142,147), trend=1, rsearch = 10, extrap = F,border=leman.bank, duplicate="mean")
......@@ -44,7 +44,7 @@ void bk_grid(double *xsw,
int *glsmth){
int nz=(*nx)*(*ny), ldcov=(*n), ldc0=(*n),ldphwk=(*ntrend),
ldfwrk=(*n), ldlmbd=(*n), ldkwrk=(*n), // ldcvbt=(*ntrend)*(*ntrend),
ldfwrk=(*n), ldlmbd=(*n), ldkwrk=(*n),
ldcvbt=(*ntrend),
ldclup=(*n),ldcinv=(*n),ldzg=(*nx);
double *covmat, *c0vec, *muwrk, *phiwrk, *beta, errbta,
......@@ -52,8 +52,8 @@ void bk_grid(double *xsw,
*fwork, *fwrk2, *f0work, *dist, *kwork,
*rhswork, *fpwork, *fpfwork, *fpf0wrk, *chlup,
*cminv, *work, *ferr, *berr,
*mu, // *lambda,
cov0; // lambd0
*mu,
cov0;
int *indsnb, *indsnw, *indsrt, *ipiv, *ipvt, *iwork;
......@@ -61,7 +61,7 @@ void bk_grid(double *xsw,
#ifndef TRANSIENT
covmat =Calloc((size_t)(*n)*(*n),double);
c0vec =Calloc((size_t)(*n),double);
muwrk =Calloc((size_t)((*ntrend)*(*npr)),double);
muwrk =Calloc((size_t)(*ntrend),double);
phiwrk =Calloc((size_t)((*ntrend)*(*ntrend)),double);
covbta =Calloc((size_t)((*ntrend)*(*ntrend)),double);
beta =Calloc((size_t)(*ntrend),double);
......@@ -89,11 +89,10 @@ void bk_grid(double *xsw,
berr =Calloc((size_t)(*n),double);
iwork =Calloc((size_t)(3*(*n)),int);
mu =Calloc((size_t)(*ntrend),double);
// lambda =Calloc((size_t)(*n),double);
#else
covmat =(double *) R_alloc((*n)*(*n),sizeof(double));
c0vec =(double *) R_alloc((*n),sizeof(double));
muwrk =(double *) R_alloc((*ntrend)*(*npr),sizeof(double));
muwrk =(double *) R_alloc((*ntrend),sizeof(double));
phiwrk =(double *) R_alloc((*ntrend)*(*ntrend),sizeof(double));
covbta =(double *) R_alloc((*ntrend)*(*ntrend),sizeof(double));
beta =(double *) R_alloc((*ntrend),sizeof(double));
......@@ -121,7 +120,6 @@ void bk_grid(double *xsw,
berr =(double *) R_alloc((*n),sizeof(double));
iwork =(int *) R_alloc(3*(*n),sizeof(int));
mu =(double *) R_alloc((*ntrend),sizeof(double));
// lambda =(double *) R_alloc((*n),sizeof(double));
#endif
F77_CALL(bkgrid)(xsw,
......@@ -211,7 +209,6 @@ void bk_grid(double *xsw,
glsmth);
#ifndef TRANSIENT
// Free(lambda);
Free(mu);
Free(iwork);
Free(berr);
......@@ -232,13 +229,13 @@ void bk_grid(double *xsw,
Free(dist);
Free(f0work);
Free(fwrk2); // crash bei trend=0
Free(fwrk2);
Free(fwork);
Free(zsrnb);
Free(cvsrnb);
Free(dev);
Free(beta);
Free(covbta); // crash bei trend=1
Free(covbta);
Free(phiwrk);
Free(muwrk);
Free(c0vec);
......@@ -247,7 +244,6 @@ void bk_grid(double *xsw,
#else
/*
// free(lambda);
free(mu);
free(iwork);
free(berr);
......
#include <R.h>
#include <Rinternals.h>
// #define TRANSIENT
/* #define TRANSIENT */
void bk_grid(double *xsw,
double *ysw,
......
......@@ -36,7 +36,7 @@ void bk_point(double *xp,
int *glsmth){
int ldcov=(*n), ldc0=(*n),ldphwk=(*ntrend),
ldfwrk=(*n), ldlmbd=(*n), ldkwrk=(*n), // ldcvbt=(*ntrend)*(*ntrend),
ldfwrk=(*n), ldlmbd=(*n), ldkwrk=(*n),
ldcvbt=(*ntrend),
ldclup=(*n),ldcinv=(*n), usesbbt;
double *covmat, *c0vec, *muwrk, *phiwrk, *beta, errbta,
......@@ -44,8 +44,8 @@ void bk_point(double *xp,
*fwork, *fwrk2, *f0work, *dist, *kwork,
*rhswork, *fpwork, *fpfwork, *fpf0wrk, *chlup,
*cminv, *work, *ferr, *berr,
*mu, // *lambda,
cov0; // lambd0
*mu,
cov0;
int *indsnb, *indsnw, *indsrt, *ipiv, *ipvt, *iwork, *inddop, *nap, *snb;
......@@ -55,7 +55,7 @@ void bk_point(double *xp,
#ifndef TRANSIENT
covmat =Calloc((size_t)(*n)*(*n),double);
c0vec =Calloc((size_t)(*n),double);
muwrk =Calloc((size_t)((*ntrend)*(*npr)),double);
muwrk =Calloc((size_t)(*ntrend),double);
phiwrk =Calloc((size_t)((*ntrend)*(*ntrend)),double);
covbta =Calloc((size_t)((*ntrend)*(*ntrend)),double);
beta =Calloc((size_t)(*ntrend),double);
......@@ -85,11 +85,10 @@ void bk_point(double *xp,
berr =Calloc((size_t)(*n),double);
iwork =Calloc((size_t)(3*(*n)),int);
mu =Calloc((size_t)(*ntrend),double);
// lambda =Calloc((size_t)(*n),double);
#else
covmat =(double *) R_alloc((*n)*(*n),sizeof(double));
c0vec =(double *) R_alloc((*n),sizeof(double));
muwrk =(double *) R_alloc((*ntrend)*(*npr),sizeof(double));
muwrk =(double *) R_alloc((*ntrend),sizeof(double));
phiwrk =(double *) R_alloc((*ntrend)*(*ntrend),sizeof(double));
covbta =(double *) R_alloc((*ntrend)*(*ntrend),sizeof(double));
beta =(double *) R_alloc((*ntrend),sizeof(double));
......@@ -118,13 +117,12 @@ void bk_point(double *xp,
berr =(double *) R_alloc((*n),sizeof(double));
iwork =(int *) R_alloc(3*(*n),sizeof(int));
mu =(double *) R_alloc((*ntrend),sizeof(double));
// lambda =(double *) R_alloc((*n),sizeof(double));
#endif
F77_CALL(bk)(xp,
yp,
dop,
inddop, //
inddop,
np,
lon,
lat,
......@@ -135,7 +133,7 @@ void bk_point(double *xp,
covmat,
&ldcov,
c0vec,
n, //
n,
&cov0,
trend,
ntrend,
......@@ -166,7 +164,7 @@ void bk_point(double *xp,
fwrk2,
&ldfwrk,
f0work,
ntrend, //
ntrend,
dist,
indsnb,
indsnw,
......@@ -190,20 +188,19 @@ void bk_point(double *xp,
iwork,
mode,
mu,
ntrend, //
ntrend,
zp,
nap, //
nap,
lambda,
&ldlmbd,
lambd0,
varp,
searchnb, //
&usesbbt, //
searchnb,
&usesbbt,
ierr,
glsmth);
#ifndef TRANSIENT
// Free(lambda);
Free(mu);
Free(iwork);
Free(berr);
......@@ -226,13 +223,13 @@ void bk_point(double *xp,
Free(dist);
Free(f0work);
Free(fwrk2); // crash bei trend=0
Free(fwrk2);
Free(fwork);
Free(zsrnb);
Free(cvsrnb);
Free(dev);
Free(beta);
Free(covbta); // crash bei trend=1
Free(covbta);
Free(phiwrk);
Free(muwrk);
Free(c0vec);
......@@ -241,7 +238,6 @@ void bk_point(double *xp,
#else
/*
// free(lambda);
free(mu);
free(iwork);
free(berr);
......
#include <R.h>
#include <Rinternals.h>
// #define TRANSIENT
/* #define TRANSIENT */
void bk_point(double *xp,
double *yp,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment