Reference bandwidth smoothing in spatstat - kernel-density

Is there any way to use reference bandwidth selection for kernel smoothing in spatstat package?

"Normal reference" bandwidth selection for two-dimensional point patterns is implemented in spatstat as bw.scott.

Related

Model a 3D Point Pattern using spatstat

Is there any way to fit a spatial statistical model to 3d data in spatstat?
I have tried using the functions such as ppm and kppm but they are not working for pp3
This is not yet supported in spatstat (that is, the model-fitting functions ppm, kppm and mppm do not accept three-dimensional point pattern data).
We are working on it.

Creating a smooth nurb from list of points

I am developing a 3D graphic application in which the user can draw curves.
I record the curve that is drawn by the user and i would like to create a smooth nurb from the recorded set of points.
I tried using the openNurbs library but i could not find a way to do the fitting using the library.
How can i fit a set of points to a nurb?
First of all, I don't think you need nurbs. Fitting a B-spline curve to your data points should be good enough.
If you only have a few dozen points, then it is likely you would like the B-spline curve to exactly pass thru these data points. In this case, you are looking for spline interpolation algorithms. If this is the case, you can use Catmull Rom spline or Overhauser spline to interpolate your data points. Both will create C1 cubic splines and both are easy to implement without the need to solve a linear equation set.
If you have several hundreds of points, then it is likely that you only want the B-spline curve to lie close to the data points. Then, the algorithm you are looking for is least square fitting. You can find plenty of articles (e.g.: link1 ) in this area online. A typical algorithm for least square fitting with B-spline curve will involve these steps:
1) Choose a parametrization for your data points. Chord length parametrization is typically a good choice for least square fitting.
2) Choose the degree for the B-spline. Typically, we use degree 3, i.e., cubic B-spline.
3) Decide number of control points for your B-spline.
4) Decide the knot vector based on the information in the first 3 steps.
5) Solve a linear equation set to find the control points of the B-spline.

visualize decision surface of neural network

Where can I find a program that visualizes (ie, plots) the decision boundary surface of a 2-layer feed-forward neural network? With 1 layer the decision surface is just a bunch of straight lines. But with 2 layers (and possibly sigmoid thresholds for each neuron), the decision surface can be very complex and non-linear, even disjoint I guess. It would be nice to have an interactive tool to get a hands-on "feel" on the network... both for educational purposes and research :)
It depends from the way, your neural network is implemented. If to trust your tags, you used wolfram-mathematica for implementation. It has some tools for visualisation:
http://www.wolfram.com/training/courses/vis411.html
http://reference.wolfram.com/language/ref/ListPointPlot3D.html etc...
For C# visualisation I use http://ilnumerics.net/
And for visualisation in Octave I use built in function mesh ( for 3d ) and plot for 2D.
You just need to choose what to plot. Predicted values, input values, average of two, three, four input values.

Mesh simplification

I wish to develop a softare for 3D object compression (by polygon reduction) in flex using papervision 3D. Could you please suggest me an efficient algorithm for the same?
Take a look at A Short Survey of Mesh Simplification Algorithms and follow the references for the details.

Generating the function of the plane/surface that a given set of coordinates lie on

This is something related with Mathematics as well. But this is useful in computing as well.
Lets say you have 10 coordinates. (x1,y1)(x2,y2)..... in 2D Space. (i.e on a X-Y Plane). Can we find a single smooth curve going across the each coordinate.
While expanding the question, If the space is 3D, then can we find an equation of a smooth surface that going across a given set of spacial coordinates?
Are there any Libraries (Any language) \ tools to perform such calculations?
What you should be looking for is some library implementing NURBS (or Non Uniform Rational B-Splines). This will solve your problem in both 2d and 3d, since 2d is just a special case of the 3d.
Roughly speaking, you are not interested in the actual equation, you are only interested in getting the points approximated with smooth curves or surfaces. This is done by finding "control points" in 2d or 3d space, which are multiplied with B-spline base functions. A NURBS library will do this for you.
Cheers !
Edit:
Have a look at this one
you can always fit an order-10 polynomial through the points. that's not necessarily what you want to do, though - fitting a smooth curve via a series of splines will give you a better-looking result. the curve-fitting article on wikipedia gives you a good overview of the various options.
In the 2D case you are asking for curve fitting. This actually exists in excel, where you plot your points (I usually use XY scatter if you have x and y listed) and then right-click on the curve. Select Add Trendline. There you can choose which kind of function you want to fit to and you can ask excel to display it in the image (Tab named Options, check the box "Display equation on chart"). Nice and quick.
Otherwise you can use matlab and use the lsqr (least square method). If you want to find the polynomial closest that best describes your data you could use the polyfit function. It uses the least square method, but returns coefficients. Matlab has a whole set of other algorithms for solving/finding "best" approximations to systems of linear equations. I mention lsqr because it is one of the simplest to implement yourself if you don't have matlab. On the other hand it is for solving sets of linear equations - I don't know anything about your data.
Have a look at splines
in wiki
an interactive introduction
Searching for 'spline interpolation library' might give some useful hints for implementations.

Resources