Displaying 20 results from an estimated 10000 matches similar to: "Question about KLdiv and large datasets"
2009 Sep 22
3
problem using KLdiv - flexmix
I am receiving the following error while executing KLdiv method:
kl<-KLdiv(y)
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "KLdiv", for signature
"data.frame"
the code is as follows:
require(flexmix)
KLdiv(y)
the object y (snippet, actual object contains 188 entries) is as follows:
s1p5 s2p5
1 0.6 0.8
2 0.8
2010 Jul 15
1
KLdiv question (data.frame)
Hi all,
I wonder why KLdiv does not work with data.frames:
n <- 50
mydata <- data.frame(
sequence=c(1:n),
data1=c(rnorm(n)),
data2=c(rnorm(n))
)
# does NOT work
KLdiv(mydata)
# works fine
dataOnly <- cbind(mydata$data1, mydata$data2, mydata$group)
KLdiv(dataOnly)
Any ideas? Is there a better implementation that can deal with
data.frame or is there a simpler way of converting?
Ralf
2010 Jul 15
1
Repeated analysis over groups / Splitting by group variable
I am performing some analysis over a large data frame and would like
to conduct repeated analysis over grouped-up subsets. How can I do
that?
Here some example code for clarification:
require("flexmix") # for Kullback-Leibler divergence
n <- 23
groups <- c(1,2,3)
mydata <- data.frame(
sequence=c(1:n),
data1=c(rnorm(n)),
data2=c(rnorm(n)),
group=rep(sample(groups, n,
2010 Jul 09
1
KLdiv produces NA. Why?
I am trying to calculate a Kullback-Leibler divergence from two
vectors with integers but get NA as a result when trying to calulate
the measure. Why?
x <- cbind(stuff$X, morestuff$X)
x[1:5,]
[,1] [,2]
[1,] 293 938
[2,] 293 942
[3,] 297 949
[4,] 290 956
[5,] 294 959
KLdiv(x)
[,1] [,2]
[1,] 0 NA
[2,] NA 0
Best,
Ralf
2010 Aug 04
0
Kullback–Leibler divergence question (flexmix::KLdiv) Urgent!
Hi all,
x <- cbind(rnorm(500),rnorm(500))
KLdiv(x, eps=1e-4)
KLdiv(x, eps=1e-5)
KLdiv(x, eps=1e-6)
KLdiv(x, eps=1e-7)
KLdiv(x, eps=1e-8)
KLdiv(x, eps=1e-9)
KLdiv(x, eps=1e-10)
...
KLdiv(x, eps=1e-100)
...
KLdiv(x, eps=1e-1000)
When calling flexmix::KLdiv using the given code I get results with
increasing value the smaller I pick the accuracy parameter 'eps' until
finally reaching
2008 Oct 19
0
Kullback Leibler Divergence
Hi there,
I'm trying to find the KL divergence measure between a prior and it's
posterior distributions, and I'm using the KLdiv method in the flexmix
package. plese see the example below:
require(flexmix)
x=seq(-4,4,length=100)
d1=dnorm(x,0,1)
d2=dunif(x,-3,3)
y=cbind(d1,d2)
kl=KLdiv(y)
but let say,
x1=seq(-5,5,length=100)
d3=dunif(x1,-3,3)
y1=cbind(d1,d3)
kl1=KLdiv(y1)
Notice
2010 Aug 04
3
split / lapply over multiple columns
Hi all,
I have a data frame with column over which I would like to run
repeated functions for data analysis. Currently I am only running
recursively over two columns where I column 1 has two states over
which I split and column two has 3 states. The function therefore runs
2 x 3 = 6 times as shown when running the following code:
mydata <- data.frame(userid = c(5, 6, 5, 6, 5, 6), taskid =
2011 Feb 28
1
mixture models/latent class regression comparison
Dear list,
I have been comparing the outputs of two packages for latent class
regression, namely 'flexmix', and 'mmlcr'. What I have noticed is that
the flexmix package appears to come up with a much better fit than the
mmlcr package (based on logLik, AIC, BIC, and visual inspection). Has
anyone else observed such behaviour? Has anyone else been successful
in using the mmlcr
2005 Apr 12
1
R Package: mmlcr and/or flexmix
Greetings
I'm a relatively new R user and I'm trying to build a latent class model.
I've used the 'R Site Search' and it appears there's not much dialogue on
these packages
On mmlcr, I've gotten it working, but not sure if I'm using it correctly.
On flexmix, I can only seem to get results for one class.
I'm attaching my code below - if anyone
2011 Mar 01
1
Problem on flexmix when trying to apply signature developed in one model to a new sample
Problem on flexmix when trying to apply signature developed in one model to a new sample.
Dear
R Users, R Core Team,
I have a problem when trying to know the
classification of the tested cases using two variables with the function of flexmix:
After importing the database and creating
a matrix:
BM<-cbind(Data$var1,Data$var2)
I see that the best model has 2 groups and
use:
ex2
2007 Feb 08
1
smartpred depends on fitted() in flexmix?
Hi,
I was going through the examples in smartpred. It seems there's an
unstated dependency on the fitted() function in package flexmix.
n = 20
set.seed(86)
x = sort(runif(n))
y = sort(runif(n))
library(splines)
fit = lm(y ~ ns(x, df=5))
plot(x, y)
lines(x, fitted(fit)) # won't work w/o prior loading of the flexmix
package.
newx = seq(0, 1, len=n)
points(newx, predict(fit,
2013 Apr 23
2
flexmix
Hi,
I am trying to understand how to use the flexmix package, I have read the Leisch paper but am very unclear what is needed for the M-step driver. I am just fitting a simple linear regression model. The documentation is far from clear what the FLXmclust function does, but, it in principle could do all I need, however, I do not get sentible results as if I try the following the result is poor:
2008 Sep 29
2
density estimate
Hi,
I have a vector or random variables and I'm estimating the density using
"bkde" function in the KernSmooth package. The out put contains two vectors
(x and y), and the R documentation calls y as the density estimates, but my
y-values are not exact density etstimates (since these are numbers larger
than 1)! what is y here? Is it possible to get the true estimated density at
each
2012 Oct 30
1
Data set BregFix in package flexmix
Dear list:
I would like to recreate how the artificial data set BregFix was generated
in package flexmix (thanks Bettina and Friedrich). The data set is
thoroughly described in Grun and Leisch's Computational Statistics & Data
Analysis 51(11) :5247-5252 but references to the appropriate seed number(s)
are missing (providing these details was certainly beyond the scope of the
authors'
2009 Nov 09
1
model based clustering with flexmix
Hello all,
I am trying to fit a truncated mixture model and I wrote a driver for
flexmix following the example in the vignette, but it doesn't work for
me: it assigns all data points to one component only, e.g.:
> > source('bugged.R')
>
> Call:
> flexmix(formula = x ~ 1, k = 2, model = truncatedmodel(lower = -4,
> upper = 4))
>
> prior size
2003 Nov 29
3
performance gap between R 1.7.1 and 1.8.0
Dear R-help,
A colleague of mine was running some code on two of our boxes, and noticed a
rather large difference in running time. We've so far isolated the problem
to the difference between R 1.7.1 and 1.8.0, but not more than that. The
exact same code took 933.5 seconds in 1.7.1, and 3594.4 seconds in 1.8.1, on
the same box.
Basically, the code calls boot() to bootstrap fitting mixture
2007 Apr 16
1
flexmix glm warning
Dear R-helpers & Friedrich Leisch,
I'm trying to fit a mixture of regression models on attached data set
by doing the following:
agl <- read.table("agl.txt")
mod1 <- flexmix(resp~gng+csc|Subject,data=agl,
model=FLXglm(family="binomial"),k=2)
The result is a (varying) number of the following warnings:
Warning messages:
1: non-integer #successes in a
2005 Sep 08
1
clustering: Multivariate t mixtures
Hi,
Before I write code to do it does anyone know of code for fitting
mixtures of multivariate-t distributions.
I can't use McLachan's EMMIX code because the license is "For non
commercial use only".
I checked, mclust and flexmix but both only do Gaussian.
Thanks
Nicholas
2017 Dec 20
1
Nonlinear regression
G'day Timothy,
On Tue, 19 Dec 2017 18:28:00 -0600
Timothy Axberg <axbergtimothy at gmail.com> wrote:
> Should I repost the question with reply-all?
Nope, we got all from Jeff's post. :)
> On Tue, Dec 19, 2017 at 6:13 PM, Jeff Newmiller
> <jdnewmil at dcn.davis.ca.us> wrote:
>
> > You also need to reply-all so the mailing list stays in the loop.
> >
2017 Dec 20
1
Nonlinear regression
You also need to reply-all so the mailing list stays in the loop.
--
Sent from my phone. Please excuse my brevity.
On December 19, 2017 4:00:29 PM PST, Timothy Axberg <axbergtimothy at gmail.com> wrote:
>Sorry about that. Here is the code typed directly on the email.
>
>qe = (Qmax * Kl * ce) / (1 + Kl * ce)
>
>##The data
>ce <- c(15.17, 42.15, 69.12, 237.7, 419.77)