Displaying 3 results from an estimated 3 matches for "rtweedie".
Did you mean:
tweedie
2012 Jun 19
1
Error when trying to update cpglm model
...)
herd<-factor(1:50)
dat<-expand.grid(period=period,herd=herd)
beta<-c(-.3,1.7,2.5,3.4)
X<-model.matrix(~period,dat)
mu<-as.vector(exp(X%*%beta))
phi<-1; p<-1.6
dat$resp<-rtweedie(nrow(dat),p,mu,phi)
## cpglm model
modPC1<-cpglm(resp~period,data=dat)
head(modPC1@model.frame)
## Simulating new response vector and re-fitting the model
sim.hnp<-function(glmfit){
dat.1<-glmfit@model.frame
n<-nrow(dat.1)
dat.1[,1]<-rtweedie(n,glmfit$p,fitted(glmfit),glmfi...
2012 May 23
1
Error message from optim
...lt;-factor(1:10)
dat<-expand.grid(period=period,herd=herd)
beta<-c(-.3,1.7,2.5,3.4)
x<-model.matrix(~period,dat)
b<-rnorm(length(levels(dat$herd)),sd=.3)
z<-model.matrix(~-1+herd,dat)
mu<-as.vector(exp(x%*%beta+z%*%b))
phi<-.8; p<-1.6
dat$resp<-rtweedie(nrow(dat),p,mu,phi)
y<-dat$resp
th<-c(rep(0,ncol(x)),1,1,1.5)
beta<-th[1:ncol(x)]
sig<-th[ncol(x)+1]
phi<-th[ncol(x)+2]
p<-th[ncol(x)+3]
z.ast<-sig*z
l.u<-function(u,y,z,x,beta,phi,p){
eta.u<-as.vector(x%*%beta+z%*%u)
f.y<-log(dtweedie(y,p,exp(eta.u),phi))
...
2012 Sep 11
2
.NAME in .Fortran
...or arch 'i386' ... ERROR
Running examples in 'tweedie-Ex.R' failed
The error most likely occurred in:
### Name: tweedie-package
### Title: Tweedie Distributions
### Aliases: tweedie-package Tweedie
### Keywords: models
### ** Examples
# Generate random numbers
set.seed(314)
y <- rtweedie( 500, p=1.5, mu=1, phi=1)
# With index p between 1 and 2, this produces continuous
# data with exact zeros
x <- rnorm( length(y), 0, 1) # Unrelated predictor
# With exact zeros, index p must be between 1 and 2
# Fit the tweedie distribution; expect p about 1.5
out <- twee...