mamut86 / diffusion Goto Github PK
View Code? Open in Web Editor NEWR package for forecasting with diffusion models
R package for forecasting with diffusion models
is.diffusion <- function(x){
return(inherits(x,"diffusion"))
}
Include an option for the user to select manually an optimisation algorithm. This goes together with Issue #4
Various time series where NM ends up in a singular matrix
Add package documentation
Maybe we should have a look at: Venkatesan, R., T. V. Krishnan, V. Kumar. 2004. Evolutionary estimation of macro-level diffusion models using genetic algorithms: An alternative to nonlinear least squares.
There is a neat plot in case of type="bass" with innovators and imitators, but it seems that this can also be done for other curves. Here's an example with Shifted Gompertz (not compound with Gamma):
a <- 1000
b <- 0.4
c <- 1
p <- exp(-c)
q <- (b-p)/b
t <- c(0:100)/10
plot(t,a*b*exp(-b*t-c*exp(-b*t))*(1+c*(1-exp(-b*t))),type="l",ylab="y(t)",lwd=2)
# Innovators
lines(t,p*a*b*exp(-b*t-c*exp(-b*t))*(1+c*(1-exp(-b*t))),col="darkgreen",lwd=2)
# Imitators
lines(t,q*a*b*exp(-b*t-c*exp(-b*t))*(1+c*(1-exp(-b*t))),col="darkblue",lwd=2)
Is it possible to do similar plots for other functions?
If forecasts are produced these are unequal to the length requested in the predict.diffusion() function.
Update the (w) parameter to allow for fixed parameters and others to be estimated.
Develop a function (or wrapper) that allows to draw diffusion curve for any manual given paramters
A potential list:
compute standard errors of the parameter estimates
incorporate the ability to use named vector w rather than fixed order and include error handling
add a wrapper, use all NM, BFGS and BOBYQA (to name a few) and pick the one with the lowest MSE
change variables names which some of them are violating good R coding practice, i.e. t and c used
TS object compatibility would ensure that the plots and outputs also handle date information. There is also a bug that actuals are not shown in the plot when entered as TS object
dataSafari <- ts(tsSafari[,-1],frequency=12,start=c(2009,1));
safari6 <- dataSafari[,8];
safari6 <- window(safari6,start=time(safari6)[which(safari6!=0)[1]]);
plot(diffusion(safari6))
plot(diffusion(dataSafari[,8]))
Should go into seqdiffusion() using all parameters at once
Replace sequential if statements with switch()
add documentation for the elements used in diffusionPlot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.